24 #include "ppl-config.h"
81 if (row > num_columns) {
86 while (num_columns > 0) {
93 if (gen.
expr.
get(num_columns) <= 0) {
103 return num_columns == row;
110 if (multiplier == 1) {
116 gen.
expr *= multiplier;
125 generator.
expr *= multiplier;
135 if (multiplier == 1) {
144 congruence.
scale(multiplier);
151 cg.
scale(multiplier);
189 lcm_assign(diagonal_lcm, diagonal_lcm, source[source_index].expr.get(dim));
196 PPL_ASSERT(source_index == 0);
199 PPL_ASSERT(diagonal_lcm != 0);
209 if (dim_kinds[dim] ==
LINE) {
226 source[source_index].expr.get(dim));
234 PPL_ASSERT(source_index == 0);
251 const Coefficient& source_dim = source[source_index].expr.get(dim);
276 if (dim_kinds[dim] !=
LINE) {
282 const Coefficient& source_dim = source[tmp_source_index].expr.get(dim);
294 PPL_ASSERT(row < dest_num_rows);
304 Coefficient_traits::const_reference modulus
305 = dest.
rows[dest_num_rows - 1].inhomogeneous_term();
321 reduce_reduced<Congruence_System>
329 PPL_ASSERT(dest[i].
OK());
333 PPL_ASSERT(dest.
OK());
361 lcm_assign(diagonal_lcm, diagonal_lcm, source[source_num_rows].expr.get(dim));
371 PPL_ASSERT(diagonal_lcm != 0);
374 PPL_ASSERT(dims > 0);
392 g.expr.set_space_dimension(dims);
401 g.set_is_parameter_or_point();
405 source[source_index].expr.get(dim));
407 g.expr.set(dim, tmp);
415 PPL_ASSERT(dest.
num_rows() == dest_num_rows);
426 source_index = source_num_rows;
433 Coefficient_traits::const_reference source_dim
434 = source[source_index].expr.get(dim);
465 for (
dimension_type dim_fol = dim + 1; dim_fol < dims; ++dim_fol) {
468 Coefficient_traits::const_reference source_dim
469 = source[tmp_source_index].expr.get(dim);
481 PPL_ASSERT(i < dest_num_rows);
502 reduce_reduced<Grid_Generator_System>
510 = dest.
sys.rows[0].expr.inhomogeneous_term();
513 switch (dim_kinds[dim]) {
515 dest.
sys.rows[i].set_divisor(system_divisor);
529 PPL_ASSERT(dest.
sys.rows[i].OK());
533 PPL_ASSERT(dest.
sys.OK());
bool is_parameter_or_point() const
Returns true if and only if *this row represents a parameter or a point.
Representation representation() const
Returns the current representation of *this.
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
size_t dimension_type
An unsigned integral type for representing space dimensions.
void set(dimension_type i, Coefficient_traits::const_reference n)
Sets the i-th coefficient to n.
Linear_System< Grid_Generator > sys
bool is_line() const
Returns true if and only if *this is a line.
Coefficient_traits::const_reference get(dimension_type i) const
Returns the i-th coefficient.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
static void conversion(Congruence_System &source, Grid_Generator_System &dest, Dimension_Kinds &dim_kinds)
Converts generator system dest to be equivalent to congruence system source.
bool set_space_dimension(dimension_type new_space_dim)
Sets the number of space dimensions to new_space_dim.
void clear()
Removes all the generators from the generator system and sets its space dimension to 0...
expr_type expression() const
Partial read access to the (adapted) internal expression.
void lcm_assign(GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
void insert_verbatim(Congruence &cg, Recycle_Input)
Inserts in *this the congruence cg, stealing its contents and increasing the number of space dimensio...
void exact_div_assign(Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z)
void set_space_dimension(dimension_type space_dim)
Resizes the system to the specified space dimension.
bool is_proper_congruence() const
Returns true if the modulus is greater than zero.
Swapping_Vector< Congruence > rows
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars[i] is .
void set_modulus(Coefficient_traits::const_reference m)
bool is_equality() const
Returns true if *this is an equality.
std::vector< Dimension_Kind > Dimension_Kinds
dimension_type first_pending_row() const
Returns the index of the first pending row.
bool OK() const
Checks if all the invariants are satisfied.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
Topology topology() const
Returns the system topology.
void insert_verbatim(const Grid_Generator &g)
Coefficient_traits::const_reference get(dimension_type i) const
Returns the i -th coefficient.
void set_topology(Topology x)
Sets to x the topological kind of *this row.
Coefficient_traits::const_reference Coefficient_zero()
Returns a const reference to a Coefficient with value 0.
The entire library is confined to this namespace.
dimension_type num_rows() const
Returns the number of rows in the system.
dimension_type num_rows() const
Returns the number of rows (generators) in the system.
static bool upper_triangular(const Grid_Generator_System &sys, const Dimension_Kinds &dim_kinds)
If sys is upper triangular return true, else return false.
Dimension_Kinds dim_kinds
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void gcd_assign(GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
void sub_mul_assign(GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
static bool lower_triangular(const Congruence_System &sys, const Dimension_Kinds &dim_kinds)
If sys is lower triangular return true, else return false.
void exact_div_assign(Coefficient_traits::const_reference c, dimension_type start, dimension_type end)
static void multiply_grid(const Coefficient &multiplier, Congruence &cg, Swapping_Vector< Congruence > &dest, dimension_type num_rows)
Multiply the elements of dest by multiplier.
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
void scale(Coefficient_traits::const_reference factor)
Multiplies all the coefficients, including the modulus, by factor .
bool le(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
A grid line, parameter or grid point.
A system of grid generators.
void clear()
Removes all the congruences and sets the space dimension to 0.