24 #ifndef PPL_Pointset_Ask_Tell_templates_hh
25 #define PPL_Pointset_Ask_Tell_templates_hh 1
42 template <
typename PSET>
48 s <<
"PPL::Pointset_Ask_Tell<PSET>::add_disjunct(ph):\n"
50 <<
"ph.space_dimension() == " << ph.space_dimension() <<
".";
51 throw std::invalid_argument(s.str());
55 PPL_ASSERT_HEAVY(x.
OK());
59 template <
typename QH>
62 :
Base(), space_dim(y.space_dimension()) {
65 y_end = y.
end(); i != y_end; ++i) {
74 PPL_ASSERT_HEAVY(x.
OK());
78 template <
typename QH>
81 :
Base(), space_dim(y.space_dimension()) {
84 y_end = y.
end(); i != y_end; ++i) {
88 c_tell(
C_Polyhedron(i->tell().pointset().constraints()));
96 PPL_ASSERT_HEAVY(x.
OK());
99 template <
typename PSET>
114 PPL_ASSERT_HEAVY(x.
OK());
117 template <
typename PSET>
122 s_end = x.
sequence.end(); si != s_end; ++si) {
126 PPL_ASSERT_HEAVY(x.
OK());
129 template <
typename PSET>
134 s_end = x.
sequence.end(); si != s_end; ++si) {
138 PPL_ASSERT_HEAVY(x.
OK());
141 template <
typename PSET>
146 s_end = x.
sequence.end(); si != s_end; ++si) {
150 PPL_ASSERT_HEAVY(x.
OK());
153 template <
typename PSET>
158 s_end = x.
sequence.end(); si != s_end; ++si) {
162 PPL_ASSERT_HEAVY(x.
OK());
165 template <
typename PSET>
170 s_end = x.
sequence.end(); si != s_end; ++si) {
174 PPL_ASSERT_HEAVY(x.
OK());
177 template <
typename PSET>
182 s_end = x.
sequence.end(); si != s_end; ++si) {
186 PPL_ASSERT_HEAVY(x.
OK());
189 template <
typename PSET>
194 Variables_Set::size_type num_removed = vars.size();
195 if (num_removed > 0) {
197 s_end = x.
sequence.end(); si != s_end; ) {
198 PSET& ask = si->ask().pointset();
199 PSET& tell = si->tell().pointset();
200 ask.remove_space_dimensions(vars);
201 tell.remove_space_dimensions(vars);
202 if (tell.contains(ask)) {
212 PPL_ASSERT_HEAVY(x.
OK());
216 template <
typename PSET>
223 s_end = x.
sequence.end(); si != s_end; ++si) {
225 si->tell().pointset().remove_higher_space_dimensions(new_dimension);
229 PPL_ASSERT_HEAVY(x.
OK());
233 template <
typename PSET>
234 template <
typename Partial_Function>
242 if (pfunc.
maps(i, new_i)) {
251 s_end = x.
sequence.end(); si != s_end; ++si) {
252 si->pointset().map_space_dimensions(pfunc);
254 x.
space_dim = s_begin->pointset().space_dimension();
257 PPL_ASSERT_HEAVY(x.
OK());
260 template <
typename PSET>
264 s <<
"size " << x.
size()
268 xi->pointset().ascii_dump(s);
274 template <typename PSET>
280 if (!(s >> str) || str !=
"size") {
290 if (!(s >> str) || str !=
"space_dim") {
301 if (!ph.ascii_load(s)) {
309 PPL_ASSERT_HEAVY(x.
OK());
313 template <
typename PSET>
318 const PSET& ask_i = xi->ask().pointset();
319 const PSET& tell_i = xi->tell().pointset();
320 if (ask_i.space_dimension() != x.
space_dim
321 || tell_i.space_dimension() != x.
space_dim) {
323 std::cerr <<
"Space dimension mismatch: is ("
326 << tell_i.space_dimension()
327 <<
") in an element of the sequence,\nshould be "
339 #endif // !defined(PPL_Pointset_Ask_Tell_templates_hh)
iterator begin()
Returns an iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-th...
The empty element, i.e., the empty set.
A linear equality or inequality.
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
void remove_higher_space_dimensions(dimension_type new_dimension)
Removes the higher space dimensions so that the resulting space will have dimension new_dimension...
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
An std::set of variables' indexes.
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
void add_constraints(const Constraint_System &cs)
Intersects *this with the constraints in cs.
void concatenate_assign(const Determinate &y)
Assigns to *this the concatenation of *this and y, taken in this order.
Base::Sequence_iterator Sequence_iterator
The standard C++ namespace.
#define PPL_OUTPUT_TEMPLATE_DEFINITIONS(type_symbol, class_prefix)
bool is_bottom() const
Returns true if and only if *this is the bottom element of the ask-and-tell constraint system (i...
size_type size() const
Returns the number of pairs.
iterator end()
Returns the past-the-end iterator.
A wrapper for PPL pointsets, providing them with a determinate constraint system interface, as defined in [Bag98].
void unconstrain(Variable var)
Computes the cylindrification of *this with respect to space dimension var, assigning the result to *...
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified space dimensions.
A dimension of the vector space.
void add_space_dimensions_and_embed(dimension_type m)
Adds m new dimensions to the vector space containing *this and embeds each polyhedron in *this in the...
Sequence sequence
The sequence container holding the pairs/.
void add_disjunct(const PSET &ph)
Adds to *this the disjunct ph.
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
The ask-and-tell construction instantiated on PPL polyhedra.
void concatenate_assign(const Pointset_Ask_Tell &y)
Assigns to *this the concatenation of *this and y.
A not necessarily closed convex polyhedron.
void map_space_dimensions(const Partial_Function &pfunc)
Remaps the dimensions of the vector space according to a partial function.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type ascii_load(std::istream &s, T &t)
A closed convex polyhedron.
Base::size_type size_type
bool OK() const
Checks if all the invariants are satisfied.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
The universe element, i.e., the whole vector space.
A const_iterator on a sequence of read-only objects.
void add_constraint(const Constraint &c)
Intersects *this with constraint c.
The entire library is confined to this namespace.
void add_space_dimensions_and_project(dimension_type m)
Adds m new dimensions to the vector space containing *this without embedding the polyhedra in *this i...
bool normalized
If true, *this is normalized.
A pair of ask and tell descriptions.
bool maps(dimension_type i, dimension_type &j) const
If *this maps i to a value k, assigns k to j and returns true; otherwise, j is unchanged and false is...
The ask and tell construction on a base-level domain.