24 #ifndef PPL_Generator_System_defs_hh
25 #define PPL_Generator_System_defs_hh 1
40 namespace IO_Operators {
48 std::ostream&
operator<<(std::ostream& s,
const Generator_System& gs);
53 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
56 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
57 bool operator==(
const Generator_System& x,
const Generator_System& y);
60 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
63 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
64 bool operator!=(
const Generator_System& x,
const Generator_System& y);
68 swap(Generator_System& x, Generator_System& y);
268 const_iterator
begin()
const;
271 const_iterator
end()
const;
429 bool keep_sorted =
false);
437 void remove_rows(
const std::vector<dimension_type>& indexes);
614 Coefficient_traits::const_reference denominator);
681 :
public std::iterator<std::forward_iterator_tag,
745 #endif // !defined(PPL_Generator_System_defs_hh)
void remove_row(dimension_type i, bool keep_sorted=false)
Makes the system shrink by removing its i-th row.
Generator_System_const_iterator()
Default constructor.
void simplify()
Applies Gaussian elimination and back-substitution so as to provide a partial simplification of the s...
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
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...
void sort_and_remove_with_sat(Bit_Matrix &sat)
Sorts the system, removing duplicates, keeping the saturation matrix consistent.
dimension_type first_pending_row() const
Returns the index of the first pending row.
A linear equality or inequality.
void swap(CO_Tree &x, CO_Tree &y)
friend bool operator==(const Generator_System &x, const Generator_System &y)
static const Generator_System & zero_dim_univ()
Returns the singleton system containing only Generator::zero_dim_point().
An iterator over a system of generators.
The base class for systems of constraints and generators.
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 ne...
static const Representation default_representation
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool satisfied_by_all_generators_C(const Constraint &c) const
Returns true if all the generators satisfy c.
An std::set of variables' indexes.
~Generator_System_const_iterator()
Destructor.
A line, ray, point or closure point.
void add_universe_rows_and_space_dimensions(dimension_type n)
Adds n rows and space dimensions to the system.
void remove_trailing_rows(dimension_type n)
Makes the system shrink by removing its n trailing rows.
void skip_forward()
*this skips to the next generator, skipping those closure points that are immediately followed by a m...
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the generator system.
void shift_space_dimensions(Variable v, dimension_type n)
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
const Generator * operator->() const
Indirect member selector.
const Generator & operator*() const
Dereference operator.
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the matrix.
bool has_points() const
Returns true if and only if *this contains one or more points.
dimension_type gauss(dimension_type n_lines_or_equalities)
Minimizes the subsystem of equations contained in *this.
void assign_with_pending(const Generator_System &y)
Full assignment operator: pending rows are copied as pending.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
const Linear_System< Generator > * gsp
A const pointer to the Linear_System.
bool is_sorted() const
Returns the value of the sortedness flag.
static void initialize()
Initializes the class.
Generator_System_const_iterator & operator=(const Generator_System_const_iterator &y)
Assignment operator.
void set_index_first_pending_row(dimension_type i)
Sets the index of the first pending row to i.
A dimension of the vector space.
void sort_pending_and_remove_duplicates()
Sorts the pending rows and eliminates those that also occur in the non-pending part of the system...
The base class for convex polyhedra.
const Generator & operator[](dimension_type k) const
Returns a constant reference to the k- th generator of the system.
bool is_necessarily_closed() const
Returns true if and only if the system topology is NECESSARILY_CLOSED.
bool satisfied_by_all_generators(const Constraint &c) const
Returns true if all the generators satisfy c.
#define PPL_OUTPUT_DECLARATIONS
void clear()
Removes all the generators from the generator system and sets its space dimension to 0...
Topology topology() const
void remove_invalid_lines_and_rays()
Removes all the invalid lines and rays.
Representation representation() const
Returns the current representation of *this.
void remove_rows(dimension_type first, dimension_type last, bool keep_sorted=false)
Makes the system shrink by removing the rows in [first,last).
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void insert_pending(const Generator_System &r)
Adds a copy of the rows of `y' to the pending part of `*this'.
Parma_Polyhedra_Library::Poly_Con_Relation relation_with(const Constraint &c) const
Returns the relations holding between the generator system and the constraint c.
Swapping_Vector< Row >::const_iterator const_iterator
Generator_System & operator=(const Generator_System &y)
Assignment operator.
void sort_rows()
Sorts the non-pending rows (in growing order) and eliminates duplicated ones.
dimension_type num_rays() const
Returns the number of rays of the system.
void set_representation(Representation r)
Converts *this to the specified representation.
void convert_into_non_necessarily_closed()
void m_swap(Generator_System &y)
Swaps *this with y.
void add_corresponding_closure_points()
For each unmatched point in *this, adds the corresponding closure point.
static const Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
Generator_System_const_iterator const_iterator
The entire library is confined to this namespace.
static void finalize()
Finalizes the class.
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.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
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...
Linear_System< Generator > sys
bool check_sorted() const
Returns true if and only if *this is sorted, without checking for duplicates.
Linear_System< Generator >::const_iterator i
The const iterator over the Linear_System.
dimension_type num_lines() const
Returns the number of lines of the system.
void back_substitute(dimension_type n_lines_or_equalities)
Back-substitutes the coefficients to reduce the complexity of the system.
bool operator!=(const Generator_System_const_iterator &y) const
Returns true if and only if *this and y are different.
void set_space_dimension(dimension_type space_dim)
Sets the space dimension of the rows in the system to space_dim .
~Generator_System()
Destructor.
Sparse representation: only the nonzero coefficient are stored. If there are many nonzero coefficient...
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
bool OK() const
Checks if all the invariants are satisfied.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Generator_System can handle.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
dimension_type num_pending_rows() const
Returns the number of rows that are in the pending part of the system.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
dimension_type num_rows() const
dimension_type num_lines_or_equalities() const
Returns the number of rows in the system that represent either lines or equalities.
void insert(const Generator &g)
Inserts in *this a copy of the generator g, increasing the number of space dimensions if needed...
bool empty() const
Returns true if and only if *this has no generators.
Generator_System_const_iterator & operator++()
Prefix increment operator.
void add_corresponding_points()
For each unmatched closure point in *this, adds the corresponding point.
void strong_normalize()
Strongly normalizes the system.
bool satisfied_by_all_generators_NNC(const Constraint &c) const
Returns true if all the generators satisfy c.
bool has_closure_points() const
Returns true if and only if *this contains one or more closure points.
bool operator==(const Generator_System_const_iterator &y) const
Returns true if and only if *this and y are identical.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
Topology
Kinds of polyhedra domains.
The relation between a polyhedron and a constraint.
void affine_image(Variable v, const Linear_Expression &expr, Coefficient_traits::const_reference denominator)
Assigns to a given variable an affine expression.