PPL
1.2
|
A grid line, parameter or grid point. More...
#include <Grid_Generator_defs.hh>
Public Types | |
enum | Kind { LINE_OR_EQUALITY = 0, RAY_OR_POINT_OR_INEQUALITY = 1 } |
The possible kinds of Grid_Generator objects. More... | |
enum | Type { LINE, PARAMETER, POINT } |
The generator type. More... | |
typedef Expression_Hide_Last< Expression_Hide_Inhomo< Linear_Expression > > | expr_type |
The type of the (adapted) internal expression. More... | |
Public Member Functions | |
Grid_Generator (Representation r=default_representation) | |
Returns the origin of the zero-dimensional space ![]() | |
Grid_Generator (const Grid_Generator &g) | |
Grid_Generator (const Grid_Generator &g, Representation r) | |
Copy constructor with specified representation. More... | |
Grid_Generator (const Grid_Generator &g, dimension_type space_dim) | |
Grid_Generator (const Grid_Generator &g, dimension_type space_dim, Representation r) | |
Copy constructor with specified space dimension and representation. More... | |
~Grid_Generator () | |
Destructor. More... | |
Grid_Generator & | operator= (const Grid_Generator &g) |
Assignment operator. More... | |
Representation | representation () const |
Returns the current representation of *this. More... | |
void | set_representation (Representation r) |
Converts *this to the specified representation. More... | |
dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . More... | |
void | set_space_dimension (dimension_type space_dim) |
void | swap_space_dimensions (Variable v1, Variable v2) |
Swaps the coefficients of the variables v1 and v2 . More... | |
bool | remove_space_dimensions (const Variables_Set &vars) |
Removes all the specified dimensions from the grid generator. More... | |
void | permute_space_dimensions (const std::vector< Variable > &cycle) |
Permutes the space dimensions of the grid generator. More... | |
void | shift_space_dimensions (Variable v, dimension_type n) |
Type | type () const |
Returns the generator type of *this . More... | |
bool | is_line () const |
Returns true if and only if *this is a line. More... | |
bool | is_parameter () const |
Returns true if and only if *this is a parameter. More... | |
bool | is_line_or_parameter () const |
Returns true if and only if *this is a line or a parameter. More... | |
bool | is_point () const |
Returns true if and only if *this is a point. More... | |
bool | is_parameter_or_point () const |
Returns true if and only if *this row represents a parameter or a point. More... | |
Coefficient_traits::const_reference | coefficient (Variable v) const |
Returns the coefficient of v in *this . More... | |
Coefficient_traits::const_reference | divisor () const |
Returns the divisor of *this . More... | |
memory_size_type | total_memory_in_bytes () const |
Returns a lower bound to the total size in bytes of the memory occupied by *this . More... | |
memory_size_type | external_memory_in_bytes () const |
Returns the size in bytes of the memory managed by *this . More... | |
bool | is_equivalent_to (const Grid_Generator &y) const |
Returns true if and only if *this and y are equivalent generators. More... | |
bool | is_equal_to (const Grid_Generator &y) const |
Returns true if *this is identical to y . More... | |
bool | all_homogeneous_terms_are_zero () const |
Returns true if and only if all the homogeneous terms of *this are ![]() | |
bool | OK () const |
Checks if all the invariants are satisfied. More... | |
void | ascii_dump () const |
Writes to std::cerr an ASCII representation of *this . More... | |
void | ascii_dump (std::ostream &s) const |
Writes to s an ASCII representation of *this . More... | |
void | print () const |
Prints *this to std::cerr using operator<< . More... | |
bool | ascii_load (std::istream &s) |
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. More... | |
void | m_swap (Grid_Generator &y) |
Swaps *this with y . More... | |
void | scale_to_divisor (Coefficient_traits::const_reference d) |
Scales *this to be represented with a divisor of d (if \*this is a parameter or point). Does nothing at all on lines. More... | |
void | set_divisor (Coefficient_traits::const_reference d) |
Sets the divisor of *this to d . More... | |
expr_type | expression () const |
Partial read access to the (adapted) internal expression. More... | |
Static Public Member Functions | |
static Grid_Generator | grid_line (const Linear_Expression &e, Representation r=default_representation) |
Returns the line of direction e . More... | |
static Grid_Generator | parameter (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation) |
static Grid_Generator | parameter (Representation r) |
Returns the parameter of direction and size Linear_Expression::zero() . More... | |
static Grid_Generator | parameter (const Linear_Expression &e, Representation r) |
Returns the parameter of direction and size e . More... | |
static Grid_Generator | grid_point (const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation) |
Returns the point at e / d . More... | |
static Grid_Generator | grid_point (Representation r) |
Returns the point at e . More... | |
static Grid_Generator | grid_point (const Linear_Expression &e, Representation r) |
Returns the point at e . More... | |
static dimension_type | max_space_dimension () |
Returns the maximum space dimension a Grid_Generator can handle. More... | |
static void | initialize () |
Initializes the class. More... | |
static void | finalize () |
Finalizes the class. More... | |
static const Grid_Generator & | zero_dim_point () |
Returns the origin of the zero-dimensional space ![]() | |
Static Public Attributes | |
static const Representation | default_representation = SPARSE |
The representation used for new Grid_Generators. More... | |
Private Member Functions | |
Grid_Generator (dimension_type space_dim, Kind kind, Topology topology, Representation r=default_representation) | |
Grid_Generator (Linear_Expression &e, Type t) | |
Constructs a grid generator of type t from linear expression e , stealing the underlying data structures from e . More... | |
void | set_space_dimension_no_ok (dimension_type space_dim) |
bool | is_equal_at_dimension (dimension_type dim, const Grid_Generator &gg) const |
Returns true if *this is equal to gg in dimension dim . More... | |
void | fancy_print (std::ostream &s) const |
A print function, with fancy, more human-friendly output. More... | |
void | set_is_parameter () |
Converts the Grid_Generator into a parameter. More... | |
void | set_is_line () |
Sets the Grid_Generator kind to LINE_OR_EQUALITY . More... | |
void | set_is_parameter_or_point () |
Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY . More... | |
void | sign_normalize () |
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a line-or-equality is positive. More... | |
void | strong_normalize () |
Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes or hyperspaces. More... | |
bool | check_strong_normalized () const |
Returns true if and only if the coefficients are strongly normalized. More... | |
void | linear_combine (const Grid_Generator &y, dimension_type i) |
Linearly combines *this with y so that i-th coefficient is 0. More... | |
void | throw_dimension_incompatible (const char *method, const char *name_var, const Variable v) const |
Throw a std::invalid_argument exception containing the appropriate error message. More... | |
void | throw_invalid_argument (const char *method, const char *reason) const |
Throw a std::invalid_argument exception containing the appropriate error message. More... | |
Flags inspection methods | |
Topology | topology () const |
Returns the topological kind of *this . More... | |
bool | is_not_necessarily_closed () const |
Returns true if and only if the topology of *this row is not necessarily closed. More... | |
bool | is_necessarily_closed () const |
Returns true if and only if the topology of *this row is necessarily closed. More... | |
bool | is_line_or_equality () const |
Returns true if and only if *this row represents a line or an equality. More... | |
bool | is_ray_or_point_or_inequality () const |
Returns true if and only if *this row represents a ray, a point or an inequality. More... | |
Flags coercion methods | |
void | set_topology (Topology x) |
Sets to x the topological kind of *this row. More... | |
void | set_necessarily_closed () |
Sets to NECESSARILY_CLOSED the topological kind of *this row. More... | |
void | set_not_necessarily_closed () |
Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row. More... | |
void | set_is_line_or_equality () |
Sets to LINE_OR_EQUALITY the kind of *this row. More... | |
void | set_is_ray_or_point_or_inequality () |
Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row. More... | |
Private Attributes | |
Linear_Expression | expr |
Kind | kind_ |
Static Private Attributes | |
static const Grid_Generator * | zero_dim_point_p = 0 |
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional space ![]() | |
Friends | |
class | Expression_Adapter< Grid_Generator > |
class | Grid_Generator_System |
class | Grid |
class | Linear_System< Grid_Generator > |
class | Scalar_Products |
class | Topology_Adjusted_Scalar_Product_Sign |
std::ostream & | IO_Operators::operator<< (std::ostream &s, const Grid_Generator &g) |
int | compare (const Grid_Generator &x, const Grid_Generator &y) |
A grid line, parameter or grid point.
An object of the class Grid_Generator is one of the following:
where is the dimension of the space and, for grid_points and parameters,
is the divisor.
grid_line
, parameter
or grid_point
) to a linear expression; the space dimension of the generator is defined as the space dimension of the corresponding linear expression. Linear expressions used to define a generator should be homogeneous (any constant term will be simply ignored). When defining grid points and parameters, an optional Coefficient argument can be used as a common divisor for all the coefficients occurring in the provided linear expression; the default value for this argument is 1.x
, y
and z
are defined as follows: q
is not the same as the parameter q1
defined by point
is optional. grid_point
(the divisor): g1
is a grid point having coordinates g2
having coordinates Definition at line 271 of file Grid_Generator_defs.hh.
typedef Expression_Hide_Last<Expression_Hide_Inhomo<Linear_Expression> > Parma_Polyhedra_Library::Grid_Generator::expr_type |
The type of the (adapted) internal expression.
Definition at line 535 of file Grid_Generator_defs.hh.
|
inlineexplicit |
Returns the origin of the zero-dimensional space .
Definition at line 93 of file Grid_Generator_inlines.hh.
References expr, OK(), and Parma_Polyhedra_Library::Linear_Expression::set_space_dimension().
|
inline |
Ordinary copy constructor. The new Grid_Generator will have the same representation as g.
Definition at line 101 of file Grid_Generator_inlines.hh.
|
inline |
Copy constructor with specified representation.
Definition at line 107 of file Grid_Generator_inlines.hh.
|
inline |
Copy constructor with specified space dimension. The new Grid_Generator will have the same representation as g.
Definition at line 124 of file Grid_Generator_inlines.hh.
References OK(), and space_dimension().
|
inline |
Copy constructor with specified space dimension and representation.
Definition at line 133 of file Grid_Generator_inlines.hh.
References OK(), and space_dimension().
|
inline |
|
inlineprivate |
Constructs a Grid_Generator with the specified space dimension, kind and topology.
Definition at line 113 of file Grid_Generator_inlines.hh.
References expr, Parma_Polyhedra_Library::NECESSARILY_CLOSED, PPL_USED, Parma_Polyhedra_Library::Linear_Expression::set_space_dimension(), and space_dimension().
|
inlineprivate |
Constructs a grid generator of type t
from linear expression e
, stealing the underlying data structures from e
.
The last column in e
becomes the parameter divisor column of the new Grid_Generator.
Definition at line 81 of file Grid_Generator_inlines.hh.
References expr, kind_, LINE, LINE_OR_EQUALITY, OK(), RAY_OR_POINT_OR_INEQUALITY, and swap().
bool Parma_Polyhedra_Library::Grid_Generator::all_homogeneous_terms_are_zero | ( | ) | const |
Returns true
if and only if all the homogeneous terms of *this
are .
Definition at line 296 of file Grid_Generator.cc.
Referenced by Parma_Polyhedra_Library::Grid_Generator_System::insert(), and Parma_Polyhedra_Library::Grid_Generator_System::remove_invalid_lines_and_parameters().
void Parma_Polyhedra_Library::Grid_Generator::ascii_dump | ( | ) | const |
Writes to std::cerr
an ASCII representation of *this
.
Referenced by Parma_Polyhedra_Library::Grid::OK().
void Parma_Polyhedra_Library::Grid_Generator::ascii_dump | ( | std::ostream & | s | ) | const |
Writes to s
an ASCII representation of *this
.
Definition at line 186 of file Grid_Generator.cc.
bool Parma_Polyhedra_Library::Grid_Generator::ascii_load | ( | std::istream & | s | ) |
Loads from s
an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this
accordingly. Returns true
if successful, false
otherwise.
Definition at line 206 of file Grid_Generator.cc.
|
private |
Returns true
if and only if the coefficients are strongly normalized.
Definition at line 326 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::compare(), and strong_normalize().
|
inline |
Returns the coefficient of v
in *this
.
std::invalid_argument | Thrown if the index of v is greater than or equal to the space dimension of *this . |
Definition at line 277 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::Linear_Expression::coefficient(), expr, Parma_Polyhedra_Library::Variable::space_dimension(), space_dimension(), and throw_dimension_incompatible().
Referenced by Parma_Polyhedra_Library::Grid::constrains(), and Parma_Polyhedra_Library::Grid::wrap_assign().
|
inline |
Returns the divisor of *this
.
std::invalid_argument | Thrown if *this is a line. |
Definition at line 239 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::Linear_Expression::coefficient(), expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), is_line(), is_line_or_parameter(), space_dimension(), and throw_invalid_argument().
Referenced by Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid::Grid(), is_equal_at_dimension(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::max_min(), Parma_Polyhedra_Library::Grid::normalize_divisors(), OK(), Parma_Polyhedra_Library::Grid::relation_with(), Parma_Polyhedra_Library::Congruence_System::satisfies_all_congruences(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), and Parma_Polyhedra_Library::Grid::wrap_assign().
|
inline |
Partial read access to the (adapted) internal expression.
Definition at line 146 of file Grid_Generator_inlines.hh.
References expr.
Referenced by Parma_Polyhedra_Library::Grid::constrains(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::max_min(), Parma_Polyhedra_Library::Grid::select_wider_generators(), and space_dimension().
|
inline |
Returns the size in bytes of the memory managed by *this
.
Definition at line 290 of file Grid_Generator_inlines.hh.
References expr, and Parma_Polyhedra_Library::Linear_Expression::external_memory_in_bytes().
Referenced by total_memory_in_bytes().
|
private |
A print function, with fancy, more human-friendly output.
This is used by operator<<().
Definition at line 348 of file Grid_Generator.cc.
References c, LINE, Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::IO_Operators::operator<<(), PARAMETER, POINT, and PPL_DIRTY_TEMP_COEFFICIENT.
Referenced by operator<<().
|
static |
Finalizes the class.
Definition at line 341 of file Grid_Generator.cc.
Referenced by Parma_Polyhedra_Library::Init::~Init().
|
static |
Returns the line of direction e
.
std::invalid_argument | Thrown if the homogeneous part of e represents the origin of the vector space. |
Definition at line 124 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Linear_Expression::all_homogeneous_terms_are_zero(), Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), Parma_Polyhedra_Library::Linear_Expression::space_dimension(), and strong_normalize().
Referenced by grid_line().
|
static |
Returns the point at e
/ d
.
Both e
and d
are optional arguments, with default values Linear_Expression::zero() and Coefficient_one(), respectively.
std::invalid_argument | Thrown if d is zero. |
Definition at line 86 of file Grid_Generator.cc.
References expr, Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::Linear_Expression::normalize(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and Parma_Polyhedra_Library::Linear_Expression::space_dimension().
Referenced by grid_point().
|
static |
Returns the point at e
.
Definition at line 113 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Coefficient_one(), and Parma_Polyhedra_Library::Linear_Expression::zero().
|
static |
Returns the point at e
.
Definition at line 118 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Coefficient_one().
|
static |
Initializes the class.
Definition at line 335 of file Grid_Generator.cc.
Referenced by Parma_Polyhedra_Library::Init::Init().
|
inlineprivate |
Returns true
if *this
is equal to gg
in dimension dim
.
Definition at line 252 of file Grid_Generator_inlines.hh.
References divisor(), expr, and Parma_Polyhedra_Library::Linear_Expression::get().
Referenced by Parma_Polyhedra_Library::Grid::select_wider_generators().
bool Parma_Polyhedra_Library::Grid_Generator::is_equal_to | ( | const Grid_Generator & | y | ) | const |
Returns true
if *this
is identical to y
.
This is faster than is_equivalent_to(), but it may return `false' even for equivalent generators.
Definition at line 291 of file Grid_Generator.cc.
Referenced by is_equivalent_to(), and Parma_Polyhedra_Library::Grid::OK().
bool Parma_Polyhedra_Library::Grid_Generator::is_equivalent_to | ( | const Grid_Generator & | y | ) | const |
Returns true
if and only if *this
and y
are equivalent generators.
Generators having different space dimensions are not equivalent.
Definition at line 264 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Coefficient_zero(), expr, is_equal_to(), Parma_Polyhedra_Library::Linear_Expression::normalize(), Parma_Polyhedra_Library::Linear_Expression::set(), space_dimension(), and type().
Referenced by operator==().
|
inline |
Returns true
if and only if *this
is a line.
Definition at line 203 of file Grid_Generator_inlines.hh.
References is_line_or_equality().
Referenced by Parma_Polyhedra_Library::Grid::constrains(), divisor(), Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid::multiply_grid(), Parma_Polyhedra_Library::Congruence_System::satisfies_all_congruences(), set_divisor(), Parma_Polyhedra_Library::Grid::simplify(), and type().
|
inlineprivate |
Returns true
if and only if *this
row represents a line or an equality.
Definition at line 40 of file Grid_Generator_inlines.hh.
References kind_, and LINE_OR_EQUALITY.
Referenced by compare(), and is_line().
|
inline |
Returns true
if and only if *this
is a line or a parameter.
Definition at line 213 of file Grid_Generator_inlines.hh.
References expr, and Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term().
Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), Parma_Polyhedra_Library::Grid::bounds_no_check(), divisor(), Parma_Polyhedra_Library::Grid::is_bounded(), is_parameter(), is_point(), Parma_Polyhedra_Library::Grid_Generator_System::remove_invalid_lines_and_parameters(), and set_divisor().
|
inlineprivate |
Returns true
if and only if the topology of *this
row is necessarily closed.
Definition at line 30 of file Grid_Generator_inlines.hh.
Referenced by OK().
|
inlineprivate |
Returns true
if and only if the topology of *this
row is not necessarily closed.
Definition at line 35 of file Grid_Generator_inlines.hh.
|
inline |
Returns true
if and only if *this
is a parameter.
Definition at line 208 of file Grid_Generator_inlines.hh.
References is_line_or_parameter(), and is_parameter_or_point().
Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid_Generator_System::insert(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), and strong_normalize().
|
inline |
Returns true
if and only if *this
row represents a parameter or a point.
Definition at line 223 of file Grid_Generator_inlines.hh.
References is_ray_or_point_or_inequality().
Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), is_parameter(), Parma_Polyhedra_Library::Grid::multiply_grid(), Parma_Polyhedra_Library::Grid::normalize_divisors(), Parma_Polyhedra_Library::Grid::reduce_parameter_with_line(), and Parma_Polyhedra_Library::Grid::simplify().
|
inline |
Returns true
if and only if *this
is a point.
Definition at line 218 of file Grid_Generator_inlines.hh.
References is_line_or_parameter().
Referenced by Parma_Polyhedra_Library::Grid::frequency_no_check(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Grid::simplify_using_context_assign(), Parma_Polyhedra_Library::Grid::time_elapse_assign(), and type().
|
inlineprivate |
Returns true
if and only if *this
row represents a ray, a point or an inequality.
Definition at line 45 of file Grid_Generator_inlines.hh.
References kind_, and RAY_OR_POINT_OR_INEQUALITY.
Referenced by is_parameter_or_point().
|
private |
Linearly combines *this
with y
so that i-th coefficient is 0.
y | The Grid_Generator that will be combined with *this object; |
i | The index of the coefficient that has to become ![]() |
Computes a linear combination of *this
and y
having the i-th coefficient equal to . Then it assigns the resulting Grid_Generator to
*this
and normalizes it.
Definition at line 244 of file Grid_Generator.cc.
References expr.
|
inline |
Swaps *this
with y
.
Definition at line 308 of file Grid_Generator_inlines.hh.
References expr, kind_, swap(), and Parma_Polyhedra_Library::swap().
Referenced by swap().
|
inlinestatic |
Returns the maximum space dimension a Grid_Generator can handle.
Definition at line 161 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::Linear_Expression::max_space_dimension().
bool Parma_Polyhedra_Library::Grid_Generator::OK | ( | ) | const |
Checks if all the invariants are satisfied.
Definition at line 443 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Linear_Expression::coefficient(), divisor(), expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), is_necessarily_closed(), LINE, PARAMETER, POINT, Parma_Polyhedra_Library::Linear_Expression::space_dimension(), and type().
Referenced by Parma_Polyhedra_Library::Grid_Generator_System::add_universe_rows_and_columns(), Parma_Polyhedra_Library::Grid_Generator_System::affine_image(), Parma_Polyhedra_Library::Grid::Grid(), Grid_Generator(), Parma_Polyhedra_Library::Grid::reduce_line_with_line(), and Parma_Polyhedra_Library::Grid::relation_with().
|
inline |
Assignment operator.
Definition at line 269 of file Grid_Generator_inlines.hh.
References swap().
|
static |
Returns the parameter of direction e
and size e/d
, with the same representation as e.
Both e
and d
are optional arguments, with default values Linear_Expression::zero() and Coefficient_one(), respectively.
std::invalid_argument | Thrown if d is zero. |
Definition at line 56 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Coefficient_zero(), Parma_Polyhedra_Library::neg_assign(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and Parma_Polyhedra_Library::Linear_Expression::space_dimension().
Referenced by parameter().
|
static |
Returns the parameter of direction and size Linear_Expression::zero()
.
|
static |
Returns the parameter of direction and size e
.
void Parma_Polyhedra_Library::Grid_Generator::permute_space_dimensions | ( | const std::vector< Variable > & | cycle | ) |
Permutes the space dimensions of the grid generator.
Definition at line 167 of file Grid_Generator.cc.
void Parma_Polyhedra_Library::Grid_Generator::print | ( | ) | const |
Prints *this
to std::cerr
using operator<<
.
bool Parma_Polyhedra_Library::Grid_Generator::remove_space_dimensions | ( | const Variables_Set & | vars | ) |
Removes all the specified dimensions from the grid generator.
The space dimension of the variable with the highest space dimension in vars
must be at most the space dimension of this
.
Always returns true
. The return value is needed for compatibility with the Generator class.
Definition at line 156 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Variables_Set::space_dimension().
|
inline |
Returns the current representation of *this.
Definition at line 151 of file Grid_Generator_inlines.hh.
References expr, and Parma_Polyhedra_Library::Linear_Expression::representation().
void Parma_Polyhedra_Library::Grid_Generator::scale_to_divisor | ( | Coefficient_traits::const_reference | d | ) |
Scales *this
to be represented with a divisor of d
(if \*this is a parameter or point). Does nothing at all on lines.
It is assumed that d
is a multiple of the current divisor and different from zero. The behavior is undefined if the assumption does not hold.
Definition at line 302 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::exact_div_assign(), and PPL_DIRTY_TEMP_COEFFICIENT.
Referenced by Parma_Polyhedra_Library::Grid::Grid().
|
inline |
Sets the divisor of *this
to d
.
std::invalid_argument | Thrown if *this is a line. |
Definition at line 228 of file Grid_Generator_inlines.hh.
References expr, is_line(), is_line_or_parameter(), Parma_Polyhedra_Library::Linear_Expression::set_coefficient(), Parma_Polyhedra_Library::Linear_Expression::set_inhomogeneous_term(), and space_dimension().
|
inlineprivate |
Sets the Grid_Generator kind to LINE_OR_EQUALITY
.
Definition at line 259 of file Grid_Generator_inlines.hh.
References set_is_line_or_equality().
|
inlineprivate |
Sets to LINE_OR_EQUALITY
the kind of *this
row.
Definition at line 55 of file Grid_Generator_inlines.hh.
References kind_, and LINE_OR_EQUALITY.
Referenced by set_is_line().
|
private |
Converts the Grid_Generator into a parameter.
Definition at line 232 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Coefficient_zero().
Referenced by Parma_Polyhedra_Library::Grid::relation_with(), and Parma_Polyhedra_Library::Grid::time_elapse_assign().
|
inlineprivate |
Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY
.
Definition at line 264 of file Grid_Generator_inlines.hh.
References set_is_ray_or_point_or_inequality().
|
inlineprivate |
Sets to RAY_OR_POINT_OR_INEQUALITY
the kind of *this
row.
Definition at line 60 of file Grid_Generator_inlines.hh.
References kind_, and RAY_OR_POINT_OR_INEQUALITY.
Referenced by set_is_parameter_or_point().
|
inlineprivate |
Sets to NECESSARILY_CLOSED
the topological kind of *this
row.
Definition at line 71 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::NECESSARILY_CLOSED, and set_topology().
|
inlineprivate |
Sets to NOT_NECESSARILY_CLOSED
the topological kind of *this
row.
Definition at line 76 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and set_topology().
|
inline |
Converts *this to the specified representation.
Definition at line 156 of file Grid_Generator_inlines.hh.
References expr, and Parma_Polyhedra_Library::Linear_Expression::set_representation().
|
inline |
Sets the dimension of the vector space enclosing *this
to space_dim
.
Definition at line 171 of file Grid_Generator_inlines.hh.
References expr, Parma_Polyhedra_Library::Linear_Expression::set_space_dimension(), space_dimension(), and Parma_Polyhedra_Library::Linear_Expression::swap_space_dimensions().
Referenced by set_space_dimension_no_ok().
|
inlineprivate |
Sets the dimension of the vector space enclosing *this
to space_dim
. Sets the space dimension of the rows in the system to space_dim
.
This method is for internal use, it does *not* assert OK() at the end, so it can be used for invalid objects.
Definition at line 185 of file Grid_Generator_inlines.hh.
References set_space_dimension().
|
inlineprivate |
Sets to x
the topological kind of *this
row.
Definition at line 65 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::NECESSARILY_CLOSED, and PPL_USED.
Referenced by Parma_Polyhedra_Library::Grid::conversion(), set_necessarily_closed(), and set_not_necessarily_closed().
|
inline |
Shift by n
positions the coefficients of variables, starting from the coefficient of v
. This increases the space dimension by n
.
Definition at line 190 of file Grid_Generator_inlines.hh.
References expr, and Parma_Polyhedra_Library::Linear_Expression::shift_space_dimensions().
|
private |
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a line-or-equality is positive.
Definition at line 319 of file Grid_Generator.cc.
Referenced by strong_normalize().
|
inline |
Returns the dimension of the vector space enclosing *this
.
Definition at line 166 of file Grid_Generator_inlines.hh.
References expression(), and Parma_Polyhedra_Library::Expression_Hide_Last< T >::space_dimension().
Referenced by Parma_Polyhedra_Library::Grid::add_grid_generator(), Parma_Polyhedra_Library::Scalar_Products::assign(), coefficient(), divisor(), Grid_Generator(), Parma_Polyhedra_Library::Scalar_Products::homogeneous_assign(), Parma_Polyhedra_Library::Grid_Generator_System::insert(), is_equivalent_to(), Parma_Polyhedra_Library::Scalar_Products::reduced_assign(), Parma_Polyhedra_Library::Grid::relation_with(), Parma_Polyhedra_Library::Congruence_System::satisfies_all_congruences(), set_divisor(), set_space_dimension(), throw_dimension_incompatible(), and Parma_Polyhedra_Library::Grid::throw_dimension_incompatible().
|
inlineprivate |
Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes or hyperspaces.
Applies both Grid_Generator::normalize() and Grid_Generator::sign_normalize().
Definition at line 301 of file Grid_Generator_inlines.hh.
References expr, is_parameter(), Parma_Polyhedra_Library::Linear_Expression::normalize(), and sign_normalize().
Referenced by check_strong_normalized(), grid_line(), and Parma_Polyhedra_Library::Grid::relation_with().
Swaps the coefficients of the variables v1
and v2
.
Definition at line 144 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Variable::space_dimension().
|
private |
Throw a std::invalid_argument
exception containing the appropriate error message.
Definition at line 36 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::Variable::space_dimension(), and space_dimension().
Referenced by coefficient().
|
private |
Throw a std::invalid_argument
exception containing the appropriate error message.
Definition at line 47 of file Grid_Generator.cc.
Referenced by divisor().
|
inlineprivate |
Returns the topological kind of *this
.
Definition at line 50 of file Grid_Generator_inlines.hh.
References Parma_Polyhedra_Library::NECESSARILY_CLOSED.
|
inline |
Returns a lower bound to the total size in bytes of the memory occupied by *this
.
Definition at line 285 of file Grid_Generator_inlines.hh.
References external_memory_in_bytes().
|
inline |
Returns the generator type of *this
.
Definition at line 195 of file Grid_Generator_inlines.hh.
References is_line(), is_point(), LINE, PARAMETER, and POINT.
Referenced by is_equivalent_to(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), OK(), and Parma_Polyhedra_Library::Grid::relation_with().
|
inlinestatic |
Returns the origin of the zero-dimensional space .
Definition at line 295 of file Grid_Generator_inlines.hh.
References zero_dim_point_p.
Referenced by Parma_Polyhedra_Library::Grid_Generator_System::initialize().
|
related |
The basic comparison function.
x | A row of coefficients; |
y | Another row. |
Compares x
and y
, where x
and y
may be of different size, in which case the "missing" coefficients are assumed to be zero. The comparison is such that:
size()
, 0;x
and y
are different, the absolute value of the result is 1 if the difference is due to the coefficient in position 0; it is 2 otherwise.When x
and y
represent the hyper-planes associated to two equality or inequality constraints, the coefficient at 0 is the known term. In this case, the return value can be characterized as follows:
x
is smaller than y
and they are not parallel;x
is smaller than y
and they are parallel;x
and y are equal;y
is smaller than x
and they are parallel;y
is smaller than x
and they are not parallel.
|
related |
Definition at line 252 of file Grid_Generator.cc.
References Parma_Polyhedra_Library::compare(), expr, and is_line_or_equality().
|
friend |
|
friend |
Definition at line 704 of file Grid_Generator_defs.hh.
|
friend |
Definition at line 706 of file Grid_Generator_defs.hh.
|
friend |
Definition at line 705 of file Grid_Generator_defs.hh.
|
related |
Definition at line 328 of file Grid_Generator_inlines.hh.
References grid_line().
|
related |
|
related |
Definition at line 353 of file Grid_Generator_inlines.hh.
References grid_point().
|
related |
Definition at line 360 of file Grid_Generator_inlines.hh.
References grid_point().
|
related |
Definition at line 366 of file Grid_Generator_inlines.hh.
References grid_point().
|
related |
|
related |
Shorthand for Grid_Generator::grid_point(Representation r).
|
related |
|
friend |
|
friend |
Definition at line 707 of file Grid_Generator_defs.hh.
|
related |
Definition at line 322 of file Grid_Generator_inlines.hh.
|
related |
Returns true
if and only if x
is not equivalent to y
.
|
related |
Output operator.
|
related |
Definition at line 417 of file Grid_Generator.cc.
References fancy_print().
|
related |
|
related |
Output operator.
|
related |
Definition at line 316 of file Grid_Generator_inlines.hh.
References is_equivalent_to().
|
related |
Returns true
if and only if x
is equivalent to y
.
|
related |
Definition at line 334 of file Grid_Generator_inlines.hh.
References parameter().
|
related |
Definition at line 341 of file Grid_Generator_inlines.hh.
References parameter().
|
related |
Definition at line 347 of file Grid_Generator_inlines.hh.
References parameter().
|
related |
|
related |
Shorthand for Grid_Generator::parameter(Representation r).
|
related |
|
friend |
Definition at line 708 of file Grid_Generator_defs.hh.
|
related |
Swaps x
with y
.
Referenced by Grid_Generator(), m_swap(), and operator=().
|
related |
Definition at line 372 of file Grid_Generator_inlines.hh.
References m_swap().
|
friend |
Definition at line 709 of file Grid_Generator_defs.hh.
|
static |
The representation used for new Grid_Generators.
Definition at line 286 of file Grid_Generator_defs.hh.
|
private |
Definition at line 540 of file Grid_Generator_defs.hh.
Referenced by Parma_Polyhedra_Library::Grid_Generator_System::add_universe_rows_and_columns(), Parma_Polyhedra_Library::Grid_Generator_System::affine_image(), Parma_Polyhedra_Library::Scalar_Products::assign(), coefficient(), compare(), Parma_Polyhedra_Library::Grid::conversion(), divisor(), expression(), external_memory_in_bytes(), Parma_Polyhedra_Library::Grid::Grid(), Grid_Generator(), grid_point(), Parma_Polyhedra_Library::Scalar_Products::homogeneous_assign(), Parma_Polyhedra_Library::Scalar_Products::homogeneous_sign(), is_equal_at_dimension(), is_equal_to(), is_equivalent_to(), is_line_or_parameter(), linear_combine(), m_swap(), Parma_Polyhedra_Library::Grid::multiply_grid(), OK(), Parma_Polyhedra_Library::Grid::reduce_line_with_line(), Parma_Polyhedra_Library::Grid::reduce_parameter_with_line(), Parma_Polyhedra_Library::Scalar_Products::reduced_assign(), Parma_Polyhedra_Library::Grid::relation_with(), representation(), set_divisor(), set_representation(), set_space_dimension(), shift_space_dimensions(), Parma_Polyhedra_Library::Grid::simplify(), strong_normalize(), and Parma_Polyhedra_Library::Grid::upper_triangular().
|
private |
Definition at line 542 of file Grid_Generator_defs.hh.
Referenced by Grid_Generator(), is_equal_to(), is_line_or_equality(), is_ray_or_point_or_inequality(), m_swap(), set_is_line_or_equality(), and set_is_ray_or_point_or_inequality().
|
staticprivate |
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional space .
Definition at line 548 of file Grid_Generator_defs.hh.
Referenced by zero_dim_point().