PPL  1.2
Parma_Polyhedra_Library::Generator_System Class Reference

A system of generators. More...

#include <Generator_System_defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Generator_System:

Public Types

typedef Generator row_type
 
typedef Generator_System_const_iterator const_iterator
 

Public Member Functions

 Generator_System (Representation r=default_representation)
 Default constructor: builds an empty system of generators. More...
 
 Generator_System (const Generator &g, Representation r=default_representation)
 Builds the singleton system containing only generator g. More...
 
 Generator_System (const Generator_System &gs)
 
 Generator_System (const Generator_System &gs, Representation r)
 Copy constructor with specified representation. More...
 
 ~Generator_System ()
 Destructor. More...
 
Generator_Systemoperator= (const Generator_System &y)
 Assignment operator. More...
 
Representation representation () const
 Returns the current representation of *this. More...
 
void set_representation (Representation r)
 Converts *this to the specified representation. More...
 
dimension_type space_dimension () const
 Returns the dimension of the vector space enclosing *this. More...
 
void set_space_dimension (dimension_type space_dim)
 Sets the space dimension of the rows in the system to space_dim . More...
 
void clear ()
 Removes all the generators from the generator system and sets its space dimension to 0. More...
 
void insert (const Generator &g)
 Inserts in *this a copy of the generator g, increasing the number of space dimensions if needed. More...
 
void insert (Generator &g, Recycle_Input)
 Inserts in *this the generator g, stealing its contents and increasing the number of space dimensions if needed. More...
 
bool empty () const
 Returns true if and only if *this has no generators. More...
 
const_iterator begin () const
 Returns the const_iterator pointing to the first generator, if *this is not empty; otherwise, returns the past-the-end const_iterator. More...
 
const_iterator end () const
 Returns the past-the-end const_iterator. More...
 
bool OK () const
 Checks if all the invariants are satisfied. More...
 
void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this. More...
 
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this. More...
 
void print () const
 Prints *this to std::cerr using operator<<. More...
 
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. More...
 
memory_size_type total_memory_in_bytes () const
 Returns the total size in bytes of the memory occupied by *this. More...
 
memory_size_type external_memory_in_bytes () const
 Returns the size in bytes of the memory managed by *this. More...
 
void m_swap (Generator_System &y)
 Swaps *this with y. More...
 

Static Public Member Functions

static dimension_type max_space_dimension ()
 Returns the maximum space dimension a Generator_System can handle. More...
 
static void initialize ()
 Initializes the class. More...
 
static void finalize ()
 Finalizes the class. More...
 
static const Generator_Systemzero_dim_univ ()
 Returns the singleton system containing only Generator::zero_dim_point(). More...
 

Static Public Attributes

static const Representation default_representation = SPARSE
 

Private Member Functions

bool has_no_rows () const
 
void remove_space_dimensions (const Variables_Set &vars)
 Removes all the specified dimensions from the generator system. More...
 
void shift_space_dimensions (Variable v, dimension_type n)
 
void permute_space_dimensions (const std::vector< Variable > &cycle)
 Permutes the space dimensions of the matrix. More...
 
void swap_space_dimensions (Variable v1, Variable v2)
 Swaps the coefficients of the variables v1 and v2 . More...
 
dimension_type num_rows () const
 
void add_universe_rows_and_space_dimensions (dimension_type n)
 Adds n rows and space dimensions to the system. More...
 
Topology topology () const
 
dimension_type first_pending_row () const
 Returns the index of the first pending row. More...
 
void unset_pending_rows ()
 Sets the index to indicate that the system has no pending rows. More...
 
void set_sorted (bool b)
 Sets the sortedness flag of the system to b. More...
 
bool is_sorted () const
 Returns the value of the sortedness flag. More...
 
void set_index_first_pending_row (dimension_type i)
 Sets the index of the first pending row to i. More...
 
bool is_necessarily_closed () const
 Returns true if and only if the system topology is NECESSARILY_CLOSED. More...
 
void assign_with_pending (const Generator_System &y)
 Full assignment operator: pending rows are copied as pending. More...
 
dimension_type num_pending_rows () const
 Returns the number of rows that are in the pending part of the system. More...
 
void sort_pending_and_remove_duplicates ()
 Sorts the pending rows and eliminates those that also occur in the non-pending part of the system. More...
 
void sort_and_remove_with_sat (Bit_Matrix &sat)
 Sorts the system, removing duplicates, keeping the saturation matrix consistent. More...
 
void sort_rows ()
 Sorts the non-pending rows (in growing order) and eliminates duplicated ones. More...
 
bool check_sorted () const
 Returns true if and only if *this is sorted, without checking for duplicates. More...
 
dimension_type num_lines_or_equalities () const
 Returns the number of rows in the system that represent either lines or equalities. More...
 
void remove_row (dimension_type i, bool keep_sorted=false)
 Makes the system shrink by removing its i-th row. More...
 
void remove_rows (dimension_type first, dimension_type last, bool keep_sorted=false)
 Makes the system shrink by removing the rows in [first,last). More...
 
void remove_rows (const std::vector< dimension_type > &indexes)
 
void remove_trailing_rows (dimension_type n)
 Makes the system shrink by removing its n trailing rows. More...
 
dimension_type gauss (dimension_type n_lines_or_equalities)
 Minimizes the subsystem of equations contained in *this. More...
 
void back_substitute (dimension_type n_lines_or_equalities)
 Back-substitutes the coefficients to reduce the complexity of the system. More...
 
void strong_normalize ()
 Strongly normalizes the system. More...
 
void merge_rows_assign (const Generator_System &y)
 Assigns to *this the result of merging its rows with those of y, obtaining a sorted system. More...
 
void insert (const Generator_System &y)
 Adds to *this a copy of the rows of y. More...
 
void insert_pending (const Generator_System &r)
 Adds a copy of the rows of `y' to the pending part of `*this'. More...
 
 Generator_System (Topology topol, Representation r=default_representation)
 Builds an empty system of generators having the specified topology. More...
 
 Generator_System (Topology topol, dimension_type space_dim, Representation r=default_representation)
 Builds a system of rays/points on a space_dim dimensional space. If topol is NOT_NECESSARILY_CLOSED the $\epsilon$ dimension is added. More...
 
bool adjust_topology_and_space_dimension (Topology new_topology, dimension_type new_space_dim)
 Adjusts *this so that it matches the new_topology and new_space_dim (adding or removing columns if needed). Returns false if and only if topol is equal to NECESSARILY_CLOSED and *this contains closure points. More...
 
void add_corresponding_points ()
 For each unmatched closure point in *this, adds the corresponding point. More...
 
bool has_points () const
 Returns true if and only if *this contains one or more points. More...
 
void add_corresponding_closure_points ()
 For each unmatched point in *this, adds the corresponding closure point. More...
 
bool has_closure_points () const
 Returns true if and only if *this contains one or more closure points. More...
 
void convert_into_non_necessarily_closed ()
 
const Generatoroperator[] (dimension_type k) const
 Returns a constant reference to the k- th generator of the system. More...
 
Parma_Polyhedra_Library::Poly_Con_Relation relation_with (const Constraint &c) const
 Returns the relations holding between the generator system and the constraint c. More...
 
bool satisfied_by_all_generators (const Constraint &c) const
 Returns true if all the generators satisfy c. More...
 
bool satisfied_by_all_generators_C (const Constraint &c) const
 Returns true if all the generators satisfy c. More...
 
bool satisfied_by_all_generators_NNC (const Constraint &c) const
 Returns true if all the generators satisfy c. More...
 
void affine_image (Variable v, const Linear_Expression &expr, Coefficient_traits::const_reference denominator)
 Assigns to a given variable an affine expression. More...
 
dimension_type num_lines () const
 Returns the number of lines of the system. More...
 
dimension_type num_rays () const
 Returns the number of rays of the system. More...
 
void remove_invalid_lines_and_rays ()
 Removes all the invalid lines and rays. More...
 
void simplify ()
 Applies Gaussian elimination and back-substitution so as to provide a partial simplification of the system of generators. More...
 
void insert_pending (const Generator &g)
 Inserts in *this a copy of the generator g, increasing the number of space dimensions if needed. It is a pending generator. More...
 
void insert_pending (Generator &g, Recycle_Input)
 Inserts in *this the generator g, stealing its contents and increasing the number of space dimensions if needed. It is a pending generator. More...
 

Private Attributes

Linear_System< Generatorsys
 

Static Private Attributes

static const Generator_Systemzero_dim_univ_p = 0
 Holds (between class initialization and finalization) a pointer to the singleton system containing only Generator::zero_dim_point(). More...
 

Friends

class Generator_System_const_iterator
 
class Polyhedron
 
