24 #ifndef PPL_Constraint_inlines_hh
25 #define PPL_Constraint_inlines_hh 1
122 kind_(RAY_OR_POINT_OR_INEQUALITY),
132 topology_(topology) {
141 topology_(topology) {
154 : topology_(topology) {
174 topology_(c.topology_) {
182 topology_(c.topology_) {
188 : expr(c.expr, c.is_necessarily_closed() ? space_dim : (space_dim + 1)),
189 kind_(c.kind_), topology_(c.topology_) {
197 : expr(c.expr, c.is_necessarily_closed() ? space_dim : (space_dim + 1), r),
198 kind_(c.kind_), topology_(c.topology_) {
238 if (space_dim > old_space_dim) {
311 inline Coefficient_traits::const_reference
319 inline Coefficient_traits::const_reference
569 inline Coefficient_traits::const_reference
589 #endif // !defined(PPL_Constraint_inlines_hh)
Expression_Hide_Last< Linear_Expression > expr_type
The type of the (adapted) internal expression.
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
Constraint operator>(const Linear_Expression &e, Coefficient_traits::const_reference n)
void shift_space_dimensions(Variable v, dimension_type n)
void throw_dimension_incompatible(const char *method, const char *name_var, Variable v) const
Throws a std::invalid_argument exception containing the appropriate error message.
A linear equality or inequality.
bool is_equality() const
Returns true if and only if *this is an equality constraint.
void swap(CO_Tree &x, CO_Tree &y)
static const Constraint * zero_dim_false_p
Holds (between class initialization and finalization) a pointer to the unsatisfiable (zero-dimension ...
void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
void set_not_necessarily_closed()
Sets to NOT_NECESSARILY_CLOSED the topological kind of *this row.
Constraint(Representation r=default_representation)
Constructs the constraint.
void m_swap(Constraint &y)
Swaps *this with y.
size_t dimension_type
An unsigned integral type for representing space dimensions.
Type type() const
Returns the constraint type of *this.
static const Constraint * epsilon_geq_zero_p
Holds (between class initialization and finalization) a pointer to the zero-dimension space constrain...
bool is_necessarily_closed() const
Returns true if and only if the topology of *this row is necessarily closed.
An std::set of variables' indexes.
void mark_as_necessarily_closed()
Marks the epsilon dimension as a standard dimension.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
bool operator!=(const Constraint &x, const Constraint &y)
static const Constraint & zero_dim_false()
The unsatisfiable (zero-dimension space) constraint .
Representation representation() const
Returns the current representation of *this.
bool is_line_or_equality() const
Returns true if and only if *this row represents a line or an equality.
bool operator==(const Constraint &x, const Constraint &y)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_is_equality()
Sets the constraint type to EQUALITY.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_coefficient(Variable v, Coefficient_traits::const_reference n)
Sets the coefficient of v in *this to n.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
bool is_equivalent_to(const Constraint &y) const
Returns true if and only if *this and y are equivalent constraints.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
Constraint operator==(const Linear_Expression &e, Coefficient_traits::const_reference n)
A dimension of the vector space.
bool is_strict_inequality() const
Returns true if and only if *this is a strict inequality constraint.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_Expression can handle.
void set_space_dimension(dimension_type space_dim)
Constraint & operator=(const Constraint &c)
Assignment operator.
bool is_inequality() const
Returns true if and only if *this is an inequality constraint (either strict or non-strict).
void set_representation(Representation r)
Converts *this to the specified representation.
void set_necessarily_closed()
Sets to NECESSARILY_CLOSED the topological kind of *this row.
static const Constraint & epsilon_geq_zero()
Returns the zero-dimension space constraint .
Constraint operator==(Coefficient_traits::const_reference n, const Linear_Expression &e)
bool operator<(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
void set_is_ray_or_point_or_inequality()
Sets to RAY_OR_POINT_OR_INEQUALITY the kind of *this row.
bool is_not_necessarily_closed() const
Returns true if and only if the topology of *this row is not necessarily closed.
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
void set_representation(Representation r)
Converts *this to the specified representation.
void set_epsilon_coefficient(Coefficient_traits::const_reference n)
Sets the epsilon coefficient to n. The constraint must be NNC.
static const Constraint * zero_dim_positivity_p
Holds (between class initialization and finalization) a pointer to the true (zero-dimension space) co...
static const Representation default_representation
The representation used for new Constraints.
bool is_ray_or_point_or_inequality() const
Returns true if and only if *this row represents a ray, a point or an inequality. ...
Constraint operator>(const Variable v1, const Variable v2)
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the expression.
void neg_assign(GMP_Integer &x)
The entire library is confined to this namespace.
Representation representation() const
Returns the current representation of *this.
Constraint operator>(const Linear_Expression &e1, const Linear_Expression &e2)
void set_is_line_or_equality()
Sets to LINE_OR_EQUALITY the kind of *this row.
Constraint operator>=(const Linear_Expression &e, Coefficient_traits::const_reference n)
void set_is_inequality()
Sets the constraint to be an inequality.
static const Constraint & epsilon_leq_one()
The zero-dimension space constraint (used to implement NNC polyhedra).
Coefficient_traits::const_reference epsilon_coefficient() const
Returns the epsilon coefficient. The constraint must be NNC.
static const Constraint * epsilon_leq_one_p
Holds (between class initialization and finalization) a pointer to the zero-dimension space constrain...
static const Constraint & zero_dim_positivity()
The true (zero-dimension space) constraint , also known as positivity constraint. ...
void set_topology(Topology x)
Sets to x the topological kind of *this row.
Constraint operator==(Variable v1, Variable v2)
bool operator<=(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
void strong_normalize()
Strong normalization: ensures that different Constraint objects represent different hyperplanes or hy...
Constraint operator>=(const Variable v1, const Variable v2)
bool OK() const
Checks if all the invariants are satisfied.
Constraint operator>(Coefficient_traits::const_reference n, const Linear_Expression &e)
void set_space_dimension_no_ok(dimension_type space_dim)
Kind
The possible kinds of Constraint objects.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
bool is_nonstrict_inequality() const
Returns true if and only if *this is a non-strict inequality constraint.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
expr_type expression() const
Partial read access to the (adapted) internal expression.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Constraint can handle.
Constraint operator>=(const Linear_Expression &e1, const Linear_Expression &e2)
bool remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the constraint.
Topology topology() const
Returns the topological kind of *this.
Constraint operator==(const Linear_Expression &e1, const Linear_Expression &e2)
Constraint operator>=(Coefficient_traits::const_reference n, const Linear_Expression &e)
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void mark_as_not_necessarily_closed()
Marks the last dimension as the epsilon dimension.
void sign_normalize()
Normalizes the sign of the coefficients so that the first non-zero (homogeneous) coefficient of a lin...
An adapter for Linear_Expression that maybe hides the last coefficient.
Topology
Kinds of polyhedra domains.
void swap(Constraint &x, Constraint &y)
void shift_space_dimensions(Variable v, dimension_type n)