24 #ifndef PPL_Expression_Hide_Last_inlines_hh
25 #define PPL_Expression_Hide_Last_inlines_hh 1
35 :
base_type(expr), hide_last_(hide_last) {
53 return this->inner().lower_bound(
Variable(space_dimension()));
56 return this->inner().end();
64 return this->inner().lower_bound(v);
68 inline Coefficient_traits::const_reference
71 return this->inner().coefficient(v);
77 return this->inner().all_zeroes(0, space_dimension() + 1);
83 return this->inner().all_zeroes(1, space_dimension() + 1);
87 template <
typename Expression>
96 return is_equal_to(y, 0, x_dim + 1);
103 return this->inner().all_zeroes(vars);
106 template <
typename T>
107 inline Coefficient_traits::const_reference
109 PPL_ASSERT(i <= space_dimension());
110 return this->inner().get(i);
113 template <
typename T>
114 inline Coefficient_traits::const_reference
117 return this->inner().get(v);
120 template <
typename T>
124 PPL_ASSERT(end <= space_dimension() + 1);
125 return this->inner().all_zeroes(start, end);
128 template <
typename T>
132 PPL_ASSERT(end <= space_dimension() + 1);
133 return this->inner().num_zeroes(start, end);
136 template <
typename T>
140 PPL_ASSERT(end <= space_dimension() + 1);
141 return this->inner().gcd(start, end);
144 template <
typename T>
147 return this->inner().last_nonzero(0, space_dimension() + 1);
150 template <
typename T>
154 PPL_ASSERT(last <= space_dimension() + 1);
155 return this->inner().last_nonzero(first, last);
158 template <
typename T>
162 PPL_ASSERT(last <= space_dimension() + 1);
163 return this->inner().first_nonzero(first, last);
166 template <
typename T>
171 PPL_ASSERT(end <= space_dimension() + 1);
172 return this->inner().all_zeroes_except(vars, start, end);
175 template <
typename T>
182 PPL_ASSERT(*(--x.end()) <= space_dimension());
183 this->inner().has_a_free_dimension_helper(x);
186 template <
typename T>
187 template <
typename Expression>
192 PPL_ASSERT(end <= space_dimension() + 1);
193 PPL_ASSERT(end <= y.space_dimension() + 1);
194 return this->inner().is_equal_to(y, start, end);
197 template <
typename T>
198 template <
typename Expression>
202 Coefficient_traits::const_reference c1,
203 Coefficient_traits::const_reference c2,
205 PPL_ASSERT(end <= space_dimension() + 1);
206 PPL_ASSERT(end <= y.space_dimension() + 1);
207 return this->inner().is_equal_to(y, c1, c2, start, end);
210 template <
typename T>
213 this->inner().get_row(r);
215 PPL_ASSERT(r.
size() != 0);
220 template <
typename T>
223 this->inner().get_row(r);
225 PPL_ASSERT(r.
size() != 0);
230 template <
typename T>
231 template <
typename Expression>
238 return this->inner().have_a_common_variable(y, first, last);
243 #endif // !defined(PPL_Expression_Hide_Last_inlines_hh)
dimension_type space_dimension() const
Returns the dimension of the smallest vector space enclosing all the variables whose indexes are in t...
T::raw_type raw_type
The raw, completely unwrapped type.
A finite sequence of coefficients.
bool have_a_common_variable(const Expression &y, Variable first, Variable last) const
size_t dimension_type
An unsigned integral type for representing space dimensions.
An std::set of variables' indexes.
An adapter for Linear_Expression objects.
dimension_type size() const
Returns the size of the row.
void resize(dimension_type n)
Resizes the row to the specified size.
A finite sparse sequence of coefficients.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Coefficient gcd(dimension_type start, dimension_type end) const
Returns the gcd of the nonzero coefficients in [start,end). Returns zero if all the coefficients in t...
bool all_zeroes_except(const Variables_Set &vars, dimension_type start, dimension_type end) const
Returns true if all coefficients in [start,end), except those corresponding to variables in vars...
bool is_zero() const
Returns true if and only if *this is zero.
const_iterator lower_bound(Variable v) const
A dimension of the vector space.
bool is_equal_to(const Expression &y) const
Returns true if *this is equal to y.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
dimension_type size() const
Gives the number of coefficients currently in use.
Expression_Hide_Last(const raw_type &expr, bool hide_last)
Constructor.
void get_row(Dense_Row &r) const
Sets r to a copy of the row as adapted by *this.
dimension_type last_nonzero() const
dimension_type num_zeroes(dimension_type start, dimension_type end) const
Returns the number of zero coefficient in [start, end).
const_iterator end() const
Iterator pointing after the last nonzero variable coefficient.
Coefficient_traits::const_reference get(dimension_type i) const
Returns the i -th coefficient.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
bool all_homogeneous_terms_are_zero() const
Returns true if and only if all the homogeneous terms of *this are zero.
dimension_type first_nonzero(dimension_type first, dimension_type last) const
The entire library is confined to this namespace.
void resize(dimension_type sz)
Resizes the row to sz.
base_type::const_iterator const_iterator
The type of const iterators on coefficients.
void has_a_free_dimension_helper(std::set< dimension_type > &x) const
Removes from set x all the indexes of nonzero elements in *this.
Coefficient_traits::const_reference coefficient(Variable v) const
Returns the coefficient of v in *this.
bool all_zeroes(const Variables_Set &vars) const
Returns true if the coefficient of each variable in vars is zero.