|  | 
|  | Congruence_System (Representation r=default_representation) | 
|  | Default constructor: builds an empty system of congruences. 
 | 
|  | 
|  | Congruence_System (dimension_type d, Representation r=default_representation) | 
|  | Builds an empty (i.e. zero rows) system of dimension d.
 | 
|  | 
|  | Congruence_System (const Congruence &cg, Representation r=default_representation) | 
|  | Builds the singleton system containing only congruence cg.
 | 
|  | 
|  | Congruence_System (const Constraint &c, Representation r=default_representation) | 
|  | If crepresents the constraint , builds the singleton system containing only constraint  .  More... 
 | 
|  | 
|  | Congruence_System (const Constraint_System &cs, Representation r=default_representation) | 
|  | Builds a system containing copies of any equalities in cs.
 | 
|  | 
|  | Congruence_System (const Congruence_System &cgs) | 
|  | Ordinary copy constructor.  More... 
 | 
|  | 
|  | Congruence_System (const Congruence_System &cgs, Representation r) | 
|  | Copy constructor with specified representation. 
 | 
|  | 
|  | ~Congruence_System () | 
|  | Destructor. 
 | 
|  | 
| Congruence_System & | operator= (const Congruence_System &y) | 
|  | Assignment operator. 
 | 
|  | 
| Representation | representation () const | 
|  | Returns the current representation of *this. 
 | 
|  | 
| void | set_representation (Representation r) | 
|  | Converts *this to the specified representation. 
 | 
|  | 
| dimension_type | space_dimension () const | 
|  | Returns the dimension of the vector space enclosing *this.
 | 
|  | 
| bool | is_equal_to (const Congruence_System &y) const | 
|  | Returns trueif and only if*thisis exactly equal toy.
 | 
|  | 
| bool | has_linear_equalities () const | 
|  | Returns trueif and only if*thiscontains one or more linear equalities.
 | 
|  | 
| void | clear () | 
|  | Removes all the congruences and sets the space dimension to 0. 
 | 
|  | 
| void | insert (const Congruence &cg) | 
|  | Inserts in *thisa copy of the congruencecg, increasing the number of space dimensions if needed.  More...
 | 
|  | 
| void | insert (Congruence &cg, Recycle_Input) | 
|  | Inserts in *thisthe congruencecg, stealing its contents and increasing the number of space dimensions if needed.  More...
 | 
|  | 
| void | insert (const Constraint &c) | 
|  | Inserts in *thisa copy of the equality constraintc, seen as a modulo 0 congruence, increasing the number of space dimensions if needed.  More...
 | 
|  | 
| void | insert (const Congruence_System &y) | 
|  | Inserts in *thisa copy of the congruences iny, increasing the number of space dimensions if needed.  More...
 | 
|  | 
| void | insert (Congruence_System &cgs, Recycle_Input) | 
|  | Inserts into *thisthe congruences incgs, increasing the number of space dimensions if needed.
 | 
|  | 
| bool | empty () const | 
|  | Returns trueif and only if*thishas no congruences.
 | 
|  | 
| const_iterator | begin () const | 
|  | Returns the const_iterator pointing to the first congruence, if thisis not empty; otherwise, returns the past-the-end const_iterator.
 | 
|  | 
| const_iterator | end () const | 
|  | Returns the past-the-end const_iterator. 
 | 
|  | 
| bool | OK () const | 
|  | Checks if all the invariants are satisfied. 
 | 
|  | 
| void | ascii_dump () const | 
|  | Writes to std::cerran ASCII representation of*this.
 | 
|  | 
| void | ascii_dump (std::ostream &s) const | 
|  | Writes to san ASCII representation of*this.
 | 
|  | 
| void | print () const | 
|  | Prints *thistostd::cerrusingoperator<<.
 | 
|  | 
| bool | ascii_load (std::istream &s) | 
|  | Loads from san ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets*thisaccordingly. Returnstrueif successful,falseotherwise.
 | 
|  | 
| memory_size_type | total_memory_in_bytes () const | 
|  | Returns the total size in bytes of the memory occupied by *this.
 | 
|  | 
| memory_size_type | external_memory_in_bytes () const | 
|  | Returns the size in bytes of the memory managed by *this.
 | 
|  | 
| dimension_type | num_equalities () const | 
|  | Returns the number of equalities. 
 | 
|  | 
| dimension_type | num_proper_congruences () const | 
|  | Returns the number of proper congruences. 
 | 
|  | 
| void | m_swap (Congruence_System &y) | 
|  | Swaps *thiswithy.
 | 
|  | 
| void | add_unit_rows_and_space_dimensions (dimension_type dims) | 
|  | Adds dimsrows anddimsspace dimensions to the matrix, initializing the added rows as in the unit congruence system.  More...
 | 
|  | 
| void | permute_space_dimensions (const std::vector< Variable > &cycle) | 
|  | Permutes the space dimensions of the system.  More... 
 | 
|  | 
| void | swap_space_dimensions (Variable v1, Variable v2) | 
|  | Swaps the columns having indexes iandj.
 | 
|  | 
| bool | set_space_dimension (dimension_type new_space_dim) | 
|  | Sets the number of space dimensions to new_space_dim.  More...
 | 
|  | 
A system of congruences. 
An object of the class Congruence_System is a system of congruences, i.e., a multiset of objects of the class Congruence. When inserting congruences in a system, space dimensions are automatically adjusted so that all the congruences in the system are defined on the same vector space.
- In all the examples it is assumed that variables xandyare defined as follows:Variable x(0); Variable y(1); 
- Example 1
- The following code builds a system of congruences corresponding to an integer grid in  : :
cgs.insert(x %= 0); cgs.insert(y %= 0); 
 Note that: the congruence system is created with space dimension zero; the first and second congruence insertions increase the space dimension to and and , respectively. , respectively.
- Example 2
- By adding to the congruence system of the previous example, the congruence  : :cgs.insert((x + y %= 1) / 2); 
xandyvalues is odd.
- Example 3
- The following code builds a system of congruences corresponding to the grid in  containing just the integral points on the containing just the integral points on thexaxis:
cgs.insert(x %= 0); cgs.insert((y %= 0) / 0); 
 
- Note
- After inserting a multiset of congruences in a congruence system, there are no guarantees that an exact copy of them can be retrieved: in general, only an equivalent congruence system will be available, where original congruences may have been reordered, removed (if they are trivial, duplicate or implied by other congruences), linearly combined, etc.