24 #ifndef PPL_Constraint_System_defs_hh
25 #define PPL_Constraint_System_defs_hh 1
44 namespace IO_Operators {
52 std::ostream&
operator<<(std::ostream& s,
const Constraint_System& cs);
57 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
60 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
61 bool operator==(
const Constraint_System& x,
const Constraint_System& y);
64 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
67 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
68 bool operator!=(
const Constraint_System& x,
const Constraint_System& y);
72 swap(Constraint_System& x, Constraint_System& y);
230 const_iterator
begin()
const;
233 const_iterator
end()
const;
349 Coefficient_traits::const_reference denominator);
406 void remove_rows(
const std::vector<dimension_type>& indexes);
417 bool keep_sorted =
false);
611 :
public std::iterator<std::forward_iterator_tag,
665 ::const_iterator& iter,
674 namespace Implementation {
676 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
677 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
688 #endif // !defined(PPL_Constraint_System_defs_hh)
void m_swap(Constraint_System &y)
Swaps *this with y.
An iterator over a system of constraints.
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
void shift_space_dimensions(Variable v, dimension_type n)
A linear equality or inequality.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
void swap(CO_Tree &x, CO_Tree &y)
void insert_pending(const Constraint &c)
Inserts in *this a copy of the constraint c, increasing the number of space dimensions if needed...
void set_representation(Representation r)
Converts *this to the specified representation.
The base class for systems of constraints and generators.
bool check_sorted() const
Returns true if and only if *this is sorted, without checking for duplicates.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void set_space_dimension(dimension_type space_dim)
Sets the space dimension of the rows in the system to space_dim .
An std::set of variables' indexes.
bool operator!=(const Constraint_System_const_iterator &y) const
Returns true if and only if *this and y are different.
A line, ray, point or closure point.
void simplify()
Applies Gaussian elimination and back-substitution so as to provide a partial simplification of the s...
bool is_necessarily_closed() const
Returns true if and only if the system topology is NECESSARILY_CLOSED.
void merge_rows_assign(const Constraint_System &y)
Assigns to *this the result of merging its rows with those of y, obtaining a sorted system...
void assign_with_pending(const Constraint_System &y)
Full assignment operator: pending rows are copied as pending.
const Constraint * operator->() const
Indirect member selector.
dimension_type first_pending_row() const
Returns the index of the first pending row.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
static const Constraint_System & zero_dim_empty()
Returns the singleton system containing only Constraint::zero_dim_false().
void insert(const Constraint &c)
Inserts in *this a copy of the constraint c, increasing the number of space dimensions if needed...
dimension_type num_constraints(const Constraint_System &cs)
Helper returning number of constraints in system.
Linear_System< Constraint >::const_iterator i
The const iterator over the matrix of constraints.
void add_universe_rows_and_space_dimensions(dimension_type n)
Adds n rows and space dimensions to the system.
dimension_type num_pending_rows() const
Returns the number of rows that are in the pending part of the system.
bool is_sorted() const
Returns the value of the sortedness flag.
Representation representation() const
Returns the current representation of *this.
Topology topology() const
Returns the system topology.
void clear()
Removes all the constraints from the constraint system and sets its space dimension to 0...
const_iterator begin() const
Returns the const_iterator pointing to the first constraint, if *this is not empty; otherwise...
const Linear_System< Constraint > * csp
A const pointer to the matrix of constraints.
void mark_as_not_necessarily_closed()
Marks the last dimension as the epsilon dimension.
Constraint_System_const_iterator()
Default constructor.
bool operator==(const Constraint_System_const_iterator &y) const
Returns true if and only if *this and y are identical.
A dimension of the vector space.
Constraint_System_const_iterator & operator=(const Constraint_System_const_iterator &y)
Assignment operator.
~Constraint_System_const_iterator()
Destructor.
The base class for convex polyhedra.
void remove_row(dimension_type i, bool keep_sorted=false)
Makes the system shrink by removing its i-th row.
#define PPL_OUTPUT_DECLARATIONS
void skip_forward()
*this skips to the next non-trivial constraint.
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the matrix.
dimension_type num_equalities() const
Returns the number of equality constraints.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
bool empty() const
Returns true if and only if *this has no constraints.
bool OK() const
Checks if all the invariants are satisfied.
const_iterator end() const
Returns the past-the-end const_iterator.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
dimension_type num_lines_or_equalities() const
Returns the number of rows in the system that represent either lines or equalities.
void sort_and_remove_with_sat(Bit_Matrix &sat)
Sorts the system, removing duplicates, keeping the saturation matrix consistent.
static const Constraint_System * zero_dim_empty_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
const Constraint & operator[](dimension_type k) const
Returns a constant reference to the k- th constraint of the system.
Swapping_Vector< Row >::const_iterator const_iterator
bool has_equalities() const
Returns true if and only if *this contains one or more equality constraints.
void sort_rows()
Sorts the non-pending rows (in growing order) and eliminates duplicated ones.
Constraint_System_const_iterator & operator++()
Prefix increment operator.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Constraint_System can handle.
void remove_rows(const std::vector< dimension_type > &indexes)
The entire library is confined to this namespace.
Linear_System< Constraint > sys
void remove_trailing_rows(dimension_type n)
Makes the system shrink by removing its n trailing rows.
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the constraint system.
void strong_normalize()
Strongly normalizes the system.
Constraint_System(Representation r=default_representation)
Default constructor: builds an empty system of constraints.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
void affine_preimage(Variable v, const Linear_Expression &expr, Coefficient_traits::const_reference denominator)
Substitutes a given column of coefficients by a given affine expression.
void add_low_level_constraints()
Adds low-level constraints to the constraint system.
Sparse representation: only the nonzero coefficient are stored. If there are many nonzero coefficient...
static void finalize()
Finalizes the class.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
dimension_type num_inequalities() const
Returns the number of inequality constraints.
const Constraint & operator*() const
Dereference operator.
void set_sorted(bool b)
Sets the sortedness flag of the system to b.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
Constraint_System & operator=(const Constraint_System &y)
Assignment operator.
void sort_pending_and_remove_duplicates()
Sorts the pending rows and eliminates those that also occur in the non-pending part of the system...
friend bool operator==(const Constraint_System &x, const Constraint_System &y)
void back_substitute(dimension_type n_lines_or_equalities)
Back-substitutes the coefficients to reduce the complexity of the system.
static void initialize()
Initializes the class.
static const Representation default_representation
void set_index_first_pending_row(dimension_type i)
Sets the index of the first pending row to i.
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
bool adjust_topology_and_space_dimension(Topology new_topology, dimension_type new_space_dim)
Adjusts *this so that it matches new_topology and new_space_dim (adding or removing columns if needed...
dimension_type num_rows() const
void mark_as_necessarily_closed()
Marks the epsilon dimension as a standard dimension.
dimension_type gauss(dimension_type n_lines_or_equalities)
Minimizes the subsystem of equations contained in *this.
Topology
Kinds of polyhedra domains.
~Constraint_System()
Destructor.
Constraint_System_const_iterator const_iterator
bool satisfies_all_constraints(const Generator &g) const
Returns true if g satisfies all the constraints.
bool has_strict_inequalities() const
Returns true if and only if *this contains one or more strict inequality constraints.