Parma_Polyhedra_Library::Constraint_System Class Reference
C++ Language Interface

A system of constraints. More...

`#include <ppl.hh>`

## Public Member Functions

| Constraint_System (Representation r=default_representation)
| Default constructor: builds an empty system of constraints.
| Constraint_System (const Constraint &c, Representation r=default_representation)
| Builds the singleton system containing only constraint `c`.
| Constraint_System (const Congruence_System &cgs, Representation r=default_representation)
| Builds a system containing copies of any equalities in `cgs`.
| Constraint_System (const Constraint_System &cs)
| Ordinary copy constructor. More...
| Constraint_System (const Constraint_System &cs, Representation r)
| Copy constructor with specified representation.
| ~Constraint_System ()
| Destructor.
Constraint_System & | operator= (const Constraint_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`.
void | set_space_dimension (dimension_type space_dim)
| Sets the space dimension of the rows in the system to `space_dim` .
bool | has_equalities () const
| Returns `true` if and only if `*this` contains one or more equality constraints.
bool | has_strict_inequalities () const
| Returns `true` if and only if `*this` contains one or more strict inequality constraints.
void | insert (const Constraint &c)
| Inserts in `*this` a copy of the constraint `c`, increasing the number of space dimensions if needed.
bool | empty () const
| Returns `true` if and only if `*this` has no constraints.
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, 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::cerr` an ASCII representation of `*this`.
void | ascii_dump (std::ostream &s) const
| Writes to `s` an ASCII representation of `*this`.
void | print () const
| Prints `*this` to `std::cerr` using `operator<<`.
bool | ascii_load (std::istream &s)
| Loads from `s` an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets `*this` accordingly. Returns `true` if successful, `false` otherwise.
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`.
void | m_swap (Constraint_System &y)
| Swaps `*this` with `y`.

## Static Public Member Functions

static dimension_type | max_space_dimension ()
| Returns the maximum space dimension a Constraint_System can handle.
static void | initialize ()
| Initializes the class.
static void | finalize ()
| Finalizes the class.
static const Constraint_System & | zero_dim_empty ()
| Returns the singleton system containing only Constraint::zero_dim_false().

## Related Functions

(Note that these are not member functions.)
std::ostream & | operator<< (std::ostream &s, const Constraint_System &cs)
| Output operator. More...
void | swap (Constraint_System &x, Constraint_System &y)
void | swap (Constraint_System &x, Constraint_System &y)

## Detailed Description

A system of constraints.

An object of the class Constraint_System is a system of constraints, i.e., a multiset of objects of the class Constraint. When inserting constraints in a system, space dimensions are automatically adjusted so that all the constraints in the system are defined on the same vector space.

  In all the examples it is assumed that variables `x` and `y` are defined as follows:
  Variable x(0);
  Variable y(1);

Example 1
  The following code builds a system of constraints corresponding to a square in :
  Constraint_System cs;
  cs.insert(x >= 0);
  cs.insert(x <= 3);
  cs.insert(y >= 0);
  cs.insert(y <= 3);
  Note that: the constraint system is created with space dimension zero; the first and third constraint insertions increase the space dimension to and , respectively.

Example 2
  By adding four strict inequalities to the constraint system of the previous example, we can remove just the four vertices from the square defined above.
  cs.insert(x + y > 0);
  cs.insert(x + y < 6);
  cs.insert(x - y < 3);
  cs.insert(y - x < 3);

Example 3
  The following code builds a system of constraints corresponding to a half-strip in :
  Constraint_System cs;
  cs.insert(x >= 0);
  cs.insert(x - y <= 0);
  cs.insert(x - y + 1 >= 0);

Note
  After inserting a multiset of constraints in a constraint system, there are no guarantees that an exact copy of them can be retrieved: in general, only an equivalent constraint system will be available, where original constraints may have been reordered, removed (if they are trivial, duplicate or implied by other constraints), linearly combined, etc.

## Constructor & Destructor Documentation

Parma_Polyhedra_Library::Constraint_System::Constraint_System | ( | const Constraint_System & | cs) |  |

inline

Ordinary copy constructor.

Note
  The copy will have the same representation as `cs', to make it indistinguishable from `cs'.

## Friends And Related Function Documentation

std::ostream & operator<< | ( | std::ostream & | s,
|  | const Constraint_System & | cs
| ) |  |

related

Output operator.

Writes `true` if `cs` is empty. Otherwise, writes on `s` the constraints of `cs`, all in one row and separated by ", ".

void swap | ( | Constraint_System & | x,
|  | Constraint_System & | y
| ) |  |

related

void swap | ( | Constraint_System & | x,
|  | Constraint_System & | y
| ) |  |

related

The documentation for this class was generated from the following file:

- ppl.hh