24 #ifndef PPL_Linear_Expression_Impl_defs_hh
25 #define PPL_Linear_Expression_Impl_defs_hh 1
38 namespace IO_Operators {
40 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
43 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
44 template <
typename Row>
46 operator<<(std::ostream& s, const Linear_Expression_Impl<Row>& e);
52 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
101 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
102 template <
typename Row>
113 template <
typename Row2>
123 virtual bool OK()
const;
154 virtual const_iterator_interface*
clone()
const;
180 virtual bool operator==(
const const_iterator_interface& x)
const;
188 typename Row::const_iterator
itr;
220 Coefficient_traits::const_reference n);
248 Coefficient_traits::const_reference c1,
249 Coefficient_traits::const_reference c2);
254 Coefficient_traits::const_reference c1,
255 Coefficient_traits::const_reference c2);
305 virtual void ascii_dump(std::ostream& s)
const;
341 operator+=(Coefficient_traits::const_reference n);
343 operator-=(Coefficient_traits::const_reference n);
366 operator*=(Coefficient_traits::const_reference n);
368 operator/=(Coefficient_traits::const_reference n);
378 virtual void add_mul_assign(Coefficient_traits::const_reference factor,
381 virtual void sub_mul_assign(Coefficient_traits::const_reference factor,
384 virtual void print(std::ostream& s)
const;
401 virtual Coefficient_traits::const_reference
get(
dimension_type i)
const;
445 virtual void mul_assign(Coefficient_traits::const_reference n,
475 Coefficient_traits::const_reference c1,
476 Coefficient_traits::const_reference c2,
485 Coefficient_traits::const_reference c1,
486 Coefficient_traits::const_reference c2,
559 Coefficient_traits::const_reference c1,
560 Coefficient_traits::const_reference c2,
597 template <
typename Row2>
602 template <
typename Row2>
604 Coefficient_traits::const_reference c1,
605 Coefficient_traits::const_reference c2);
609 template <
typename Row2>
611 Coefficient_traits::const_reference c1,
612 Coefficient_traits::const_reference c2);
616 template <
typename Row2>
619 template <
typename Row2>
621 template <
typename Row2>
624 template <
typename Row2>
630 template <
typename Row2>
634 template <
typename Row2>
653 template <
typename Row2>
658 template <
typename Row2>
660 Coefficient_traits::const_reference c1,
661 Coefficient_traits::const_reference c2,
666 template <
typename Row2>
668 Coefficient_traits::const_reference c1,
669 Coefficient_traits::const_reference c2,
684 template <
typename Row2>
688 template <
typename Row2>
696 template <
typename Row2>
701 template <
typename Row2>
707 template <
typename Row2>
709 Coefficient_traits::const_reference c1,
710 Coefficient_traits::const_reference c2,
715 template <
typename Row2>
725 template <
typename Row2>
727 template <
typename Row2>
733 template <
typename Row2>
906 #endif // !defined(PPL_Linear_Expression_Impl_defs_hh)
virtual Linear_Expression_Impl & operator+=(Coefficient_traits::const_reference n)
virtual void has_a_free_dimension_helper(std::set< dimension_type > &x) const
Removes from the set x all the indexes of nonzero elements of *this.
void construct(const Linear_Expression_Interface &e)
virtual dimension_type first_nonzero(dimension_type first, dimension_type last) const
A finite sequence of coefficients.
virtual void print(std::ostream &s) const
virtual void linear_combine(const Linear_Expression_Interface &y, Variable v)
size_t dimension_type
An unsigned integral type for representing space dimensions.
An std::set of variables' indexes.
virtual Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
virtual void set_inhomogeneous_term(Coefficient_traits::const_reference n)
Sets the inhomogeneous term of *this to n.
virtual void swap_space_dimensions(Variable v1, Variable v2)
Swaps the coefficients of the variables v1 and v2 .
virtual bool have_a_common_variable(const Linear_Expression_Interface &x, Variable first, Variable last) const
virtual bool OK() const
Checks if all the invariants are satisfied.
A finite sparse sequence of coefficients.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_Expression_Impl can handle.
virtual void sign_normalize()
virtual void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the expression.
virtual void set_coefficient(Variable v, Coefficient_traits::const_reference n)
Sets the coefficient of v in *this to n.
virtual Linear_Expression_Impl & operator-=(Coefficient_traits::const_reference n)
virtual Variable variable() const
Returns the variable of the coefficient pointed to by *this.
virtual dimension_type num_zeroes(dimension_type start, dimension_type end) const
Returns the number of zero coefficient in [start, end).
virtual void exact_div_assign(Coefficient_traits::const_reference c, dimension_type start, dimension_type end)
void skip_zeroes_backward()
A dimension of the vector space.
virtual memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
virtual void operator++()
virtual int compare(const Linear_Expression_Interface &y) const
The basic comparison function.
virtual Linear_Expression_Impl & operator*=(Coefficient_traits::const_reference n)
virtual void get_row(Dense_Row &r) const
Sets r to a copy of the row that implements *this.
virtual Linear_Expression_Impl & add_mul_assign(Coefficient_traits::const_reference n, const Variable v)
virtual bool all_zeroes_except(const Variables_Set &vars, dimension_type start, dimension_type end) const
Returns true if each coefficient in [start,end) is *not* in , disregarding coefficients of variables ...
virtual memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
virtual bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
virtual const_iterator_interface * begin() const
virtual bool is_zero() const
Returns true if and only if *this is .
virtual void set_space_dimension(dimension_type n)
Sets the dimension of the vector space enclosing *this to n .
virtual int scalar_product_sign(const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const
Computes the sign of the sum of (*this)[i]*y[i], for each i in [start,end).
void skip_zeroes_forward()
virtual const_iterator_interface * end() const
virtual bool is_equal_to(const Linear_Expression_Interface &x) const
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
virtual void operator--()
virtual void set(dimension_type i, Coefficient_traits::const_reference n)
Sets the i-th coefficient to n.
Linear_Expression_Impl()
Default constructor: returns a copy of Linear_Expression_Impl::zero().
virtual ~Linear_Expression_Impl()
Destructor.
virtual void ascii_dump(std::ostream &s) const
Writes to s an ASCII representation of *this.
virtual void shift_space_dimensions(Variable v, dimension_type n)
The entire library is confined to this namespace.
virtual Linear_Expression_Impl & operator/=(Coefficient_traits::const_reference n)
virtual dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
virtual Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
virtual void mul_assign(Coefficient_traits::const_reference n, dimension_type start, dimension_type end)
Equivalent to (*this)[i] *= n, for each i in [start, end).
virtual bool operator==(const const_iterator_interface &x) const
Compares *this with x .
const_iterator(const Row &row, dimension_type i)
virtual Coefficient gcd(dimension_type start, dimension_type end) const
Returns the gcd of the nonzero coefficients in [start,end). If all the coefficients in this range are...
virtual const_iterator_interface * clone() const
virtual Linear_Expression_Impl & sub_mul_assign(Coefficient_traits::const_reference n, const Variable v)
virtual void linear_combine_lax(const Linear_Expression_Interface &y, Coefficient_traits::const_reference c1, Coefficient_traits::const_reference c2)
virtual void scalar_product_assign(Coefficient &result, const Linear_Expression_Interface &y, dimension_type start, dimension_type end) const
Sets results to the sum of (*this)[i]*y[i], for each i in [start,end).
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
virtual bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars[i] is .
virtual const_iterator_interface * lower_bound(Variable v) const
virtual bool all_homogeneous_terms_are_zero() const
Returns true if and only if all the homogeneous terms of *this are .
virtual void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the expression.
virtual Representation representation() const
Returns the current representation of this linear expression.
virtual reference operator*() const
Returns the current element.
virtual dimension_type last_nonzero() const