PPL
1.2
|
A system of generators. More...
#include <Generator_System_defs.hh>
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_System & | operator= (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_System & | zero_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 ![]() | |
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 Generator & | operator[] (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< Generator > | sys |
Static Private Attributes | |
static const Generator_System * | zero_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) |
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).
x
and y
are defined as follows:
Definition at line 188 of file Generator_System_defs.hh.
Definition at line 258 of file Generator_System_defs.hh.
Definition at line 190 of file Generator_System_defs.hh.
|
inline |
Default constructor: builds an empty system of generators.
Definition at line 32 of file Generator_System_inlines.hh.
|
inlineexplicit |
Builds the singleton system containing only generator g
.
Definition at line 37 of file Generator_System_inlines.hh.
References sys.
|
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.
|
inline |
Copy constructor with specified representation.
Definition at line 48 of file Generator_System_inlines.hh.
|
inline |
|
inlineexplicitprivate |
Builds an empty system of generators having the specified topology.
Definition at line 54 of file Generator_System_inlines.hh.
|
inlineprivate |
Builds a system of rays/points on a space_dim
dimensional space. If topol
is NOT_NECESSARILY_CLOSED
the dimension is added.
Definition at line 59 of file Generator_System_inlines.hh.
|
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().
|
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.
|
inlineprivate |
Adds n
rows and space dimensions to the system.
n | The number of rows and space dimensions to be added: must be strictly positive. |
Turns the system into the system
such that
, where
is the specular image of the
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().
|
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().
|
private |
Assigns to a given variable an affine expression.
v | The variable to which the affine transformation is assigned; |
expr | The numerator of the affine transformation: ![]() |
denominator | The 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:
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.
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.
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.
|
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().
|
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.
|
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().
|
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.
|
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().
|
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().
|
inline |
Returns true
if and only if *this
has no generators.
Definition at line 356 of file Generator_System_inlines.hh.
References sys.
|
inline |
Returns the past-the-end const_iterator.
Definition at line 375 of file Generator_System_inlines.hh.
References 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().
|
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().
|
static |
Finalizes the class.
Definition at line 845 of file Generator_System.cc.
Referenced by Parma_Polyhedra_Library::Init::~Init().
|
inlineprivate |
Returns the index of the first pending row.
Definition at line 165 of file Generator_System_inlines.hh.
References sys.
|
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.
|
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().
|
inlineprivate |
Definition at line 361 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), Parma_Polyhedra_Library::Polyhedron::BHRZ03_evolving_rays(), Parma_Polyhedra_Library::Polyhedron::map_space_dimensions(), and Parma_Polyhedra_Library::Polyhedron::Polyhedron().
|
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().
|
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().
void Parma_Polyhedra_Library::Generator_System::insert | ( | const Generator & | g | ) |
Inserts in *this
a copy of the generator g
, increasing the number of space dimensions if needed.
Definition at line 206 of file Generator_System.cc.
Referenced by Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR(), Parma_Polyhedra_Library::Termination_Helpers::all_affine_ranking_functions_PR_original(), Parma_Polyhedra_Library::Polyhedron::BHRZ03_evolving_rays(), Parma_Polyhedra_Library::Polyhedron::generalized_affine_image(), Parma_Polyhedra_Library::Polyhedron::generalized_affine_preimage(), Parma_Polyhedra_Library::Polyhedron::map_space_dimensions(), Parma_Polyhedra_Library::Polyhedron::poly_hull_assign(), and Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl().
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().
|
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.
|
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().
|
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.
|
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().
|
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.
|
inlineprivate |
Returns the value of the sortedness flag.
Definition at line 180 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators(), Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators_with_sat_g(), Parma_Polyhedra_Library::Polyhedron::poly_hull_assign(), Parma_Polyhedra_Library::Polyhedron::process_pending_generators(), Parma_Polyhedra_Library::Polyhedron::strongly_minimize_generators(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().
|
inline |
Swaps *this
with y
.
Definition at line 387 of file Generator_System_inlines.hh.
Referenced by swap().
|
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().
|
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().
|
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().
|
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.
|
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().
|
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().
|
inlineprivate |
Definition at line 150 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), affine_image(), Parma_Polyhedra_Library::Polyhedron::BFT00_poly_hull_assign_if_exact(), Parma_Polyhedra_Library::Polyhedron::BHRZ03_combining_constraints(), Parma_Polyhedra_Library::Polyhedron::BHRZ03_evolving_points(), Parma_Polyhedra_Library::Polyhedron::BHRZ03_evolving_rays(), Parma_Polyhedra_Library::Polyhedron::BHZ09_C_poly_hull_assign_if_exact(), Parma_Polyhedra_Library::Polyhedron::BHZ09_NNC_poly_hull_assign_if_exact(), num_lines(), Parma_Polyhedra_Library::Polyhedron::OK(), Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl(), Parma_Polyhedra_Library::Polyhedron::quick_equivalence_test(), Parma_Polyhedra_Library::Polyhedron::select_H79_constraints(), Parma_Polyhedra_Library::Polyhedron::simplify_using_context_assign(), Parma_Polyhedra_Library::Polyhedron::strongly_minimize_generators(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().
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().
|
inline |
Assignment operator.
Definition at line 70 of file Generator_System_inlines.hh.
References swap().
|
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.
|
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().
void Parma_Polyhedra_Library::Generator_System::print | ( | ) | const |
Prints *this
to std::cerr
using operator<<
.
|
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().
|
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().
|
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.
|
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.
|
inlineprivate |
Removes the specified rows. The row ordering of remaining rows is preserved.
indexes | specifies a list of row indexes. It must be sorted. |
Definition at line 241 of file Generator_System_inlines.hh.
References sys.
|
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.
|
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().
|
inline |
Returns the current representation of *this.
Definition at line 77 of file Generator_System_inlines.hh.
References sys.
|
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().
|
private |
Returns true
if all the generators satisfy c
.
It is assumed that c.is_necessarily_closed()
holds.
|
private |
Returns true
if all the generators satisfy c
.
It is assumed that c.is_necessarily_closed()
does not hold.
|
inlineprivate |
Sets the index of the first pending row to i
.
Definition at line 185 of file Generator_System_inlines.hh.
References sys.
|
inline |
Converts *this to the specified representation.
Definition at line 82 of file Generator_System_inlines.hh.
References sys.
|
inlineprivate |
Sets the sortedness flag of the system to b
.
Definition at line 175 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::obtain_sorted_generators_with_sat_g(), Parma_Polyhedra_Library::Polyhedron::Polyhedron(), Parma_Polyhedra_Library::Polyhedron::remove_pending_to_obtain_generators(), and Parma_Polyhedra_Library::Polyhedron::strongly_minimize_generators().
|
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.
|
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.
|
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.
|
inlineprivate |
Sorts the system, removing duplicates, keeping the saturation matrix consistent.
sat | Bit 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().
|
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().
|
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().
|
inline |
Returns the dimension of the vector space enclosing *this
.
Definition at line 92 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), adjust_topology_and_space_dimension(), affine_image(), Parma_Polyhedra_Library::Affine_Space::Affine_Space(), Parma_Polyhedra_Library::Polyhedron::Polyhedron(), set_space_dimension(), and Parma_Polyhedra_Library::Polyhedron::throw_dimension_incompatible().
|
inlineprivate |
Strongly normalizes the system.
Definition at line 261 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::OK().
|
inlineprivate |
Swaps the coefficients of the variables v1
and v2
.
Definition at line 145 of file Generator_System_inlines.hh.
|
inlineprivate |
Definition at line 160 of file Generator_System_inlines.hh.
References sys.
|
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().
|
inlineprivate |
Sets the index to indicate that the system has no pending rows.
Definition at line 170 of file Generator_System_inlines.hh.
References sys.
Referenced by Parma_Polyhedra_Library::Polyhedron::OK(), Parma_Polyhedra_Library::Polyhedron::Polyhedron(), Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl(), Parma_Polyhedra_Library::Polyhedron::remove_pending_to_obtain_generators(), and Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().
|
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().
|
friend |
Definition at line 496 of file Generator_System_defs.hh.
|
related |
Returns true
if and only if x
and y
are different.
Definition at line 286 of file Generator_System_inlines.hh.
|
related |
Output operator.
Writes false
if gs
is empty. Otherwise, writes on s
the generators of gs
, all in one row and separated by ", ".
|
related |
Definition at line 858 of file Generator_System.cc.
References begin(), and end().
|
related |
Returns true
if and only if x
and y
are identical.
Definition at line 281 of file Generator_System_inlines.hh.
|
friend |
Definition at line 281 of file Generator_System_inlines.hh.
|
friend |
Definition at line 656 of file Generator_System_defs.hh.
|
related |
Referenced by m_swap(), and operator=().
|
related |
Definition at line 409 of file Generator_System_inlines.hh.
References m_swap().
|
static |
Definition at line 192 of file Generator_System_defs.hh.
|
private |
Definition at line 651 of file Generator_System_defs.hh.
Referenced by add_corresponding_closure_points(), add_corresponding_points(), Parma_Polyhedra_Library::Polyhedron::add_recycled_generators(), add_universe_rows_and_space_dimensions(), adjust_topology_and_space_dimension(), affine_image(), assign_with_pending(), back_substitute(), begin(), check_sorted(), clear(), empty(), end(), external_memory_in_bytes(), first_pending_row(), gauss(), Generator_System(), has_no_rows(), insert(), insert_pending(), is_necessarily_closed(), is_sorted(), m_swap(), merge_rows_assign(), num_lines_or_equalities(), num_pending_rows(), num_rows(), Parma_Polyhedra_Library::operator==(), operator[](), Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl(), remove_row(), remove_rows(), remove_trailing_rows(), representation(), satisfied_by_all_generators(), set_index_first_pending_row(), set_representation(), set_sorted(), set_space_dimension(), simplify(), sort_and_remove_with_sat(), sort_pending_and_remove_duplicates(), sort_rows(), space_dimension(), strong_normalize(), Parma_Polyhedra_Library::Polyhedron::strongly_minimize_generators(), Parma_Polyhedra_Library::Polyhedron::time_elapse_assign(), topology(), and unset_pending_rows().
|
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().