24 #ifndef PPL_Grid_Generator_defs_hh
25 #define PPL_Grid_Generator_defs_hh 1
47 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
83 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
84 int compare(
const Grid_Generator& x,
const Grid_Generator& y);
86 namespace IO_Operators {
90 std::ostream&
operator<<(std::ostream& s,
const Grid_Generator& g);
96 void swap(Grid_Generator& x, Grid_Generator& y);
308 Coefficient_traits::const_reference d
330 Coefficient_traits::const_reference d
460 Coefficient_traits::const_reference
divisor()
const;
531 void set_divisor(Coefficient_traits::const_reference d);
688 const char* name_var,
784 namespace IO_Operators {
796 #endif // !defined(PPL_Grid_Generator_defs_hh)
bool is_parameter_or_point() const
Returns true if and only if *this row represents a parameter or a point.
Scalar product sign function object depending on topology.
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
Grid_Generator & operator=(const Grid_Generator &g)
Assignment operator.
void swap(CO_Tree &x, CO_Tree &y)
The base class for systems of constraints and generators.
void set_is_parameter_or_point()
Sets the Grid_Generator kind to RAY_OR_POINT_OR_INEQUALITY.
bool is_equal_to(const Grid_Generator &y) const
Returns true if *this is identical to y.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the grid generator.
void set_not_necessarily_closed()
Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row.
~Grid_Generator()
Destructor.
An std::set of variables' indexes.
An adapter for Linear_Expression objects.
void set_necessarily_closed()
Sets to NECESSARILY_CLOSED the topological kind of *this row.
bool is_line() const
Returns true if and only if *this is a line.
void m_swap(Grid_Generator &y)
Swaps *this with y.
bool remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the grid generator.
bool is_equal_at_dimension(dimension_type dim, const Grid_Generator &gg) const
Returns true if *this is equal to gg in dimension dim.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
bool is_not_necessarily_closed() const
Returns true if and only if the topology of *this row is not necessarily closed.
static const Grid_Generator & zero_dim_point()
Returns the origin of the zero-dimensional space .
void set_space_dimension_no_ok(dimension_type space_dim)
bool check_strong_normalized() const
Returns true if and only if the coefficients are strongly normalized.
void fancy_print(std::ostream &s) const
A print function, with fancy, more human-friendly output.
expr_type expression() const
Partial read access to the (adapted) internal expression.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
Representation representation() const
Returns the current representation of *this.
A dimension of the vector space.
void set_is_ray_or_point_or_inequality()
Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row.
void set_space_dimension(dimension_type space_dim)
Expression_Hide_Last< Expression_Hide_Inhomo< Linear_Expression > > expr_type
The type of the (adapted) internal expression.
#define PPL_OUTPUT_DECLARATIONS
static dimension_type max_space_dimension()
Returns the maximum space dimension a Grid_Generator can handle.
static Grid_Generator parameter(const Linear_Expression &e=Linear_Expression::zero(), Coefficient_traits::const_reference d=Coefficient_one(), Representation r=default_representation)
static void finalize()
Finalizes the class.
Coefficient_traits::const_reference divisor() const
Returns the divisor of *this.
Topology topology() const
Returns the topological kind of *this.
bool is_necessarily_closed() const
Returns true if and only if the topology of *this row is necessarily closed.
friend int compare(const Grid_Generator &x, const Grid_Generator &y)
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void set_divisor(Coefficient_traits::const_reference d)
Sets the divisor of *this to d.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
bool is_point() const
Returns true if and only if *this is a point.
Type type() const
Returns the generator type of *this.
void shift_space_dimensions(Variable v, dimension_type n)
static const Grid_Generator * zero_dim_point_p
Holds (between class initialization and finalization) a pointer to the origin of the zero-dimensional...
Kind
The possible kinds of Grid_Generator objects.
int compare(const Linear_Expression &x, const Linear_Expression &y)
bool is_equivalent_to(const Grid_Generator &y) const
Returns true if and only if *this and y are equivalent generators.
void set_topology(Topology x)
Sets to x the topological kind of *this row.
void linear_combine(const Grid_Generator &y, dimension_type i)
Linearly combines *this with y so that i-th coefficient is 0.
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
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. ...
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
bool is_line_or_equality() const
Returns true if and only if *this row represents a line or an equality.
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.
The entire library is confined to this namespace.
bool all_homogeneous_terms_are_zero() const
Returns true if and only if all the homogeneous terms of *this are .
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static Grid_Generator grid_line(const Linear_Expression &e, Representation r=default_representation)
Returns the line of direction e.
bool is_ray_or_point_or_inequality() const
Returns true if and only if *this row represents a ray, a point or an inequality. ...
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
Sparse representation: only the nonzero coefficient are stored. If there are many nonzero coefficient...
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
void strong_normalize()
Strong normalization: ensures that different Grid_Generator objects represent different hyperplanes o...
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void throw_invalid_argument(const char *method, const char *reason) const
Throw a std::invalid_argument exception containing the appropriate error message. ...
static const Linear_Expression & zero()
Returns the (zero-dimension space) constant 0.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
bool is_parameter() const
Returns true if and only if *this is a parameter.
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
void set_is_line_or_equality()
Sets to LINE_OR_EQUALITY the kind of *this row.
static const Representation default_representation
The representation used for new Grid_Generators.
void set_is_line()
Sets the Grid_Generator kind to LINE_OR_EQUALITY.
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.
Grid_Generator(Representation r=default_representation)
Returns the origin of the zero-dimensional space .
bool OK() const
Checks if all the invariants are satisfied.
static void initialize()
Initializes the class.
An adapter for Linear_Expression that maybe hides the last coefficient.
A grid line, parameter or grid point.
Topology
Kinds of polyhedra domains.
A class implementing various scalar product functions.
A system of grid generators.
void set_representation(Representation r)
Converts *this to the specified representation.
void set_is_parameter()
Converts the Grid_Generator into a parameter.