24 #ifndef PPL_Constraint_defs_hh
25 #define PPL_Constraint_defs_hh 1
48 operator<(
const Linear_Expression& e1,
const Linear_Expression& e2);
58 operator<(
const Linear_Expression& e, Coefficient_traits::const_reference n);
63 operator<(Coefficient_traits::const_reference n,
const Linear_Expression& e);
68 operator>(
const Linear_Expression& e1,
const Linear_Expression& e2);
78 operator>(
const Linear_Expression& e, Coefficient_traits::const_reference n);
83 operator>(Coefficient_traits::const_reference n,
const Linear_Expression& e);
88 operator==(
const Linear_Expression& e1,
const Linear_Expression& e2);
98 operator==(
const Linear_Expression& e, Coefficient_traits::const_reference n);
103 operator==(Coefficient_traits::const_reference n,
const Linear_Expression& e);
108 operator<=(
const Linear_Expression& e1,
const Linear_Expression& e2);
118 operator<=(
const Linear_Expression& e, Coefficient_traits::const_reference n);
123 operator<=(Coefficient_traits::const_reference n,
const Linear_Expression& e);
128 operator>=(
const Linear_Expression& e1,
const Linear_Expression& e2);
138 operator>=(
const Linear_Expression& e, Coefficient_traits::const_reference n);
143 operator>=(Coefficient_traits::const_reference n,
const Linear_Expression& e);
145 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
181 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
182 int compare(
const Constraint& x,
const Constraint& y);
657 const char* name_var,
741 template <
typename T>
807 namespace IO_Operators {
822 operator==(
const Constraint& x,
const Constraint& y);
827 operator!=(
const Constraint& x,
const Constraint& y);
830 void swap(Constraint& x, Constraint& y);
836 #endif // !defined(PPL_Constraint_defs_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. ...
Scalar product sign function object depending on topology.
void shift_space_dimensions(Variable v, dimension_type n)
bool is_tautological() const
Returns true if and only if *this is a tautology (i.e., an always true constraint).
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
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.
bool operator>(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
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)
void linear_combine(const Constraint &y, dimension_type i)
Linearly combines *this with y so that i-th coefficient is 0.
static const Constraint * zero_dim_false_p
Holds (between class initialization and finalization) a pointer to the unsatisfiable (zero-dimension ...
The base class for systems of constraints and generators.
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 check_strong_normalized() const
Returns true if and only if the coefficients are strongly normalized.
bool is_necessarily_closed() const
Returns true if and only if the topology of *this row is necessarily closed.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
An std::set of variables' indexes.
void mark_as_necessarily_closed()
Marks the epsilon dimension as a standard dimension.
bool operator>=(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
static const Constraint & zero_dim_false()
The unsatisfiable (zero-dimension space) constraint .
Representation representation() const
Returns the current representation of *this.
friend int compare(const Constraint &x, const Constraint &y)
bool is_line_or_equality() const
Returns true if and only if *this row represents a line or an equality.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void set_is_equality()
Sets the constraint type to EQUALITY.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
friend Constraint operator<(const Linear_Expression &e1, const Linear_Expression &e2)
bool is_equivalent_to(const Constraint &y) const
Returns true if and only if *this and y are equivalent constraints.
A dimension of the vector space.
bool is_strict_inequality() const
Returns true if and only if *this is a strict inequality constraint.
The base class for convex polyhedra.
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).
#define PPL_OUTPUT_DECLARATIONS
void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
friend Constraint operator<=(const Linear_Expression &e1, const Linear_Expression &e2)
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 .
bool operator<(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
bool is_inconsistent() const
Returns true if and only if *this is inconsistent (i.e., an always false constraint).
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.
static void finalize()
Finalizes the class.
int compare(const Linear_Expression &x, const Linear_Expression &y)
void set_representation(Representation r)
Converts *this to the specified representation.
static Constraint construct_epsilon_geq_zero()
Builds a new copy of the zero-dimension space constraint (used to implement NNC polyhedra).
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the constraint.
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. ...
The entire library is confined to this namespace.
friend 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.
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...
void set_topology(Topology x)
Sets to x the topological kind of *this row.
static const Constraint & zero_dim_positivity()
The true (zero-dimension space) constraint , also known as positivity constraint. ...
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...
bool is_equal_to(const Constraint &y) const
Returns true if *this is identical to y.
void throw_invalid_argument(const char *method, const char *message) const
Throws a std::invalid_argument exception containing error message message.
bool OK() const
Checks if all the invariants are satisfied.
void set_space_dimension_no_ok(dimension_type space_dim)
Sparse representation: only the nonzero coefficient are stored. If there are many nonzero coefficient...
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
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.
static void initialize()
Initializes the class.
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.
friend 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.
friend Constraint operator==(const Linear_Expression &e1, const Linear_Expression &e2)
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.
A class implementing various scalar product functions.