24 #ifndef PPL_Linear_System_defs_hh
25 #define PPL_Linear_System_defs_hh 1
41 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
59 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
60 template <
typename Row>
90 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
97 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
168 bool keep_sorted =
false);
177 void remove_rows(
const std::vector<dimension_type>& indexes);
218 const_iterator
begin()
const;
219 const_iterator
end()
const;
316 void insert(
const Row& r);
531 bool operator()(
const Row& x,
const Row& y)
const;
551 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
554 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
555 template <
typename Row>
563 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
566 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
567 template <
typename Row>
568 bool operator==(
const Linear_System<Row>& x,
const Linear_System<Row>& y);
570 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
573 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
574 template <
typename Row>
575 bool operator!=(
const Linear_System<Row>& x,
const Linear_System<Row>& y);
582 #endif // !defined(PPL_Linear_System_defs_hh)
const dimension_type base_index
Comparison predicate (used when implementing the unique algorithm).
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
void swap(CO_Tree &x, CO_Tree &y)
The base class for systems of constraints and generators.
Representation representation() const
Returns the current representation of *this.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void merge_rows_assign(const Linear_System &y)
Assigns to *this the result of merging its rows with those of y, obtaining a sorted system...
An std::set of variables' indexes.
void set_index_first_pending_row(dimension_type i)
Sets the index of the first pending row to i.
void sort_pending_and_remove_duplicates()
Sorts the pending rows and eliminates those that also occur in the non-pending part of the system...
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
void set_not_necessarily_closed()
Sets the system topology to NOT_NECESSARILY_CLOSED.
void insert_pending(const Row &r)
Adds a copy of the given row to the pending part of the system, automatically resizing the system or ...
Topology topology() const
Returns the system topology.
dimension_type num_lines_or_equalities() const
Returns the number of rows in the system that represent either lines or equalities.
void strong_normalize()
Strongly normalizes the system.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
bool is_necessarily_closed() const
Returns true if and only if the system topology is NECESSARILY_CLOSED.
void mark_as_not_necessarily_closed()
Marks the last dimension as the epsilon dimension.
void set_space_dimension(dimension_type space_dim)
Sets the space dimension of the rows in the system to space_dim .
const Row & operator[](dimension_type k) const
Returns a const reference to the k-th row of the system.
bool check_sorted() const
Returns true if and only if *this is sorted, without checking for duplicates.
dimension_type first_pending_row() const
Returns the index of the first pending row.
void sort_and_remove_with_sat(Bit_Matrix &sat)
Sorts the system, removing duplicates, keeping the saturation matrix consistent.
void back_substitute(dimension_type n_lines_or_equalities)
Back-substitutes the coefficients to reduce the complexity of the system.
Linear_System & operator=(const Linear_System &y)
Assignment operator: pending rows are transformed into non-pending ones.
void clear()
Clears the system deallocating all its rows.
Swapping_Vector< Row > rows
The vector that contains the rows.
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the matrix.
void insert_pending_no_ok(Row &r, Recycle_Input)
Adds r to the pending part of the system, stealing its contents and automatically resizing the system...
void remove_row(dimension_type i, bool keep_sorted=false)
Makes the system shrink by removing its i-th row.
void mark_as_necessarily_closed()
Marks the epsilon dimension as a standard dimension.
void set_necessarily_closed()
Sets the system topology to NECESSARILY_CLOSED.
A dimension of the vector space.
bool sorted
true if rows are sorted in the ascending order as defined by bool compare(const Row&, const Row&). If false may not be sorted.
The base class for convex polyhedra.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
#define PPL_OUTPUT_DECLARATIONS
Swapping_Vector< Row >::const_iterator iterator
void m_swap(Linear_System &y)
Swaps *this with y.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void add_universe_rows_and_space_dimensions(dimension_type n)
Adds n rows and space dimensions to the system.
dimension_type num_rows() const
Representation representation_
void set_space_dimension_no_ok(dimension_type space_dim)
Sets the space dimension of the rows in the system to space_dim .
bool is_sorted() const
Returns the value of the sortedness flag.
Swapping_Vector< Row >::const_iterator const_iterator
void simplify()
Applies Gaussian elimination and back-substitution so as to simplify the linear system.
void remove_row_no_ok(dimension_type i, bool keep_sorted=false)
Makes the system shrink by removing its i-th row.
void shift_space_dimensions(Variable v, dimension_type n)
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 insert(const Row &r)
Adds a copy of r to the system, automatically resizing the system or the row's copy, if needed.
The entire library is confined to this namespace.
void sign_normalize()
Sign-normalizes the system.
dimension_type space_dimension_
void assign_with_pending(const Linear_System &y)
Full assignment operator: pending rows are copied as pending.
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void swap_row_intervals(dimension_type first, dimension_type last, dimension_type offset)
Linear_System(Topology topol, Representation r)
Builds an empty linear system with specified topology.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_System can handle.
void remove_trailing_rows(dimension_type n)
Makes the system shrink by removing its n trailing rows.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
dimension_type gauss(dimension_type n_lines_or_equalities)
Minimizes the subsystem of equations contained in *this.
void set_representation(Representation r)
Converts *this to the specified representation.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
dimension_type space_dimension() const
Returns the space dimension of the rows in the system.
void sort_rows()
Sorts the non-pending rows (in growing order) and eliminates duplicated ones.
bool operator()(dimension_type i, dimension_type j) const
void set_sorted(bool b)
Sets the sortedness flag of the system to b.
bool OK() const
Checks if all the invariants are satisfied.
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the system.
void insert_no_ok(Row &r, Recycle_Input)
Adds r to the system, stealing its contents and automatically resizing the system or the row...
const Swapping_Vector< Row > & container
Ordering predicate (used when implementing the sort algorithm).
void set_topology(Topology t)
Sets the system topology to t .
dimension_type num_pending_rows() const
Returns the number of rows that are in the pending part of the system.
bool operator()(const Row &x, const Row &y) const
Unique_Compare(const Swapping_Vector< Row > &cont, dimension_type base=0)
Topology
Kinds of polyhedra domains.
dimension_type index_first_pending
The index of the first pending row.