24 #include "ppl-config.h"
30 #include "assertions.hh"
82 Coefficient_traits::const_reference denominator) {
88 PPL_ASSERT(denominator > 0);
99 if (denominator != 1) {
105 row.
expr *= denominator;
109 PPL_ASSERT(row.
OK());
112 PPL_ASSERT(sys.OK());
118 if (not_invertible) {
132 if (!sys.ascii_load(s)) {
145 PPL_ASSERT(zero_dim_univ_p == 0);
152 PPL_ASSERT(zero_dim_univ_p != 0);
153 delete zero_dim_univ_p;
161 std::cerr <<
"Grid_Generator_System is NOT_NECESSARILY_CLOSED"
167 if (sys.is_sorted()) {
169 std::cerr <<
"Grid_Generator_System is marked as sorted."
202 set_space_dimension(space_dimension() + dims);
209 PPL_ASSERT(tmp.
OK());
218 sys.remove_space_dimensions(vars);
224 sys.shift_space_dimensions(v, n);
230 sys.set_space_dimension(new_dimension);
246 sys.remove_row(i,
false);
258 if (!ggs[i].is_line_or_parameter()) {
269 PPL_ASSERT(sys.num_pending_rows() == 0);
274 if (sys.is_sorted()) {
282 if (ggs[i].is_line()) {
294 PPL_ASSERT(sys.num_pending_rows() == 0);
300 if (sys.is_sorted()) {
302 i != 0 && ggs[--i].is_parameter_or_point(); ) {
303 if (ggs[i].is_line_or_parameter()) {
310 if (ggs[i].is_parameter()) {
static const Grid_Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
size_t dimension_type
An unsigned integral type for representing space dimensions.
An std::set of variables' indexes.
Linear_System< Grid_Generator > sys
const_iterator end() const
Returns the past-the-end const_iterator.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
Enable_If< Is_Native_Or_Checked< T >::value, void >::type ascii_dump(std::ostream &s, const T &t)
void clear()
Removes all the generators from the generator system and sets its space dimension to 0...
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
bool has_points() const
Returns true if and only if *this contains one or more points.
static const Grid_Generator & zero_dim_point()
Returns the origin of the zero-dimensional space .
dimension_type num_lines() const
Returns the number of lines in the system.
The standard C++ namespace.
const_iterator begin() const
Returns the const_iterator pointing to the first generator, if this is not empty; otherwise...
void add_universe_rows_and_columns(dimension_type dims)
Adds dims rows and dims columns of zeroes to the matrix, initializing the added rows as in the univer...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_coefficient(Variable v, Coefficient_traits::const_reference n)
Sets the coefficient of v in *this to n.
void set_space_dimension(dimension_type space_dim)
Resizes the system to the specified space dimension.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
A dimension of the vector space.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
An iterator over a system of grid generators.
bool OK() const
Checks if all the invariants are satisfied.
bool is_line_or_parameter() const
Returns true if and only if *this is a line or a parameter.
void affine_image(Variable v, const Linear_Expression &expr, Coefficient_traits::const_reference denominator)
Assigns to a given variable an affine expression.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the generator system.
#define PPL_OUTPUT_DEFINITIONS(class_name)
void remove_invalid_lines_and_parameters()
Removes all the invalid lines and parameters.
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 void finalize()
Finalizes the class.
dimension_type num_rows() const
Returns the number of rows (generators) in the system.
void shift_space_dimensions(Variable v, dimension_type n)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static void assign(Coefficient &z, const Linear_Expression &x, const Linear_Expression &y)
Computes the scalar product of x and y and assigns it to z.
static void initialize()
Initializes the class.
dimension_type num_parameters() const
Returns the number of parameters in the system.
bool is_parameter() const
Returns true if and only if *this is a parameter.
bool OK() const
Checks if all the invariants are satisfied.
void insert(const Grid_Generator &g)
Inserts into *this a copy of the generator g, increasing the number of space dimensions if needed...
A grid line, parameter or grid point.
A system of grid generators.