bool operator== (const Generator_System &x, const Generator_System &y)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &s, const Generator_System &gs)
 
std::ostream & operator<< (std::ostream &s, const Generator_System &gs)
 Output operator. More...
 
bool operator== (const Generator_System &x, const Generator_System &y)
 Returns true if and only if x and y are identical. More...
 
bool operator!= (const Generator_System &x, const Generator_System &y)
 Returns true if and only if x and y are different. More...
 
void swap (Generator_System &x, Generator_System &y)
 
void swap (Generator_System &x, Generator_System &y)
 

Detailed Description

A system of generators.

An object of the class Generator_System is a system of generators, i.e., a multiset of objects of the class Generator (lines, rays, points and closure points). When inserting generators in a system, space dimensions are automatically adjusted so that all the generators in the system are defined on the same vector space. A system of generators which is meant to define a non-empty polyhedron must include at least one point: the reason is that lines, rays and closure points need a supporting point (lines and rays only specify directions while closure points only specify points in the topological closure of the NNC polyhedron).

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 defines the line having the same direction as the $x$ axis (i.e., the first Cartesian axis) in $\Rset^2$:
gs.insert(line(x + 0*y));
As said above, this system of generators corresponds to an empty polyhedron, because the line has no supporting point. To define a system of generators that does correspond to the $x$ axis, we can add the following code which inserts the origin of the space as a point:
gs.insert(point(0*x + 0*y));
Since space dimensions are automatically adjusted, the following code obtains the same effect:
gs.insert(point(0*x));
In contrast, if we had added the following code, we would have defined a line parallel to the $x$ axis through the point $(0, 1)^\transpose \in \Rset^2$.
gs.insert(point(0*x + 1*y));
Example 2
The following code builds a ray having the same direction as the positive part of the $x$ axis in $\Rset^2$:
gs.insert(ray(x + 0*y));
To define a system of generators indeed corresponding to the set

\[ \bigl\{\, (x, 0)^\transpose \in \Rset^2 \bigm| x \geq 0 \,\bigr\}, \]

one just has to add the origin:
gs.insert(point(0*x + 0*y));
Example 3
The following code builds a system of generators having four points and corresponding to a square in $\Rset^2$ (the same as Example 1 for the system of constraints):
gs.insert(point(0*x + 0*y));
gs.insert(point(0*x + 3*y));
gs.insert(point(3*x + 0*y));
gs.insert(point(3*x + 3*y));
Example 4
By using closure points, we can define the kernel (i.e., the largest open set included in a given set) of the square defined in the previous example. Note that a supporting point is needed and, for that purpose, any inner point could be considered.
gs.insert(point(x + y));
gs.insert(closure_point(0*x + 0*y));
gs.insert(closure_point(0*x + 3*y));
gs.insert(closure_point(3*x + 0*y));
gs.insert(closure_point(3*x + 3*y));
Example 5
The following code builds a system of generators having two points and a ray, corresponding to a half-strip in $\Rset^2$ (the same as Example 2 for the system of constraints):
gs.insert(point(0*x + 0*y));
gs.insert(point(0*x + 1*y));
gs.insert(ray(x - y));
Note
After inserting a multiset of generators in a generator system, there are no guarantees that an exact copy of them can be retrieved: in general, only an equivalent generator system will be available, where original generators may have been reordered, removed (if they are duplicate or redundant), etc.

Definition at line 188 of file Generator_System_defs.hh.

Member Typedef Documentation

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Generator_System::Generator_System ( Representation  r = default_representation)
inline

Default constructor: builds an empty system of generators.

Definition at line 32 of file Generator_System_inlines.hh.

Parma_Polyhedra_Library::Generator_System::Generator_System ( const Generator g,
Representation  r = default_representation 
)
inlineexplicit

Builds the singleton system containing only generator g.

Definition at line 37 of file Generator_System_inlines.hh.

References sys.

38  : sys(g.topology(), r) {
39  sys.insert(g);
40 }
Parma_Polyhedra_Library::Generator_System::Generator_System ( const Generator_System gs)
inline

Ordinary copy constructor. The new Generator_System will have the same representation as `gs'.

Definition at line 43 of file Generator_System_inlines.hh.

44  : sys(gs.sys) {
45 }
Parma_Polyhedra_Library::Generator_System::Generator_System ( const Generator_System gs,
Representation  r 
)
inline

Copy constructor with specified representation.

Definition at line 48 of file Generator_System_inlines.hh.

50  : sys(gs.sys, r) {
51 }
Parma_Polyhedra_Library::Generator_System::~Generator_System ( )
inline

Destructor.

Definition at line 66 of file Generator_System_inlines.hh.

66  {
67 }
Parma_Polyhedra_Library::Generator_System::Generator_System ( Topology  topol,
Representation  r = default_representation 
)
inlineexplicitprivate

Builds an empty system of generators having the specified topology.

Definition at line 54 of file Generator_System_inlines.hh.

55  : sys(topol, r) {
56 }
Parma_Polyhedra_Library::Generator_System::Generator_System ( Topology  topol,
dimension_type  space_dim,
Representation  r = default_representation 
)
inlineprivate

Builds a system of rays/points on a space_dim dimensional space. If topol is NOT_NECESSARILY_CLOSED the $\epsilon$ dimension is added.

Definition at line 59 of file Generator_System_inlines.hh.

62  : sys(topol, space_dim, r) {
63 }

Member Function Documentation

void Parma_Polyhedra_Library::Generator_System::add_corresponding_closure_points ( )
private

For each unmatched point in *this, adds the corresponding closure point.

It is assumed that the topology of *this is NOT_NECESSARILY_CLOSED.

Definition at line 85 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::epsilon_coefficient(), Parma_Polyhedra_Library::Generator::expr, Parma_Polyhedra_Library::Linear_Expression::normalize(), Parma_Polyhedra_Library::Generator::set_epsilon_coefficient(), and sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), Parma_Polyhedra_Library::Polyhedron::Polyhedron(), and Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl().

85  {
86  PPL_ASSERT(!sys.is_necessarily_closed());
87  // NOTE: we always add (pending) rows at the end of the generator system.
88  // Updating `index_first_pending', if needed, is done by the caller.
89  Generator_System& gs = *this;
90  const dimension_type n_rows = gs.sys.num_rows();
91  for (dimension_type i = n_rows; i-- > 0; ) {
92  const Generator& g = gs[i];
93  if (g.epsilon_coefficient() > 0) {
94  // `g' is a point: adding the closure point.
95  Generator cp = g;
96  cp.set_epsilon_coefficient(0);
97  // Enforcing normalization.
98  cp.expr.normalize();
99  gs.insert_pending(cp, Recycle_Input());
100  }
101  }
102  PPL_ASSERT(OK());
103 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Generator_System::add_corresponding_points ( )
private

For each unmatched closure point in *this, adds the corresponding point.

It is assumed that the topology of *this is NOT_NECESSARILY_CLOSED.

Definition at line 111 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::epsilon_coefficient(), Parma_Polyhedra_Library::Generator::expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), Parma_Polyhedra_Library::Generator::is_line_or_ray(), Parma_Polyhedra_Library::Generator::set_epsilon_coefficient(), and sys.

111  {
112  PPL_ASSERT(!sys.is_necessarily_closed());
113  // NOTE: we always add (pending) rows at the end of the generator system.
114  // Updating `index_first_pending', if needed, is done by the caller.
115  Generator_System& gs = *this;
116  const dimension_type n_rows = gs.sys.num_rows();
117  for (dimension_type i = 0; i < n_rows; ++i) {
118  const Generator& g = gs[i];
119  if (!g.is_line_or_ray() && g.epsilon_coefficient() == 0) {
120  // `g' is a closure point: adding the point.
121  // Note: normalization is preserved.
122  Generator p = g;
123  p.set_epsilon_coefficient(p.expr.inhomogeneous_term());
124  gs.insert_pending(p, Recycle_Input());
125  }
126  }
127  PPL_ASSERT(OK());
128 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Generator_System::add_universe_rows_and_space_dimensions ( dimension_type  n)
inlineprivate

Adds n rows and space dimensions to the system.

Parameters
nThe number of rows and space dimensions to be added: must be strictly positive.

Turns the system $M \in \Rset^r \times \Rset^c$ into the system $N \in \Rset^{r+n} \times \Rset^{c+n}$ such that $N = \bigl(\genfrac{}{}{0pt}{}{0}{M}\genfrac{}{}{0pt}{}{J}{o}\bigr)$, where $J$ is the specular image of the $n \times n$ identity matrix.

Definition at line 155 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_space_dimensions_and_embed().

155  {
156  sys.add_universe_rows_and_space_dimensions(n);
157 }
bool Parma_Polyhedra_Library::Generator_System::adjust_topology_and_space_dimension ( Topology  new_topology,
dimension_type  new_space_dim 
)
private

Adjusts *this so that it matches the new_topology and new_space_dim (adding or removing columns if needed). Returns false if and only if topol is equal to NECESSARILY_CLOSED and *this contains closure points.

Definition at line 40 of file Generator_System.cc.

References convert_into_non_necessarily_closed(), has_closure_points(), Parma_Polyhedra_Library::NECESSARILY_CLOSED, OK(), space_dimension(), and sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), Parma_Polyhedra_Library::Polyhedron::generators(), and Parma_Polyhedra_Library::Polyhedron::Polyhedron().

