24 #ifndef PPL_Linear_Expression_Interface_defs_hh
25 #define PPL_Linear_Expression_Interface_defs_hh 1
37 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
50 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
55 virtual bool OK()
const = 0;
71 typedef Coefficient_traits::const_reference
reference;
129 virtual Coefficient_traits::const_reference
164 Coefficient_traits::const_reference c1,
165 Coefficient_traits::const_reference c2) = 0;
170 Coefficient_traits::const_reference c1,
171 Coefficient_traits::const_reference c2) = 0;
204 virtual bool is_zero()
const = 0;
222 virtual void ascii_dump(std::ostream& s)
const = 0;
254 operator+=(Coefficient_traits::const_reference n) = 0;
256 operator-=(Coefficient_traits::const_reference n) = 0;
280 operator*=(Coefficient_traits::const_reference n) = 0;
282 operator/=(Coefficient_traits::const_reference n) = 0;
284 virtual void negate() = 0;
292 virtual void add_mul_assign(Coefficient_traits::const_reference factor,
295 virtual void sub_mul_assign(Coefficient_traits::const_reference factor,
298 virtual void print(std::ostream& s)
const = 0;
315 virtual Coefficient_traits::const_reference
get(
dimension_type i)
const = 0;
360 virtual void mul_assign(Coefficient_traits::const_reference n,
390 Coefficient_traits::const_reference c1,
391 Coefficient_traits::const_reference c2,
400 Coefficient_traits::const_reference c1,
401 Coefficient_traits::const_reference c2,
473 Coefficient_traits::const_reference c1,
474 Coefficient_traits::const_reference c2,
490 #endif // !defined(PPL_Linear_Expression_Interface_defs_hh)
virtual Representation representation() const =0
Returns the current representation of this linear expression.
virtual void mul_assign(Coefficient_traits::const_reference n, dimension_type start, dimension_type end)=0
Equivalent to (*this)[i] *= n, for each i in [start, end).
virtual void operator--()=0
virtual Linear_Expression_Interface & operator*=(Coefficient_traits::const_reference n)=0
virtual bool have_a_common_variable(const Linear_Expression_Interface &x, Variable first, Variable last) const =0
virtual bool all_homogeneous_terms_are_zero() const =0
Returns true if and only if all the homogeneous terms of *this are .
A finite sequence of coefficients.
size_t dimension_type
An unsigned integral type for representing space dimensions.
virtual void ascii_dump(std::ostream &s) const =0
Writes to s an ASCII representation of *this.
An std::set of variables' indexes.
virtual void normalize()=0
virtual reference operator*() const =0
Returns the current element.
virtual void linear_combine(const Linear_Expression_Interface &y, Variable v)=0
virtual void set_space_dimension(dimension_type n)=0
Sets the dimension of the vector space enclosing *this to n .
A finite sparse sequence of coefficients.
virtual void get_row(Dense_Row &r) const =0
Sets r to a copy of the row that implements *this.
virtual void remove_space_dimensions(const Variables_Set &vars)=0
Removes all the specified dimensions from the expression.
virtual bool is_zero() const =0
Returns true if and only if *this is .
virtual void set_coefficient(Variable v, Coefficient_traits::const_reference n)=0
Sets the coefficient of v in *this to n.
virtual void operator++()=0
virtual bool is_equal_to(const Linear_Expression_Interface &x) const =0
A dimension of the vector space.
virtual ~const_iterator_interface()
virtual const_iterator_interface * end() const =0
const Coefficient value_type
virtual dimension_type space_dimension() const =0
Returns the dimension of the vector space enclosing *this.
virtual bool operator==(const const_iterator_interface &x) const =0
Compares *this with x .
virtual int scalar_product_sign(const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const =0
virtual void shift_space_dimensions(Variable v, dimension_type n)=0
virtual void linear_combine_lax(const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2)=0
virtual void set(dimension_type i, Coefficient_traits::const_reference n)=0
Sets the i-th coefficient to n.
virtual void has_a_free_dimension_helper(std::set< dimension_type > &x) const =0
Removes from the set x all the indexes of nonzero elements of *this.
virtual const_iterator_interface * lower_bound(Variable v) const =0
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
virtual bool ascii_load(std::istream &s)=0
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
virtual Linear_Expression_Interface & sub_mul_assign(Coefficient_traits::const_reference n, const Variable v)=0
virtual bool all_zeroes_except(const Variables_Set &vars, dimension_type start, dimension_type end) const =0
Returns true if each coefficient in [start,end) is *not* in , disregarding coefficients of variables ...
virtual Variable variable() const =0
Returns the variable of the coefficient pointed to by *this.
virtual void set_inhomogeneous_term(Coefficient_traits::const_reference n)=0
Sets the inhomogeneous term of *this to n.
virtual Coefficient gcd(dimension_type start, dimension_type end) const =0
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are...
virtual const_iterator_interface * begin() const =0
virtual void exact_div_assign(Coefficient_traits::const_reference c, dimension_type start, dimension_type end)=0
virtual Linear_Expression_Interface & add_mul_assign(Coefficient_traits::const_reference n, const Variable v)=0
virtual void permute_space_dimensions(const std::vector< Variable > &cycle)=0
Permutes the space dimensions of the expression.
virtual Linear_Expression_Interface & operator/=(Coefficient_traits::const_reference n)=0
virtual dimension_type first_nonzero(dimension_type first, dimension_type last) const =0
std::bidirectional_iterator_tag iterator_category
virtual Linear_Expression_Interface & operator+=(Coefficient_traits::const_reference n)=0
virtual memory_size_type total_memory_in_bytes() const =0
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
virtual ~Linear_Expression_Interface()
virtual memory_size_type external_memory_in_bytes() const =0
Returns the size in bytes of the memory managed by *this.
virtual dimension_type num_zeroes(dimension_type start, dimension_type end) const =0
Returns the number of zero coefficient in [start, end).
virtual Linear_Expression_Interface & operator-=(Coefficient_traits::const_reference n)=0
virtual const_iterator_interface * clone() const =0
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
virtual void sign_normalize()=0
virtual void swap_space_dimensions(Variable v1, Variable v2)=0
Swaps the coefficients of the variables v1 and v2 .
virtual void scalar_product_assign(Coefficient &result, const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const =0
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end).
virtual int compare(const Linear_Expression_Interface &y) const =0
The basic comparison function.
Coefficient_traits::const_reference reference
virtual bool OK() const =0
std::ptrdiff_t difference_type
virtual Coefficient_traits::const_reference coefficient(Variable v) const =0
Returns the coefficient of v in *this.
virtual void print(std::ostream &s) const =0
virtual bool all_zeroes(const Variables_Set &vars) const =0
Returns true if the coefficient of each variable in vars[i] is .
virtual Coefficient_traits::const_reference inhomogeneous_term() const =0
Returns the inhomogeneous term of *this.
virtual dimension_type last_nonzero() const =0