24 #ifndef PPL_Congruence_defs_hh
25 #define PPL_Congruence_defs_hh 1
47 operator==(
const Congruence& x,
const Congruence& y);
52 operator!=(
const Congruence& x,
const Congruence& y);
229 Coefficient_traits::const_reference
modulus()
const;
233 void set_modulus(Coefficient_traits::const_reference m);
236 void scale(Coefficient_traits::const_reference factor);
241 Coefficient_traits::const_reference denominator);
250 operator/=(Coefficient_traits::const_reference k);
463 namespace IO_Operators {
476 operator%=(
const Linear_Expression& e1,
const Linear_Expression& e2);
481 operator%=(
const Linear_Expression& e, Coefficient_traits::const_reference n);
491 operator/(
const Congruence& cg, Coefficient_traits::const_reference k);
496 operator/(
const Constraint&
c, Coefficient_traits::const_reference m);
500 swap(Congruence& x, Congruence& y);
506 #endif // !defined(PPL_Congruence_defs_hh)
A transparent adapter for Linear_Expression objects.
Congruence & operator/=(Coefficient_traits::const_reference k)
Multiplies k into the modulus of *this.
Congruence & operator=(const Congruence &y)
Assignment operator.
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
Coefficient_traits::const_reference modulus() const
Returns a const reference to the modulus of *this.
void sign_normalize()
Normalizes the signs.
A linear equality or inequality.
void affine_preimage(Variable v, const Linear_Expression &expr, Coefficient_traits::const_reference denominator)
void swap(CO_Tree &x, CO_Tree &y)
static const Representation default_representation
The representation used for new Congruences.
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool is_equal_at_dimension(Variable v, const Congruence &cg) const
Returns true if *this is equal to cg in dimension v.
bool is_inconsistent() const
Returns true if and only if *this is inconsistent (i.e., an always false congruence).
void strong_normalize()
Calls normalize, then divides out common factors.
static void initialize()
Initializes the class.
void m_swap(Congruence &y)
Swaps *this with y.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
expr_type expression() const
Partial read access to the (adapted) internal expression.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator/(const Interval< B, Info > &x, const T &y)
bool is_proper_congruence() const
Returns true if the modulus is greater than zero.
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.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Congruence can handle.
static const Congruence & zero_dim_false()
Returns a reference to the false (zero-dimension space) congruence .
A dimension of the vector space.
void normalize()
Normalizes signs and the inhomogeneous term.
static Congruence create(const Linear_Expression &e1, const Linear_Expression &e2, Representation r=default_representation)
Returns the congruence .
static const Congruence & zero_dim_integrality()
Returns a reference to the true (zero-dimension space) congruence , also known as the integrality con...
bool OK() const
Checks if all the invariants are satisfied.
#define PPL_OUTPUT_DECLARATIONS
void set_modulus(Coefficient_traits::const_reference m)
bool is_equality() const
Returns true if *this is an equality.
static const Congruence * zero_dim_false_p
Holds (between class initialization and finalization) a pointer to the false (zero-dimension space) c...
Congruence(Representation r=default_representation)
Constructs the 0 = 0 congruence with space dimension 0 .
void throw_dimension_incompatible(const char *method, const char *v_name, Variable v) const
Throws a std::invalid_argument exception containing the appropriate error message.
void throw_invalid_argument(const char *method, const char *message) const
Throws a std::invalid_argument exception containing error message message.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
bool is_tautological() const
Returns true if and only if *this is a tautology (i.e., an always true congruence).
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static void finalize()
Finalizes the class.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void permute_space_dimensions(const std::vector< Variable > &cycles)
The entire library is confined to this namespace.
friend bool operator==(const Congruence &x, const Congruence &y)
Sparse representation: only the nonzero coefficient are stored. If there are many nonzero coefficient...
Representation representation() const
Returns the current representation of *this.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
bool ascii_load(std::istream &s)
Loads from s an ASCII representation of the internal representation of *this.
void shift_space_dimensions(Variable v, dimension_type n)
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
friend bool operator!=(const Congruence &x, const Congruence &y)
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
void scale(Coefficient_traits::const_reference factor)
Multiplies all the coefficients, including the modulus, by factor .
Expression_Adapter_Transparent< Linear_Expression > expr_type
The type of the (adapted) internal expression.
void set_space_dimension(dimension_type n)
bool le(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
A class implementing various scalar product functions.
static const Congruence * zero_dim_integrality_p
Holds (between class initialization and finalization) a pointer to the true (zero-dimension space) co...