41  {
42  PPL_ASSERT(space_dimension() <= new_space_dim);
43 
44  if (sys.topology() != new_topology) {
45  if (new_topology == NECESSARILY_CLOSED) {
46  // A NOT_NECESSARILY_CLOSED generator system
47  // can be converted to a NECESSARILY_CLOSED one
48  // only if it does not contain closure points.
49  // This check has to be performed under the user viewpoint.
50  if (has_closure_points()) {
51  return false;
52  }
53  // For a correct implementation, we have to remove those
54  // closure points that were matching a point (i.e., those
55  // that are in the generator system, but are invisible to
56  // the user).
57  const Generator_System& gs = *this;
58  for (dimension_type i = 0; i < sys.num_rows(); ) {
59  if (gs[i].is_closure_point()) {
60  sys.remove_row(i, false);
61  }
62  else {
63  ++i;
64  }
65  }
66  sys.set_necessarily_closed();
67  }
68  else {
70  }
71  }
72 
73  sys.set_space_dimension(new_space_dim);
74 
75  // We successfully adjusted dimensions and topology.
76  PPL_ASSERT(OK());
77  return true;
78 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
bool has_closure_points() const
Returns true if and only if *this contains one or more closure points.
void Parma_Polyhedra_Library::Generator_System::affine_image ( Variable  v,
const Linear_Expression expr,
Coefficient_traits::const_reference  denominator 
)
private

Assigns to a given variable an affine expression.

Parameters
vThe variable to which the affine transformation is assigned;
exprThe numerator of the affine transformation: $\sum_{i = 0}^{n - 1} a_i x_i + b$;
denominatorThe denominator of the affine transformation.

We want to allow affine transformations (see the Introduction) having any rational coefficients. Since the coefficients of the constraints are integers we must also provide an integer denominator that will be used as denominator of the affine transformation. The denominator is required to be a positive integer.

The affine transformation assigns to each element of the column containing the coefficients of v the follow expression:

\[ \frac{\sum_{i = 0}^{n - 1} a_i x_i + b} {\mathrm{denominator}}. \]

expr is a constant parameter and unaltered by this computation.

Definition at line 745 of file Generator_System.cc.

References Parma_Polyhedra_Library::Scalar_Products::assign(), Parma_Polyhedra_Library::Linear_Expression::coefficient(), Parma_Polyhedra_Library::Generator::expr, num_rows(), PPL_DIRTY_TEMP_COEFFICIENT, remove_invalid_lines_and_rays(), Parma_Polyhedra_Library::Linear_Expression::set_coefficient(), Parma_Polyhedra_Library::Variable::space_dimension(), space_dimension(), Parma_Polyhedra_Library::Linear_Expression::space_dimension(), and sys.

747  {
748  Generator_System& x = *this;
749  PPL_ASSERT(v.space_dimension() <= x.space_dimension());
750  PPL_ASSERT(expr.space_dimension() <= x.space_dimension());
751  PPL_ASSERT(denominator > 0);
752 
753  const dimension_type n_rows = x.sys.num_rows();
754 
755  // Compute the numerator of the affine transformation and assign it
756  // to the column of `*this' indexed by `v'.
757  PPL_DIRTY_TEMP_COEFFICIENT(numerator);
758  for (dimension_type i = n_rows; i-- > 0; ) {
759  Generator& row = sys.rows[i];
760  Scalar_Products::assign(numerator, expr, row.expr);
761  if (denominator != 1) {
762  // Since we want integer elements in the matrix,
763  // we multiply by `denominator' all the columns of `*this'
764  // having an index different from `v'.
765  // Note that this operation also modifies the coefficient of v, but
766  // it will be overwritten by the set_coefficient() below.
767  row.expr *= denominator;
768  }
769  row.expr.set_coefficient(v, numerator);
770  }
771 
772  set_sorted(false);
773 
774  // If the mapping is not invertible we may have transformed
775  // valid lines and rays into the origin of the space.
776  const bool not_invertible = (v.space_dimension() > expr.space_dimension()
777  || expr.coefficient(v) == 0);
778  if (not_invertible) {
779  x.remove_invalid_lines_and_rays();
780  }
781 
782  // TODO: Consider normalizing individual rows in the loop above.
783  // Strong normalization also resets the sortedness flag.
784  x.sys.strong_normalize();
785 
786 #ifndef NDEBUG
787  // Make sure that the (remaining) generators are still OK after fiddling
788  // with their internal data.
789  for (dimension_type i = x.num_rows(); i-- > 0; ) {
790  PPL_ASSERT(x.sys[i].OK());
791  }
792 #endif
793 
794  PPL_ASSERT(sys.OK());
795 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
void set_sorted(bool b)
Sets the sortedness flag of the system to b.
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.
void Parma_Polyhedra_Library::Generator_System::ascii_dump ( std::ostream &  s) const

Writes to s an ASCII representation of *this.

Definition at line 798 of file Generator_System.cc.

798  {
799  sys.ascii_dump(s);
800 }
void Parma_Polyhedra_Library::Generator_System::ascii_dump ( ) const

Writes to std::cerr an ASCII representation of *this.

Referenced by Parma_Polyhedra_Library::Polyhedron::OK().

bool Parma_Polyhedra_Library::Generator_System::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.

Resizes the matrix of generators using the numbers of rows and columns read from s, then initializes the coordinates of each generator and its type reading the contents from s.

Definition at line 805 of file Generator_System.cc.

805  {
806  if (!sys.ascii_load(s)) {
807  return false;
808  }
809 
810  PPL_ASSERT(OK());
811  return true;
812 }
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Generator_System::assign_with_pending ( const Generator_System y)
inlineprivate

Full assignment operator: pending rows are copied as pending.

Definition at line 195 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::Polyhedron().

195  {
196  sys.assign_with_pending(y.sys);
197 }
void Parma_Polyhedra_Library::Generator_System::back_substitute ( dimension_type  n_lines_or_equalities)
inlineprivate

Back-substitutes the coefficients to reduce the complexity of the system.

Takes an upper triangular system having n_lines_or_equalities rows. For each row, starting from the one having the minimum number of coefficients different from zero, computes the expression of an element as a function of the remaining ones and then substitutes this expression in all the other rows.

Definition at line 256 of file Generator_System_inlines.hh.

References sys.

256  {
257  sys.back_substitute(n_lines_or_equalities);
258 }
Generator_System::const_iterator Parma_Polyhedra_Library::Generator_System::begin ( ) const
inline

Returns the const_iterator pointing to the first generator, if *this is not empty; otherwise, returns the past-the-end const_iterator.

Definition at line 366 of file Generator_System_inlines.hh.

References Parma_Polyhedra_Library::Generator_System_const_iterator::skip_forward(), and sys.

Referenced by Parma_Polyhedra_Library::Affine_Space::Affine_Space(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR_original(), Parma_Polyhedra_Library::BD_Shape< T >::BD_Shape(), Parma_Polyhedra_Library::BHRZ03_Certificate::BHRZ03_Certificate(), Parma_Polyhedra_Library::Box< ITV >::Box(), Parma_Polyhedra_Library::BHRZ03_Certificate::compare(), Parma_Polyhedra_Library::Polyhedron::map_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::Octagonal_Shape(), operator<<(), and Parma_Polyhedra_Library::Polyhedron::simplify_using_context_assign().

366  {
367  const_iterator i(sys.begin(), *this);
368  if (!sys.is_necessarily_closed()) {
369  i.skip_forward();
370  }
371  return i;
372 }
void skip_forward()
*this skips to the next generator, skipping those closure points that are immediately followed by a m...
Generator_System_const_iterator const_iterator
bool Parma_Polyhedra_Library::Generator_System::check_sorted ( ) const
inlineprivate

Returns true if and only if *this is sorted, without checking for duplicates.

Definition at line 220 of file Generator_System_inlines.hh.

References sys.

220  {
221  return sys.check_sorted();
222 }
void Parma_Polyhedra_Library::Generator_System::clear ( )
inline

Removes all the generators from the generator system and sets its space dimension to 0.

Definition at line 116 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators().

116  {
117  sys.clear();
118 }
void Parma_Polyhedra_Library::Generator_System::convert_into_non_necessarily_closed ( )
private

Converts this generator system into a non-necessarily closed generator system.

Definition at line 146 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), Parma_Polyhedra_Library::Generator::is_line_or_ray(), and Parma_Polyhedra_Library::Generator::set_epsilon_coefficient().

Referenced by adjust_topology_and_space_dimension(), and Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl().

146  {
147  // Padding the matrix with the column
148  // corresponding to the epsilon coefficients:
149  // all points must have epsilon coordinate equal to 1
150  // (i.e., the epsilon coefficient is equal to the divisor);
151  // rays and lines must have epsilon coefficient equal to 0.
152  // Note: normalization is preserved.
153  sys.set_not_necessarily_closed();
154 
155  for (dimension_type i = sys.rows.size(); i-- > 0; ) {
156  Generator& gen = sys.rows[i];
157  if (!gen.is_line_or_ray()) {
158  gen.set_epsilon_coefficient(gen.expr.inhomogeneous_term());
159  }
160  }
161 
162  PPL_ASSERT(sys.OK());
163 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool Parma_Polyhedra_Library::Generator_System::empty ( ) const
inline

Returns true if and only if *this has no generators.

Definition at line 356 of file Generator_System_inlines.hh.

References sys.

356  {
357  return sys.has_no_rows();
358 }
memory_size_type Parma_Polyhedra_Library::Generator_System::external_memory_in_bytes ( ) const
inline

Returns the size in bytes of the memory managed by *this.

Definition at line 392 of file Generator_System_inlines.hh.

References sys.

Referenced by total_memory_in_bytes().

392  {
393  return sys.external_memory_in_bytes();
394 }
void Parma_Polyhedra_Library::Generator_System::finalize ( )
static

Finalizes the class.

Definition at line 845 of file Generator_System.cc.

Referenced by Parma_Polyhedra_Library::Init::~Init().

845  {
846  PPL_ASSERT(zero_dim_univ_p != 0);
847  delete zero_dim_univ_p;
848  zero_dim_univ_p = 0;
849 }
static const Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
dimension_type Parma_Polyhedra_Library::Generator_System::first_pending_row ( ) const
inlineprivate

Returns the index of the first pending row.

Definition at line 165 of file Generator_System_inlines.hh.

References sys.

165  {
166  return sys.first_pending_row();
167 }
dimension_type Parma_Polyhedra_Library::Generator_System::gauss ( dimension_type  n_lines_or_equalities)
inlineprivate

Minimizes the subsystem of equations contained in *this.

This method works only on the equalities of the system: the system is required to be partially sorted, so that all the equalities are grouped at its top; it is assumed that the number of equalities is exactly n_lines_or_equalities. The method finds a minimal system for the equalities and returns its rank, i.e., the number of linearly independent equalities. The result is an upper triangular subsystem of equalities: for each equality, the pivot is chosen starting from the right-most columns.

Definition at line 251 of file Generator_System_inlines.hh.

References sys.

251  {
252  return sys.gauss(n_lines_or_equalities);
253 }
bool Parma_Polyhedra_Library::Generator_System::has_closure_points ( ) const
private

Returns true if and only if *this contains one or more closure points.

Note: the check for the presence of closure points is done under the point of view of the user. Namely, we scan the generator system using high-level iterators, so that closure points that are matching the corresponding points will be disregarded.

Definition at line 131 of file Generator_System.cc.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), and adjust_topology_and_space_dimension().

131  {
132  if (sys.is_necessarily_closed()) {
133  return false;
134  }
135  // Adopt the point of view of the user.
137  this_end = end(); i != this_end; ++i) {
138  if (i->is_closure_point()) {
139  return true;
140  }
141  }
142  return false;
143 }
Generator_System_const_iterator const_iterator
const_iterator end() const
Returns the past-the-end const_iterator.
const_iterator begin() const
Returns the const_iterator pointing to the first generator, if *this is not empty; otherwise...
bool Parma_Polyhedra_Library::Generator_System::has_no_rows ( ) const
inlineprivate
bool Parma_Polyhedra_Library::Generator_System::has_points ( ) const
private

Returns true if and only if *this contains one or more points.

Definition at line 166 of file Generator_System.cc.

Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), and Parma_Polyhedra_Library::Polyhedron::Polyhedron().

166  {
167  const Generator_System& gs = *this;
168  // Avoiding the repeated tests on topology.
169  if (sys.is_necessarily_closed()) {
170  for (dimension_type i = sys.num_rows(); i-- > 0; ) {
171  if (!gs[i].is_line_or_ray()) {
172  return true;
173  }
174  }
175  }
176  else {
177  // !is_necessarily_closed()
178  for (dimension_type i = sys.num_rows(); i-- > 0; ) {
179  if (gs[i].epsilon_coefficient() != 0) {
180  return true;
181  }
182  }
183  }
184  return false;
185 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
void Parma_Polyhedra_Library::Generator_System::initialize ( )
static

Initializes the class.

Definition at line 838 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::zero_dim_point().

Referenced by Parma_Polyhedra_Library::Init::Init().

838  {
839  PPL_ASSERT(zero_dim_univ_p == 0);
842 }
static const Generator & zero_dim_point()
Returns the origin of the zero-dimensional space .
static const Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
void Parma_Polyhedra_Library::Generator_System::insert ( const Generator g)
void Parma_Polyhedra_Library::Generator_System::insert ( Generator g,
Recycle_Input   
)

Inserts in *this the generator g, stealing its contents and increasing the number of space dimensions if needed.

Definition at line 218 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), Parma_Polyhedra_Library::Generator::is_line_or_ray(), Parma_Polyhedra_Library::Generator::set_epsilon_coefficient(), Parma_Polyhedra_Library::Generator::set_not_necessarily_closed(), Parma_Polyhedra_Library::Generator::set_space_dimension(), Parma_Polyhedra_Library::Generator::space_dimension(), and Parma_Polyhedra_Library::Generator::topology().

218  {
219  // We are sure that the matrix has no pending rows
220  // and that the new row is not a pending generator.
221  PPL_ASSERT(sys.num_pending_rows() == 0);
222  if (sys.topology() == g.topology()) {
223  sys.insert(g, Recycle_Input());
224  }
225  else {
226  // `*this' and `g' have different topologies.
227  if (sys.is_necessarily_closed()) {
229  // Inserting the new generator.
230  sys.insert(g, Recycle_Input());
231  }
232  else {
233  // The generator system is NOT necessarily closed:
234  // copy the generator, adding the missing dimensions
235  // and the epsilon coefficient.
236  const dimension_type new_space_dim = std::max(g.space_dimension(),
237  space_dimension());
238  g.set_not_necessarily_closed();
239  g.set_space_dimension(new_space_dim);
240  // If it was a point, set the epsilon coordinate to 1
241  // (i.e., set the coefficient equal to the divisor).
242  // Note: normalization is preserved.
243  if (!g.is_line_or_ray()) {
244  g.set_epsilon_coefficient(g.expr.inhomogeneous_term());
245  }
246  // Inserting the new generator.
247  sys.insert(g, Recycle_Input());
248  }
249  }
250  PPL_ASSERT(OK());
251 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Generator_System::insert ( const Generator_System y)
inlineprivate

Adds to *this a copy of the rows of y.

It is assumed that *this has no pending rows.

Definition at line 271 of file Generator_System_inlines.hh.

References sys.

271  {
272  sys.insert(y.sys);
273 }
void Parma_Polyhedra_Library::Generator_System::insert_pending ( const Generator_System r)
inlineprivate

Adds a copy of the rows of `y' to the pending part of `*this'.

Definition at line 276 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::poly_hull_assign(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().

276  {
277  sys.insert_pending(r.sys);
278 }
void Parma_Polyhedra_Library::Generator_System::insert_pending ( const Generator g)
private

Inserts in *this a copy of the generator g, increasing the number of space dimensions if needed. It is a pending generator.

Definition at line 212 of file Generator_System.cc.

212  {
213  Generator tmp = g;
214  insert_pending(tmp, Recycle_Input());
215 }
void insert_pending(const Generator_System &r)
Adds a copy of the rows of `y' to the pending part of `*this'.
void Parma_Polyhedra_Library::Generator_System::insert_pending ( Generator g,
Recycle_Input   
)
private

Inserts in *this the generator g, stealing its contents and increasing the number of space dimensions if needed. It is a pending generator.

Definition at line 254 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::expr, Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term(), Parma_Polyhedra_Library::Generator::is_line_or_ray(), Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, Parma_Polyhedra_Library::Generator::set_epsilon_coefficient(), Parma_Polyhedra_Library::Generator::set_space_dimension(), Parma_Polyhedra_Library::Generator::set_topology(), Parma_Polyhedra_Library::Generator::space_dimension(), and Parma_Polyhedra_Library::Generator::topology().

254  {
255  if (sys.topology() == g.topology()) {
256  sys.insert_pending(g, Recycle_Input());
257  }
258  else {
259  // `*this' and `g' have different topologies.
260  if (sys.is_necessarily_closed()) {
262 
263  // Inserting the new generator.
264  sys.insert_pending(g, Recycle_Input());
265  }
266  else {
267  // The generator system is NOT necessarily closed:
268  // copy the generator, adding the missing dimensions
269  // and the epsilon coefficient.
270  const dimension_type new_space_dim = std::max(g.space_dimension(),
271  space_dimension());
272  g.set_topology(NOT_NECESSARILY_CLOSED);
273  g.set_space_dimension(new_space_dim);
274  // If it was a point, set the epsilon coordinate to 1
275  // (i.e., set the coefficient equal to the divisor).
276  // Note: normalization is preserved.
277  if (!g.is_line_or_ray()) {
278  g.set_epsilon_coefficient(g.expr.inhomogeneous_term());
279  }
280  // Inserting the new generator.
281  sys.insert_pending(g, Recycle_Input());
282  }
283  }
284  PPL_ASSERT(OK());
285 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
bool Parma_Polyhedra_Library::Generator_System::is_necessarily_closed ( ) const
inlineprivate

Returns true if and only if the system topology is NECESSARILY_CLOSED.

Definition at line 190 of file Generator_System_inlines.hh.

References sys.

190  {
191  return sys.is_necessarily_closed();
192 }
void Parma_Polyhedra_Library::Generator_System::m_swap ( Generator_System y)
inline

Swaps *this with y.

Definition at line 387 of file Generator_System_inlines.hh.

References swap(), and sys.

Referenced by swap().

387  {
388  swap(sys, y.sys);
389 }
void swap(Generator_System &x, Generator_System &y)
dimension_type Parma_Polyhedra_Library::Generator_System::max_space_dimension ( )
inlinestatic

Returns the maximum space dimension a Generator_System can handle.

Definition at line 87 of file Generator_System_inlines.hh.

References Parma_Polyhedra_Library::Linear_System< Row >::max_space_dimension().

Referenced by Parma_Polyhedra_Library::Polyhedron::max_space_dimension().

87  {
89 }
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_System can handle.
void Parma_Polyhedra_Library::Generator_System::merge_rows_assign ( const Generator_System y)
inlineprivate

Assigns to *this the result of merging its rows with those of y, obtaining a sorted system.

Duplicated rows will occur only once in the result. On entry, both systems are assumed to be sorted and have no pending rows.

Definition at line 266 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::poly_hull_assign(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().

266  {
267  sys.merge_rows_assign(y.sys);
268 }
PPL::dimension_type Parma_Polyhedra_Library::Generator_System::num_lines ( ) const
private

Returns the number of lines of the system.

Definition at line 288 of file Generator_System.cc.

References num_rows().

Referenced by Parma_Polyhedra_Library::Polyhedron::OK(), Parma_Polyhedra_Library::Polyhedron::quick_equivalence_test(), and Parma_Polyhedra_Library::Polyhedron::strongly_minimize_generators().

288  {
289  // We are sure that this method is applied only to a matrix
290  // that does not contain pending rows.
291  PPL_ASSERT(sys.num_pending_rows() == 0);
292  const Generator_System& gs = *this;
293  dimension_type n = 0;
294  // If sys happens to be sorted, take advantage of the fact
295  // that lines are at the top of the system.
296  if (sys.is_sorted()) {
297  const dimension_type nrows = sys.num_rows();
298  for (dimension_type i = 0; i < nrows && gs[i].is_line(); ++i) {
299  ++n;
300  }
301  }
302  else {
303  for (dimension_type i = sys.num_rows(); i-- > 0 ; ) {
304  if (gs[i].is_line()) {
305  ++n;
306  }
307  }
308  }
309  return n;
310 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
dimension_type Parma_Polyhedra_Library::Generator_System::num_lines_or_equalities ( ) const
inlineprivate

Returns the number of rows in the system that represent either lines or equalities.

Definition at line 225 of file Generator_System_inlines.hh.

References sys.

225  {
226  return sys.num_lines_or_equalities();
227 }
dimension_type Parma_Polyhedra_Library::Generator_System::num_pending_rows ( ) const
inlineprivate

Returns the number of rows that are in the pending part of the system.

Definition at line 200 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::Polyhedron(), and Parma_Polyhedra_Library::Polyhedron::process_pending_generators().

200  {
201  return sys.num_pending_rows();
202 }
PPL::dimension_type Parma_Polyhedra_Library::Generator_System::num_rays ( ) const
private

Returns the number of rays of the system.

Definition at line 313 of file Generator_System.cc.

Referenced by Parma_Polyhedra_Library::Polyhedron::OK().

313  {
314  // We are sure that this method is applied only to a matrix
315  // that does not contain pending rows.
316  PPL_ASSERT(sys.num_pending_rows() == 0);
317  const Generator_System& gs = *this;
318  dimension_type n = 0;
319  // If sys happens to be sorted, take advantage of the fact
320  // that rays and points are at the bottom of the system and
321  // rays have the inhomogeneous term equal to zero.
322  if (sys.is_sorted()) {
323  for (dimension_type i = sys.num_rows();
324  i != 0 && gs[--i].is_ray_or_point(); ) {
325  if (gs[i].is_line_or_ray()) {
326  ++n;
327  }
328  }
329  }
330  else {
331  for (dimension_type i = sys.num_rows(); i-- > 0 ; ) {
332  if (gs[i].is_ray()) {
333  ++n;
334  }
335  }
336  }
337  return n;
338 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
bool Parma_Polyhedra_Library::Generator_System::OK ( ) const

Checks if all the invariants are satisfied.

Definition at line 852 of file Generator_System.cc.

Referenced by adjust_topology_and_space_dimension(), and set_space_dimension().

852  {
853  return sys.OK();
854 }
Generator_System & Parma_Polyhedra_Library::Generator_System::operator= ( const Generator_System y)
inline

Assignment operator.

Definition at line 70 of file Generator_System_inlines.hh.

References swap().

70  {
71  Generator_System tmp = y;
72  swap(*this, tmp);
73  return *this;
74 }
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
void swap(Generator_System &x, Generator_System &y)
const Generator & Parma_Polyhedra_Library::Generator_System::operator[] ( dimension_type  k) const
inlineprivate

Returns a constant reference to the k- th generator of the system.

Definition at line 121 of file Generator_System_inlines.hh.

References sys.

121  {
122  return sys[k];
123 }
void Parma_Polyhedra_Library::Generator_System::permute_space_dimensions ( const std::vector< Variable > &  cycle)
inlineprivate

Permutes the space dimensions of the matrix.

Definition at line 139 of file Generator_System_inlines.hh.

Referenced by Parma_Polyhedra_Library::Polyhedron::map_space_dimensions().

139  {
140  sys.permute_space_dimensions(cycle);
141 }
void Parma_Polyhedra_Library::Generator_System::print ( ) const

Prints *this to std::cerr using operator<<.

PPL::Poly_Con_Relation Parma_Polyhedra_Library::Generator_System::relation_with ( const Constraint c) const
private

Returns the relations holding between the generator system and the constraint c.

Definition at line 341 of file Generator_System.cc.

References Parma_Polyhedra_Library::Generator::CLOSURE_POINT, Parma_Polyhedra_Library::Constraint::EQUALITY, Parma_Polyhedra_Library::Poly_Con_Relation::implies(), Parma_Polyhedra_Library::Poly_Con_Relation::is_disjoint(), Parma_Polyhedra_Library::Poly_Con_Relation::is_included(), Parma_Polyhedra_Library::Generator::is_point(), Parma_Polyhedra_Library::Generator::LINE, Parma_Polyhedra_Library::Constraint::NONSTRICT_INEQUALITY, Parma_Polyhedra_Library::Generator::POINT, Parma_Polyhedra_Library::Generator::RAY, Parma_Polyhedra_Library::Scalar_Products::reduced_sign(), Parma_Polyhedra_Library::Poly_Con_Relation::saturates(), Parma_Polyhedra_Library::Scalar_Products::sign(), Parma_Polyhedra_Library::Constraint::space_dimension(), Parma_Polyhedra_Library::Constraint::STRICT_INEQUALITY, Parma_Polyhedra_Library::Poly_Con_Relation::strictly_intersects(), Parma_Polyhedra_Library::Constraint::type(), and Parma_Polyhedra_Library::Generator::type().

341  {
342  // Note: this method is not public and it is the responsibility
343  // of the caller to actually test for dimension compatibility.
344  // We simply assert it.
345  PPL_ASSERT(space_dimension() >= c.space_dimension());
346  // Number of generators: the case of an empty polyhedron
347  // has already been filtered out by the caller.
348  const dimension_type n_rows = sys.num_rows();
349  PPL_ASSERT(n_rows > 0);
350  const Generator_System& gs = *this;
351 
352  // `result' will keep the relation holding between the generators
353  // we have seen so far and the constraint `c'.
354  Poly_Con_Relation result = Poly_Con_Relation::saturates();
355 
356  switch (c.type()) {
357 
359  {
360  // The hyperplane defined by the equality `c' is included
361  // in the set of points satisfying `c' (it is the same set!).
362  result = result && Poly_Con_Relation::is_included();
363  // The following integer variable will hold the scalar product sign
364  // of either the first point or the first non-saturating ray we find.
365  // If it is equal to 2, then it means that we haven't found such
366  // a generator yet.
367  int first_point_or_nonsaturating_ray_sign = 2;
368 
369  for (dimension_type i = n_rows; i-- > 0; ) {
370  const Generator& g = gs[i];
371  const int sp_sign = Scalar_Products::sign(c, g);
372  // Checking whether the generator saturates the equality.
373  // If that is the case, then we have to do something only if
374  // the generator is a point.
375  if (sp_sign == 0) {
376  if (g.is_point()) {
377  if (first_point_or_nonsaturating_ray_sign == 2) {
378  // It is the first time that we find a point and
379  // we have not found a non-saturating ray yet.
380  first_point_or_nonsaturating_ray_sign = 0;
381  }
382  else {
383  // We already found a point or a non-saturating ray.
384  if (first_point_or_nonsaturating_ray_sign != 0) {
386  }
387  }
388  }
389  }
390  else {
391  // Here we know that sp_sign != 0.
392  switch (g.type()) {
393 
394  case Generator::LINE:
395  // If a line does not saturate `c', then there is a strict
396  // intersection between the points satisfying `c'
397  // and the points generated by `gs'.
399 
400  case Generator::RAY:
401  if (first_point_or_nonsaturating_ray_sign == 2) {
402  // It is the first time that we have a non-saturating ray
403  // and we have not found any point yet.
404  first_point_or_nonsaturating_ray_sign = sp_sign;
406  }
407  else
408  // We already found a point or a non-saturating ray.
409  if (sp_sign != first_point_or_nonsaturating_ray_sign) {
411  }
412  break;
413 
414  case Generator::POINT:
416  // NOTE: a non-saturating closure point is treated as
417  // a normal point.
418  if (first_point_or_nonsaturating_ray_sign == 2) {
419  // It is the first time that we find a point and
420  // we have not found a non-saturating ray yet.
421  first_point_or_nonsaturating_ray_sign = sp_sign;
423  }
424  else
425  // We already found a point or a non-saturating ray.
426  if (sp_sign != first_point_or_nonsaturating_ray_sign) {
428  }
429  break;
430  }
431  }
432  }
433  }
434  break;
435 
437  {
438  // The hyperplane implicitly defined by the non-strict inequality `c'
439  // is included in the set of points satisfying `c'.
440  result = result && Poly_Con_Relation::is_included();
441  // The following Boolean variable will be set to `false'
442  // as soon as either we find (any) point or we find a
443  // non-saturating ray.
444  bool first_point_or_nonsaturating_ray = true;
445 
446  for (dimension_type i = n_rows; i-- > 0; ) {
447  const Generator& g = gs[i];
448  const int sp_sign = Scalar_Products::sign(c, g);
449  // Checking whether the generator saturates the non-strict
450  // inequality. If that is the case, then we have to do something
451  // only if the generator is a point.
452  if (sp_sign == 0) {
453  if (g.is_point()) {
454  if (first_point_or_nonsaturating_ray) {
455  // It is the first time that we have a point and
456  // we have not found a non-saturating ray yet.
457  first_point_or_nonsaturating_ray = false;
458  }
459  else {
460  // We already found a point or a non-saturating ray before.
461  if (result == Poly_Con_Relation::is_disjoint()) {
462  // Since g saturates c, we have a strict intersection if
463  // none of the generators seen so far are included in `c'.
465  }
466  }
467  }
468  }
469  else {
470  // Here we know that sp_sign != 0.
471  switch (g.type()) {
472 
473  case Generator::LINE:
474  // If a line does not saturate `c', then there is a strict
475  // intersection between the points satisfying `c' and
476  // the points generated by `gs'.
478 
479  case Generator::RAY:
480  if (first_point_or_nonsaturating_ray) {
481  // It is the first time that we have a non-saturating ray
482  // and we have not found any point yet.
483  first_point_or_nonsaturating_ray = false;
484  result = (sp_sign > 0)
487  }
488  else {
489  // We already found a point or a non-saturating ray.
490  if ((sp_sign > 0
491  && result == Poly_Con_Relation::is_disjoint())
492  || (sp_sign < 0
493  && result.implies(Poly_Con_Relation::is_included()))) {
494  // We have a strict intersection if either:
495  // - `g' satisfies `c' but none of the generators seen
496  // so far are included in `c'; or
497  // - `g' does not satisfy `c' and all the generators
498  // seen so far are included in `c'.
500  }
501  if (sp_sign > 0) {
502  // Here all the generators seen so far either saturate
503  // or are included in `c'.
504  // Since `g' does not saturate `c' ...
506  }
507  }
508  break;
509 
510  case Generator::POINT:
512  // NOTE: a non-saturating closure point is treated as
513  // a normal point.
514  if (first_point_or_nonsaturating_ray) {
515  // It is the first time that we have a point and
516  // we have not found a non-saturating ray yet.
517  // - If point `g' saturates `c', then all the generators
518  // seen so far saturate `c'.
519  // - If point `g' is included (but does not saturate) `c',
520  // then all the generators seen so far are included in `c'.
521  // - If point `g' does not satisfy `c', then all the
522  // generators seen so far are disjoint from `c'.
523  first_point_or_nonsaturating_ray = false;
524  if (sp_sign > 0) {
526  }
527  else if (sp_sign < 0) {
529  }
530  }
531  else {
532  // We already found a point or a non-saturating ray before.
533  if ((sp_sign > 0
534  && result == Poly_Con_Relation::is_disjoint())
535  || (sp_sign < 0
536  && result.implies(Poly_Con_Relation::is_included()))) {
537  // We have a strict intersection if either:
538  // - `g' satisfies or saturates `c' but none of the
539  // generators seen so far are included in `c'; or
540  // - `g' does not satisfy `c' and all the generators
541  // seen so far are included in `c'.
543  }
544  if (sp_sign > 0) {
545  // Here all the generators seen so far either saturate
546  // or are included in `c'.
547  // Since `g' does not saturate `c' ...
549  }
550  }
551  break;
552  }
553  }
554  }
555  }
556  break;
557 
559  {
560  // The hyperplane implicitly defined by the strict inequality `c'
561  // is disjoint from the set of points satisfying `c'.
562  result = result && Poly_Con_Relation::is_disjoint();
563  // The following Boolean variable will be set to `false'
564  // as soon as either we find (any) point or we find a
565  // non-saturating ray.
566  bool first_point_or_nonsaturating_ray = true;
567  for (dimension_type i = n_rows; i-- > 0; ) {
568  const Generator& g = gs[i];
569  // Using the reduced scalar product operator to avoid
570  // both topology and space dimension mismatches.
571  const int sp_sign = Scalar_Products::reduced_sign(c, g);
572  // Checking whether the generator saturates the strict inequality.
573  // If that is the case, then we have to do something
574  // only if the generator is a point.
575  if (sp_sign == 0) {
576  if (g.is_point()) {
577  if (first_point_or_nonsaturating_ray) {
578  // It is the first time that we have a point and
579  // we have not found a non-saturating ray yet.
580  first_point_or_nonsaturating_ray = false;
581  }
582  else {
583  // We already found a point or a non-saturating ray before.
584  if (result == Poly_Con_Relation::is_included()) {
586  }
587  }
588  }
589  }
590  else {
591  // Here we know that sp_sign != 0.
592  switch (g.type()) {
593 
594  case Generator::LINE:
595  // If a line does not saturate `c', then there is a strict
596  // intersection between the points satisfying `c' and the points
597  // generated by `gs'.
599 
600  case Generator::RAY:
601  if (first_point_or_nonsaturating_ray) {
602  // It is the first time that we have a non-saturating ray
603  // and we have not found any point yet.
604  first_point_or_nonsaturating_ray = false;
605  result = (sp_sign > 0)
608  }
609  else {
610  // We already found a point or a non-saturating ray before.
611  if ((sp_sign > 0
612  && result.implies(Poly_Con_Relation::is_disjoint()))
613  ||
614  (sp_sign <= 0
615  && result == Poly_Con_Relation::is_included())) {
617  }
618  if (sp_sign < 0) {
619  // Here all the generators seen so far either saturate
620  // or are disjoint from `c'.
621  // Since `g' does not saturate `c' ...
623  }
624  }
625  break;
626 
627  case Generator::POINT:
629  if (first_point_or_nonsaturating_ray) {
630  // It is the first time that we have a point and
631  // we have not found a non-saturating ray yet.
632  // - If point `g' saturates `c', then all the generators
633  // seen so far saturate `c'.
634  // - If point `g' is included in (but does not saturate) `c',
635  // then all the generators seen so far are included in `c'.
636  // - If point `g' strictly violates `c', then all the
637  // generators seen so far are disjoint from `c'.
638  first_point_or_nonsaturating_ray = false;
639  if (sp_sign > 0) {
641  }
642  else if (sp_sign < 0) {
644  }
645  }
646  else {
647  // We already found a point or a non-saturating ray before.
648  if ((sp_sign > 0
649  && result.implies(Poly_Con_Relation::is_disjoint()))
650  ||
651  (sp_sign <= 0
652  && result == Poly_Con_Relation::is_included())) {
654  }
655  if (sp_sign < 0) {
656  // Here all the generators seen so far either saturate
657  // or are disjoint from `c'.
658  // Since `g' does not saturate `c' ...
660  }
661  }
662  break;
663  }
664  }
665  }
666  }
667  break;
668  }
669  // We have seen all generators.
670  return result;
671 }
static Poly_Con_Relation is_disjoint()
The polyhedron and the set of points satisfying the constraint are disjoint.
size_t dimension_type
An unsigned integral type for representing space dimensions.
static Poly_Con_Relation is_included()
The polyhedron is included in the set of points satisfying the constraint.
static Poly_Con_Relation saturates()
The polyhedron is included in the set of points saturating the constraint.
static int reduced_sign(const Linear_Expression &x, const Linear_Expression &y)
Returns the sign of the reduced scalar product of x and y, where the coefficient of x is ignored...
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static int sign(const Linear_Expression &x, const Linear_Expression &y)
Returns the sign of the scalar product between x and y.
Coefficient c
Definition: PIP_Tree.cc:64
static Poly_Con_Relation strictly_intersects()
The polyhedron intersects the set of points satisfying the constraint, but it is not included in it...
void Parma_Polyhedra_Library::Generator_System::remove_invalid_lines_and_rays ( )
private

Removes all the invalid lines and rays.

The invalid lines and rays are those with all the homogeneous terms set to zero.

Definition at line 815 of file Generator_System.cc.

References Parma_Polyhedra_Library::Linear_Expression::all_homogeneous_terms_are_zero(), Parma_Polyhedra_Library::Generator::expr, and Parma_Polyhedra_Library::Generator::is_line_or_ray().

Referenced by affine_image(), set_space_dimension(), and simplify().

815  {
816  // The origin of the vector space cannot be a valid line/ray.
817  // NOTE: the following swaps will mix generators without even trying
818  // to preserve sortedness: as a matter of fact, it will almost always
819  // be the case that the input generator system is NOT sorted.
820 
821  // Note that num_rows() is *not* constant, because it is decreased by
822  // remove_row().
823  for (dimension_type i = 0; i < num_rows(); ) {
824  const Generator& g = (*this)[i];
825  if (g.is_line_or_ray() && g.expr.all_homogeneous_terms_are_zero()) {
826  sys.remove_row(i, false);
827  set_sorted(false);
828  }
829  else {
830  ++i;
831  }
832  }
833 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
void set_sorted(bool b)
Sets the sortedness flag of the system to b.
void Parma_Polyhedra_Library::Generator_System::remove_row ( dimension_type  i,
bool  keep_sorted = false 
)
inlineprivate

Makes the system shrink by removing its i-th row.

When keep_sorted is true and the system is sorted, sortedness will be preserved, but this method costs O(n).

Otherwise, this method just swaps the i-th row with the last and then removes it, so it costs O(1).

Definition at line 230 of file Generator_System_inlines.hh.

References sys.

230  {
231  sys.remove_row(i, keep_sorted);
232 }
void Parma_Polyhedra_Library::Generator_System::remove_rows ( dimension_type  first,
dimension_type  last,
bool  keep_sorted = false 
)
inlineprivate

Makes the system shrink by removing the rows in [first,last).

When keep_sorted is true and the system is sorted, sortedness will be preserved, but this method costs O(num_rows()).

Otherwise, this method just swaps the rows with the last ones and then removes them, so it costs O(last - first).

Definition at line 235 of file Generator_System_inlines.hh.

References sys.

236  {
237  sys.remove_rows(first, last, keep_sorted);
238 }
void Parma_Polyhedra_Library::Generator_System::remove_rows ( const std::vector< dimension_type > &  indexes)
inlineprivate

Removes the specified rows. The row ordering of remaining rows is preserved.

Parameters
indexesspecifies a list of row indexes. It must be sorted.

Definition at line 241 of file Generator_System_inlines.hh.

References sys.

241  {
242  sys.remove_rows(indexes);
243 }
void Parma_Polyhedra_Library::Generator_System::remove_space_dimensions ( const Variables_Set vars)
inlineprivate

Removes all the specified dimensions from the generator system.

The space dimension of the variable with the highest space dimension in vars must be at most the space dimension of this.

Definition at line 127 of file Generator_System_inlines.hh.

127  {
128  sys.remove_space_dimensions(vars);
129 }
void Parma_Polyhedra_Library::Generator_System::remove_trailing_rows ( dimension_type  n)
inlineprivate

Makes the system shrink by removing its n trailing rows.

Definition at line 246 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::OK().

246  {
247  sys.remove_trailing_rows(n);
248 }
Representation Parma_Polyhedra_Library::Generator_System::representation ( ) const
inline

Returns the current representation of *this.

Definition at line 77 of file Generator_System_inlines.hh.

References sys.

77  {
78  return sys.representation();
79 }
bool Parma_Polyhedra_Library::Generator_System::satisfied_by_all_generators ( const Constraint c) const
private

Returns true if all the generators satisfy c.

Definition at line 675 of file Generator_System.cc.

References Parma_Polyhedra_Library::Constraint::EQUALITY, Parma_Polyhedra_Library::Generator::is_line(), Parma_Polyhedra_Library::Generator::LINE, Parma_Polyhedra_Library::Constraint::NONSTRICT_INEQUALITY, Parma_Polyhedra_Library::Generator::POINT, Parma_Polyhedra_Library::Constraint::space_dimension(), Parma_Polyhedra_Library::Constraint::STRICT_INEQUALITY, sys, Parma_Polyhedra_Library::Constraint::type(), and Parma_Polyhedra_Library::Generator::type().

Referenced by Parma_Polyhedra_Library::Polyhedron::limited_BHRZ03_extrapolation_assign(), Parma_Polyhedra_Library::Polyhedron::limited_H79_extrapolation_assign(), and Parma_Polyhedra_Library::Polyhedron::simplify_using_context_assign().

675  {
676  PPL_ASSERT(c.space_dimension() <= space_dimension());
677 
678  // Setting `sps' to the appropriate scalar product sign operator.
679  // This also avoids problems when having _legal_ topology mismatches
680  // (which could also cause a mismatch in the number of space dimensions).
681  const Topology_Adjusted_Scalar_Product_Sign sps(c);
682 
683  const Generator_System& gs = *this;
684  switch (c.type()) {
686  // Equalities must be saturated by all generators.
687  for (dimension_type i = gs.sys.num_rows(); i-- > 0; ) {
688  if (sps(c, gs[i]) != 0) {
689  return false;
690  }
691  }
692  break;
694  // Non-strict inequalities must be saturated by lines and
695  // satisfied by all the other generators.
696  for (dimension_type i = gs.sys.num_rows(); i-- > 0; ) {
697  const Generator& g = gs[i];
698  const int sp_sign = sps(c, g);
699  if (g.is_line()) {
700  if (sp_sign != 0) {
701  return false;
702  }
703  }
704  else
705  // `g' is a ray, point or closure point.
706  if (sp_sign < 0) {
707  return false;
708  }
709  }
710  break;
712  // Strict inequalities must be saturated by lines,
713  // satisfied by all generators, and must not be saturated by points.
714  for (dimension_type i = gs.sys.num_rows(); i-- > 0; ) {
715  const Generator& g = gs[i];
716  const int sp_sign = sps(c, g);
717  switch (g.type()) {
718  case Generator::POINT:
719  if (sp_sign <= 0) {
720  return false;
721  }
722  break;
723  case Generator::LINE:
724  if (sp_sign != 0) {
725  return false;
726  }
727  break;
728  default:
729  // `g' is a ray or closure point.
730  if (sp_sign < 0) {
731  return false;
732  }
733  break;
734  }
735  }
736  break;
737  }
738  // If we reach this point, `c' is satisfied by all generators.
739  return true;
740 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Coefficient c
Definition: PIP_Tree.cc:64
bool Parma_Polyhedra_Library::Generator_System::satisfied_by_all_generators_C ( const Constraint c) const
private

Returns true if all the generators satisfy c.

It is assumed that c.is_necessarily_closed() holds.

bool Parma_Polyhedra_Library::Generator_System::satisfied_by_all_generators_NNC ( const Constraint c) const
private

Returns true if all the generators satisfy c.

It is assumed that c.is_necessarily_closed() does not hold.

void Parma_Polyhedra_Library::Generator_System::set_index_first_pending_row ( dimension_type  i)
inlineprivate

Sets the index of the first pending row to i.

Definition at line 185 of file Generator_System_inlines.hh.

References sys.

185  {
186  sys.set_index_first_pending_row(i);
187 }
void Parma_Polyhedra_Library::Generator_System::set_representation ( Representation  r)
inline

Converts *this to the specified representation.

Definition at line 82 of file Generator_System_inlines.hh.

References sys.

82  {
83  sys.set_representation(r);
84 }
void Parma_Polyhedra_Library::Generator_System::set_sorted ( bool  b)
inlineprivate
void Parma_Polyhedra_Library::Generator_System::set_space_dimension ( dimension_type  space_dim)
inline

Sets the space dimension of the rows in the system to space_dim .

Definition at line 97 of file Generator_System_inlines.hh.

References OK(), remove_invalid_lines_and_rays(), space_dimension(), and sys.

97  {
98  const dimension_type old_space_dim = space_dimension();
99  sys.set_space_dimension_no_ok(space_dim);
100 
101  if (space_dim < old_space_dim) {
102  // We may have invalid lines and rays now.
104  }
105 
106 #ifndef NDEBUG
107  for (dimension_type i = 0; i < sys.num_rows(); ++i) {
108  PPL_ASSERT(sys[i].OK());
109  }
110 #endif
111  PPL_ASSERT(sys.OK());
112  PPL_ASSERT(OK());
113 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
void remove_invalid_lines_and_rays()
Removes all the invalid lines and rays.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool OK() const
Checks if all the invariants are satisfied.
void Parma_Polyhedra_Library::Generator_System::shift_space_dimensions ( Variable  v,
dimension_type  n 
)
inlineprivate

Shift by n positions the coefficients of variables, starting from the coefficient of v. This increases the space dimension by n.

Definition at line 133 of file Generator_System_inlines.hh.

133  {
134  sys.shift_space_dimensions(v, n);
135 }
void Parma_Polyhedra_Library::Generator_System::simplify ( )
inlineprivate

Applies Gaussian elimination and back-substitution so as to provide a partial simplification of the system of generators.

It is assumed that the system has no pending generators.

Definition at line 402 of file Generator_System_inlines.hh.

References remove_invalid_lines_and_rays(), and sys.

402  {
403  sys.simplify();
405 }
void remove_invalid_lines_and_rays()
Removes all the invalid lines and rays.
void Parma_Polyhedra_Library::Generator_System::sort_and_remove_with_sat ( Bit_Matrix sat)
inlineprivate

Sorts the system, removing duplicates, keeping the saturation matrix consistent.

Parameters
satBit matrix with rows corresponding to the rows of *this.

Definition at line 210 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators(), and Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators_with_sat_g().

210  {
211  sys.sort_and_remove_with_sat(sat);
212 }
void Parma_Polyhedra_Library::Generator_System::sort_pending_and_remove_duplicates ( )
inlineprivate

Sorts the pending rows and eliminates those that also occur in the non-pending part of the system.

Definition at line 205 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::process_pending_generators().

205  {
206  return sys.sort_pending_and_remove_duplicates();
207 }
void Parma_Polyhedra_Library::Generator_System::sort_rows ( )
inlineprivate

Sorts the non-pending rows (in growing order) and eliminates duplicated ones.

Definition at line 215 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators(), Parma_Polyhedra_Library::Polyhedron::OK(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().

215  {
216  sys.sort_rows();
217 }
dimension_type Parma_Polyhedra_Library::Generator_System::space_dimension ( ) const
inline
void Parma_Polyhedra_Library::Generator_System::strong_normalize ( )
inlineprivate

Strongly normalizes the system.

Definition at line 261 of file Generator_System_inlines.hh.

References sys.

Referenced by Parma_Polyhedra_Library::Polyhedron::OK().

261  {
262  sys.strong_normalize();
263 }
void Parma_Polyhedra_Library::Generator_System::swap_space_dimensions ( Variable  v1,
Variable  v2 
)
inlineprivate

Swaps the coefficients of the variables v1 and v2 .

Definition at line 145 of file Generator_System_inlines.hh.

145  {
146  sys.swap_space_dimensions(v1, v2);
147 }
Topology Parma_Polyhedra_Library::Generator_System::topology ( ) const
inlineprivate

Definition at line 160 of file Generator_System_inlines.hh.

References sys.

160  {
161  return sys.topology();
162 }
memory_size_type Parma_Polyhedra_Library::Generator_System::total_memory_in_bytes ( ) const
inline

Returns the total size in bytes of the memory occupied by *this.

Definition at line 397 of file Generator_System_inlines.hh.

References external_memory_in_bytes().

397  {
398  return external_memory_in_bytes() + sizeof(*this);
399 }
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void Parma_Polyhedra_Library::Generator_System::unset_pending_rows ( )
inlineprivate
const Generator_System & Parma_Polyhedra_Library::Generator_System::zero_dim_univ ( )
inlinestatic

Returns the singleton system containing only Generator::zero_dim_point().

Definition at line 381 of file Generator_System_inlines.hh.

References zero_dim_univ_p.

Referenced by Parma_Polyhedra_Library::Polyhedron::generators().

381  {
382  PPL_ASSERT(zero_dim_univ_p != 0);
383  return *zero_dim_univ_p;
384 }
static const Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...

Friends And Related Function Documentation

friend class Generator_System_const_iterator
friend

Definition at line 496 of file Generator_System_defs.hh.

bool operator!= ( const Generator_System x,
const Generator_System y 
)
related

Returns true if and only if x and y are different.

Definition at line 286 of file Generator_System_inlines.hh.

286  {
287  return !(x == y);
288 }
std::ostream & operator<< ( std::ostream &  s,
const Generator_System gs 
)
related

Output operator.

Writes false if gs is empty. Otherwise, writes on s the generators of gs, all in one row and separated by ", ".

std::ostream & operator<< ( std::ostream &  s,
const Generator_System gs 
)
related

Definition at line 858 of file Generator_System.cc.

References begin(), and end().

858  {
859  Generator_System::const_iterator i = gs.begin();
860  const Generator_System::const_iterator gs_end = gs.end();
861  if (i == gs_end) {
862  return s << "false";
863  }
864  while (true) {
865  s << *i;
866  ++i;
867  if (i == gs_end) {
868  return s;
869  }
870  s << ", ";
871  }
872 }
Generator_System_const_iterator const_iterator
bool operator== ( const Generator_System x,
const Generator_System y 
)
related

Returns true if and only if x and y are identical.

Definition at line 281 of file Generator_System_inlines.hh.

281  {
282  return x.sys == y.sys;
283 }
bool operator== ( const Generator_System x,
const Generator_System y 
)
friend

Definition at line 281 of file Generator_System_inlines.hh.

281  {
282  return x.sys == y.sys;
283 }
friend class Polyhedron
friend

Definition at line 656 of file Generator_System_defs.hh.

void swap ( Generator_System x,
Generator_System y 
)
related

Referenced by m_swap(), and operator=().

void swap ( Generator_System x,
Generator_System y 
)
related

Definition at line 409 of file Generator_System_inlines.hh.

References m_swap().

409  {
410  x.m_swap(y);
411 }

Member Data Documentation

const Representation Parma_Polyhedra_Library::Generator_System::default_representation = SPARSE
static

Definition at line 192 of file Generator_System_defs.hh.

const PPL::Generator_System * Parma_Polyhedra_Library::Generator_System::zero_dim_univ_p = 0
staticprivate

Holds (between class initialization and finalization) a pointer to the singleton system containing only Generator::zero_dim_point().

Definition at line 494 of file Generator_System_defs.hh.

Referenced by zero_dim_univ().


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