PPL  1.2
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET > Class Template Reference

The ask-and-tell construction instantiated on PPL polyhedra. More...

#include <Pointset_Ask_Tell_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >:
Collaboration diagram for Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >:

Public Types

typedef PSET element_type
 
typedef Base::size_type size_type
 
typedef Base::value_type value_type
 
typedef Base::iterator iterator
 
typedef Base::const_iterator const_iterator
 
typedef Base::reverse_iterator reverse_iterator
 
typedef Base::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >
typedef Sequence::size_type size_type
 
typedef Sequence::value_type value_type
 
typedef iterator_to_const< Sequenceiterator
 Alias for a read-only bidirectional iterator on the pairs an Ask_Tell object. More...
 
typedef const_iterator_to_const< Sequenceconst_iterator
 A bidirectional const_iterator on the disjuncts of a Powerset element. More...
 
typedef std::reverse_iterator< iteratorreverse_iterator
 The reverse iterator type built from Powerset::iterator. More...
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 The reverse iterator type built from Powerset::const_iterator. More...
 

Public Member Functions

void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this. More...
 
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this. More...
 
void print () const
 Prints *this to std::cerr using operator<<. More...
 
bool ascii_load (std::istream &s)
 Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. More...
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< C_Polyhedron > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< NNC_Polyhedron > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< QH > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< QH > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< C_Polyhedron > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< NNC_Polyhedron > &y)
 
template<>
void poly_difference_assign (const Pointset_Ask_Tell &y)
 
template<>
bool geometrically_covers (const Pointset_Ask_Tell &y) const
 
template<typename QH >
Pointset_Ask_Tell< PSET > & operator= (const Pointset_Ask_Tell< QH > &y)
 
template<>
bool geometrically_equals (const Pointset_Ask_Tell &y) const
 
template<>
void poly_difference_assign (const Pointset_Ask_Tell &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< QH > &y)
 
template<>
 Pointset_Ask_Tell (const Pointset_Ask_Tell< QH > &y)
 
Constructors
 Pointset_Ask_Tell (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
 Builds a universe (top) or empty (bottom) Pointset_Ask_Tell. More...
 
 Pointset_Ask_Tell (const Pointset_Ask_Tell &y)
 Ordinary copy constructor. More...
 
 Pointset_Ask_Tell (const PSET &ph)
 If ph is nonempty, builds a powerset containing only ph. Builds the empty powerset otherwise. More...
 
template<typename QH >
 Pointset_Ask_Tell (const Pointset_Ask_Tell< QH > &y)
 Copy constructor allowing a source powerset with elements of a different polyhedron kind. More...
 
 Pointset_Ask_Tell (const Constraint_System &cs)
 Creates a Pointset_Ask_Tell with a single polyhedron with the same information contents as cs. More...
 
 Pointset_Ask_Tell (const Congruence_System &cgs)
 Creates a Pointset_Ask_Tell with a single polyhedron with the same information contents as cgs. More...
 
Member Functions that Do Not Modify the Ask_Tell of Polyhedra
dimension_type space_dimension () const
 Returns the dimension of the vector space enclosing *this. More...
 
bool geometrically_covers (const Pointset_Ask_Tell &y) const
 Returns true if and only if *this geometrically covers y, i.e., if any point (in some element) of y is also a point (of some element) of *this. More...
 
bool geometrically_equals (const Pointset_Ask_Tell &y) const
 Returns true if and only if *this is geometrically equal to y, i.e., if (the elements of) *this and y contain the same set of points. More...
 
memory_size_type total_memory_in_bytes () const
 Returns a lower bound to the total size in bytes of the memory occupied by *this. More...
 
memory_size_type external_memory_in_bytes () const
 Returns a lower bound to the size in bytes of the memory managed by *this. More...
 
int32_t hash_code () const
 Returns a 32-bit hash code for *this. More...
 
bool OK () const
 Checks if all the invariants are satisfied. More...
 
Space Dimension Preserving Member Functions that May Modify the Ask_Tell of Polyhedra
void add_disjunct (const PSET &ph)
 Adds to *this the disjunct ph. More...
 
void add_constraint (const Constraint &c)
 Intersects *this with constraint c. More...
 
void add_constraints (const Constraint_System &cs)
 Intersects *this with the constraints in cs. More...
 
void pairwise_reduce ()
 Assign to *this the result of (recursively) merging together the pairs of polyhedra whose poly-hull is the same as their set-theoretical union. More...
 
void unconstrain (Variable var)
 Computes the cylindrification of *this with respect to space dimension var, assigning the result to *this. More...
 
void unconstrain (const Variables_Set &vars)
 Computes the cylindrification of *this with respect to the set of space dimensions vars, assigning the result to *this. More...
 
void intersection_assign (const Pointset_Ask_Tell &y)
 Assigns to *this the intersection of *this and y. More...
 
void poly_difference_assign (const Pointset_Ask_Tell &y)
 Assigns to *this the difference of *this and y. More...
 
void time_elapse_assign (const Pointset_Ask_Tell &y)
 Assigns to *this the result of computing the time-elapse between *this and y. More...
 
template<typename Widening >
void BGP99_extrapolation_assign (const Pointset_Ask_Tell &y, Widening widen_fun, unsigned max_disjuncts)
 Assigns to *this the result of applying the BGP99 extrapolation operator to *this and y, using the widening function widen_fun and the cardinality threshold max_disjuncts. More...
 
template<typename Cert , typename Widening >
void BHZ03_widening_assign (const Pointset_Ask_Tell &y, Widening widen_fun)
 Assigns to *this the result of computing the BHZ03-widening between *this and y, using the widening function widen_fun certified by the convergence certificate Cert. More...
 
Member Functions that May Modify the Dimension of the Vector Space
Pointset_Ask_Telloperator= (const Pointset_Ask_Tell &y)
 The assignment operator (*this and y can be dimension-incompatible). More...
 
template<typename QH >
Pointset_Ask_Telloperator= (const Pointset_Ask_Tell< QH > &y)
 Assignment operator allowing a source powerset with elements of a different polyhedron kind (*this and y can be dimension-incompatible). More...
 
void m_swap (Pointset_Ask_Tell &y)
 Swaps *this with y. More...
 
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 new space. More...
 
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 in the new space. More...
 
void concatenate_assign (const Pointset_Ask_Tell &y)
 Assigns to *this the concatenation of *this and y. More...
 
void remove_space_dimensions (const Variables_Set &vars)
 Removes all the specified space dimensions. More...
 
void remove_higher_space_dimensions (dimension_type new_dimension)
 Removes the higher space dimensions so that the resulting space will have dimension new_dimension. More...
 
template<typename Partial_Function >
void map_space_dimensions (const Partial_Function &pfunc)
 Remaps the dimensions of the vector space according to a partial function. More...
 
- Public Member Functions inherited from Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >
 Ask_Tell ()
 Default constructor: builds the top of the ask-and-tell constraint system (i.e., the empty system). More...
 
 Ask_Tell (const Ask_Tell &y)
 Copy constructor. More...
 
 Ask_Tell (const Ask_Tell_Pair< Parma_Polyhedra_Library::Determinate< PSET > > &p)
 If p is not top, builds an ask-and-tell system containing only p. Builds the empty system otherwise. More...
 
 Ask_Tell (const Parma_Polyhedra_Library::Determinate< PSET > &ask, const Parma_Polyhedra_Library::Determinate< PSET > &tell)
 If ask and tell do not constitute a top pair, builds an ask-and-tell system containing only that pair. Builds the empty system otherwise. More...
 
 ~Ask_Tell ()
 Destructor. More...
 
bool definitely_entails (const Ask_Tell &y) const
 Returns true if *this definitely entails y. Returns false if *this may not entail y (i.e., if *this does not entail y or if entailment could not be decided). More...
 
bool is_top () const
 Returns true if and only if *this is the top element of the ask-and-tell constraint system (i.e., it represents the universe). More...
 
bool is_bottom () const
 Returns true if and only if *this is the bottom element of the ask-and-tell constraint system (i.e., it represents the empty set). More...
 
memory_size_type total_memory_in_bytes () const
 Returns a lower bound to the total size in bytes of the memory occupied by *this. More...
 
memory_size_type external_memory_in_bytes () const
 Returns a lower bound to the size in bytes of the memory managed by *this. More...
 
int32_t hash_code () const
 Returns a 32-bit hash code for *this. More...
 
bool OK () const
 Checks if all the invariants are satisfied. More...
 
void normalize () const
 Normalizes the pairs in *this. More...
 
size_type size () const
 Returns the number of pairs. More...
 
bool empty () const
 Returns true if and only if there are no pairs in *this. More...
 
iterator begin ()
 Returns an iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-the-end iterator. More...
 
const_iterator begin () const
 Returns a const_iterator pointing to the first pair, if *this is not empty; otherwise, returns the past-the-end const_iterator. More...
 
iterator end ()
 Returns the past-the-end iterator. More...
 
const_iterator end () const
 Returns the past-the-end const_iterator. More...
 
reverse_iterator rbegin ()
 Returns a reverse_iterator pointing to the last pair, if *this is not empty; otherwise, returns the before-the-start reverse_iterator. More...
 
const_reverse_iterator rbegin () const
 Returns a const_reverse_iterator pointing to the last pair, if *this is not empty; otherwise, returns the before-the-start const_reverse_iterator. More...
 
reverse_iterator rend ()
 Returns the before-the-start reverse_iterator. More...
 
const_reverse_iterator rend () const
 Returns the before-the-start const_reverse_iterator. More...
 
Ask_Telladd_pair (const Ask_Tell_Pair< Parma_Polyhedra_Library::Determinate< PSET > > &p)
 Adds to *this the pair p. More...
 
Ask_Telladd_pair (const Parma_Polyhedra_Library::Determinate< PSET > &ask, const Parma_Polyhedra_Library::Determinate< PSET > &tell)
 Adds to *this the pair constituted by ask and tell. More...
 
iterator drop_pair (iterator position)
 Drops the pair in *this pointed to by position, returning an iterator to the pair following position. More...
 
void drop_pairs (iterator first, iterator last)
 Drops all the pairs from first to last (excluded). More...
 
void clear ()
 Drops all the pairs, making *this an empty powerset. More...
 
Ask_Telloperator= (const Ask_Tell &y)
 The assignment operator. (*this and y can be dimension-incompatible.) More...
 
void m_swap (Ask_Tell &y)
 Swaps *this with y. More...
 
void upper_bound_assign (const Ask_Tell &y)
 Assigns to *this an upper bound of *this and y. More...
 
void meet_assign (const Ask_Tell &y)
 Assigns to *this the meet of *this and y. More...
 

Static Public Member Functions

static dimension_type max_space_dimension ()
 Returns the maximum space dimension a Pointset_Ask_Tell<PSET> can handle. More...
 

Private Types

typedef Determinate< PSET > Det_PSET
 
typedef Ask_Tell< Det_PSETBase
 
typedef Base::Pair Pair
 
typedef Base::Sequence Sequence
 
typedef Base::Sequence_iterator Sequence_iterator
 
typedef Base::Sequence_const_iterator Sequence_const_iterator
 

Private Member Functions

template<typename Widening >
void BGP99_heuristics_assign (const Pointset_Ask_Tell &y, Widening widen_fun)
 Assigns to *this the result of applying the BGP99 heuristics to *this and y, using the widening function widen_fun. More...
 
template<typename Cert >
void collect_certificates (std::map< Cert, size_type, typename Cert::Compare > &cert_ms) const
 Records in cert_ms the certificates for this set of polyhedra. More...
 
template<typename Cert >
bool is_cert_multiset_stabilizing (const std::map< Cert, size_type, typename Cert::Compare > &y_cert_ms) const
 Returns true if and only if the current set of polyhedra is stabilizing with respect to the multiset of certificates y_cert_ms. More...
 

Private Attributes

dimension_type space_dim
 The number of dimensions of the enclosing vector space. More...
 

Friends

class Pointset_Ask_Tell< NNC_Polyhedron >
 

Related Functions

(Note that these are not member functions.)

template<typename PSET >
void swap (Pointset_Ask_Tell< PSET > &x, Pointset_Ask_Tell< PSET > &y)
 Swaps x with y. More...
 
template<typename PSET >
bool check_containment (const PSET &ph, const Pointset_Ask_Tell< PSET > &ps)
 
template<>
bool check_containment (const C_Polyhedron &ph, const Pointset_Ask_Tell< C_Polyhedron > &ps)
 
template<typename PSET >
void swap (Pointset_Ask_Tell< PSET > &x, Pointset_Ask_Tell< PSET > &y)
 

Additional Inherited Members

- Protected Types inherited from Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >
typedef Ask_Tell_Pair< Parma_Polyhedra_Library::Determinate< PSET > > Pair
 An ask-tell agent is composed of pairs. More...
 
typedef std::list< Ask_Tell_Pair< Parma_Polyhedra_Library::Determinate< PSET > > > Sequence
 An ask-tell agent is implemented as a sequence of ask-tell pairs. More...
 
typedef Sequence::iterator Sequence_iterator
 Alias for the low-level iterator on the pairs. More...
 
typedef Sequence::const_iterator Sequence_const_iterator
 Alias for the low-level const_iterator on the pairs. More...
 
- Protected Member Functions inherited from Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >
bool is_normalized () const
 Returns true if and only if *this is normalized. More...
 
void pair_insert (const Parma_Polyhedra_Library::Determinate< PSET > &a, const Parma_Polyhedra_Library::Determinate< PSET > &t)
 
void pair_insert_good (const Parma_Polyhedra_Library::Determinate< PSET > &a, const Parma_Polyhedra_Library::Determinate< PSET > &t)
 
bool reduce ()
 
bool deduce ()
 
bool absorb ()
 
void deabsorb () const
 
bool check_normalized () const
 Does the hard work of checking whether *this is normalized and returns true if and only if it is. More...
 
bool probe (const Parma_Polyhedra_Library::Determinate< PSET > &tellv, const Parma_Polyhedra_Library::Determinate< PSET > &askv) const
 
- Protected Attributes inherited from Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >
Sequence sequence
 The sequence container holding the pairs/. More...
 
bool normalized
 If true, *this is normalized. More...
 

Detailed Description

template<typename PSET>
class Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >

The ask-and-tell construction instantiated on PPL polyhedra.

Definition at line 46 of file Pointset_Ask_Tell_defs.hh.

Member Typedef Documentation

template<typename PSET>
typedef Ask_Tell<Det_PSET> Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Base
private

Definition at line 54 of file Pointset_Ask_Tell_defs.hh.

Definition at line 401 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef Determinate<PSET> Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Det_PSET
private

Definition at line 53 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef PSET Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::element_type

Definition at line 50 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef Base::iterator Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::iterator

Definition at line 400 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef Base::Pair Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pair
private

Definition at line 55 of file Pointset_Ask_Tell_defs.hh.

Definition at line 402 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef Base::Sequence Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Sequence
private

Definition at line 415 of file Pointset_Ask_Tell_defs.hh.

Definition at line 417 of file Pointset_Ask_Tell_defs.hh.

Definition at line 416 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET>
typedef Base::size_type Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::size_type

Definition at line 398 of file Pointset_Ask_Tell_defs.hh.

Definition at line 399 of file Pointset_Ask_Tell_defs.hh.

Constructor & Destructor Documentation

template<typename PSET >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( dimension_type  num_dimensions = 0,
Degenerate_Element  kind = UNIVERSE 
)
inlineexplicit

Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.

Parameters
num_dimensionsThe number of dimensions of the vector space enclosing the powerset;
kindSpecifies whether the universe or the empty powerset has to be built.

Definition at line 54 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::pair_insert(), and Parma_Polyhedra_Library::UNIVERSE.

56  : Base(), space_dim(num_dimensions) {
57  if (kind == EMPTY) {
58  pair_insert(Determinate<PSET>(PSET(num_dimensions, UNIVERSE)),
59  Determinate<PSET>(PSET(num_dimensions, EMPTY)));
60  }
61  PPL_ASSERT_HEAVY(OK());
62 }
The empty element, i.e., the empty set.
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.
void pair_insert(const Parma_Polyhedra_Library::Determinate< PSET > &a, const Parma_Polyhedra_Library::Determinate< PSET > &t)
template<typename PSET >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( const Pointset_Ask_Tell< PSET > &  y)
inline

Ordinary copy constructor.

Definition at line 66 of file Pointset_Ask_Tell_inlines.hh.

67  : Base(y), space_dim(y.space_dim) {
68 }
dimension_type space_dim
The number of dimensions of the enclosing vector space.
template<typename PSET >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( const PSET &  ph)
inlineexplicit

If ph is nonempty, builds a powerset containing only ph. Builds the empty powerset otherwise.

Definition at line 72 of file Pointset_Ask_Tell_inlines.hh.

73  : Base(ph), space_dim(ph.space_dimension()) {
74 }
dimension_type space_dim
The number of dimensions of the enclosing vector space.
template<typename PSET>
template<typename QH >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( const Pointset_Ask_Tell< QH > &  y)
explicit

Copy constructor allowing a source powerset with elements of a different polyhedron kind.

template<typename PSET >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( const Constraint_System cs)
inlineexplicit

Creates a Pointset_Ask_Tell with a single polyhedron with the same information contents as cs.

Definition at line 78 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK().

79  : Base(Determinate<PSET>(cs)), space_dim(cs.space_dimension()) {
80  PPL_ASSERT_HEAVY(OK());
81 }
bool OK() const
Checks if all the invariants are satisfied.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
template<typename PSET >
Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell ( const Congruence_System cgs)
inlineexplicit

Creates a Pointset_Ask_Tell with a single polyhedron with the same information contents as cgs.

Definition at line 85 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK().

86  : Base(Determinate<PSET>(cgs)), space_dim(cgs.space_dimension()) {
87  PPL_ASSERT_HEAVY(OK());
88 }
bool OK() const
Checks if all the invariants are satisfied.
dimension_type space_dim
The number of dimensions of the enclosing vector space.

Definition at line 32 of file Pointset_Ask_Tell.cc.

References Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::begin(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::end(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::normalized, Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

33  : Base(), space_dim(y.space_dimension()) {
34  Pointset_Ask_Tell& x = *this;
35  for (Pointset_Ask_Tell<C_Polyhedron>::const_iterator i = y.begin(),
36  y_end = y.end(); i != y_end; ++i) {
37  Determinate<NNC_Polyhedron> nnc_ask(NNC_Polyhedron(i->ask().pointset()));
38  Determinate<NNC_Polyhedron> nnc_tell(NNC_Polyhedron(i->tell().pointset()));
39  x.sequence.push_back(Pair(nnc_ask, nnc_tell));
40  }
41  x.normalized = y.normalized;
42  PPL_ASSERT_HEAVY(x.OK());
43 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
dimension_type space_dim
The number of dimensions of the enclosing vector space.

Definition at line 48 of file Pointset_Ask_Tell.cc.

References Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::begin(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::end(), Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

49  : Base(), space_dim(y.space_dimension()) {
50  Pointset_Ask_Tell& x = *this;
51  for (Pointset_Ask_Tell<NNC_Polyhedron>::const_iterator i = y.begin(),
52  y_end = y.end(); i != y_end; ++i) {
53  Determinate<C_Polyhedron> c_ask(C_Polyhedron(i->ask().pointset()));
54  Determinate<C_Polyhedron> c_tell(C_Polyhedron(i->tell().pointset()));
55  x.sequence.push_back(Pair(c_ask, c_tell));
56  }
57 
58  // Note: this might be non-normalized even when `y' is known to be
59  // normalized, because the constructor of C_Polyhedron, by enforcing
60  // topological closure, may have made different elements comparable.
61  x.normalized = false;
62  PPL_ASSERT_HEAVY(x.OK());
63 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
dimension_type space_dim
The number of dimensions of the enclosing vector space.

Definition at line 61 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::begin(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::end(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::normalized, Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

62  : Base(), space_dim(y.space_dimension()) {
63  Pointset_Ask_Tell& x = *this;
64  for (typename Pointset_Ask_Tell<QH>::const_iterator i = y.begin(),
65  y_end = y.end(); i != y_end; ++i) {
66  Determinate<NNC_Polyhedron>
67  nnc_ask(NNC_Polyhedron(i->ask().pointset().constraints()));
68  Determinate<NNC_Polyhedron>
69  nnc_tell(NNC_Polyhedron(i->tell().pointset().constraints()));
70  x.sequence.push_back(Pair(nnc_ask, nnc_tell));
71  }
72  // FIXME: the following is a bug!
73  x.normalized = y.normalized;
74  PPL_ASSERT_HEAVY(x.OK());
75 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
dimension_type space_dim
The number of dimensions of the enclosing vector space.

Definition at line 80 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::begin(), Parma_Polyhedra_Library::Ask_Tell< Parma_Polyhedra_Library::Determinate< PSET > >::end(), Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

81  : Base(), space_dim(y.space_dimension()) {
82  Pointset_Ask_Tell& x = *this;
83  for (typename Pointset_Ask_Tell<QH>::const_iterator i = y.begin(),
84  y_end = y.end(); i != y_end; ++i) {
85  Determinate<C_Polyhedron>
86  c_ask(C_Polyhedron(i->ask().pointset().constraints()));
87  Determinate<C_Polyhedron>
88  c_tell(C_Polyhedron(i->tell().pointset().constraints()));
89  x.sequence.push_back(Pair(c_ask, c_tell));
90  }
91 
92  // Note: in general, normalization of `y' does not propagate to `x',
93  // because the approximation potentially introduced by the conversion
94  // may have made uncomparable elements in `y' to become comparable in `x'.
95  x.normalized = false;
96  PPL_ASSERT_HEAVY(x.OK());
97 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
dimension_type space_dim
The number of dimensions of the enclosing vector space.

Member Function Documentation

template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraint ( const Constraint c)

Intersects *this with constraint c.

Exceptions
std::invalid_argumentThrown if *this and constraint c are topology-incompatible or dimension-incompatible.

Definition at line 119 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraint(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraint().

119  {
120  Pointset_Ask_Tell& x = *this;
121  for (Sequence_iterator si = x.sequence.begin(),
122  s_end = x.sequence.end(); si != s_end; ++si) {
123  si->pointset().add_constraint(c);
124  }
125  x.reduced = false;
126  PPL_ASSERT_HEAVY(x.OK());
127 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
Coefficient c
Definition: PIP_Tree.cc:64
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraints ( const Constraint_System cs)

Intersects *this with the constraints in cs.

Parameters
csThe constraints to intersect with.
Exceptions
std::invalid_argumentThrown if *this and cs are topology-incompatible or dimension-incompatible.

Definition at line 131 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraints(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), and Parma_Polyhedra_Library::Ask_Tell< D >::sequence.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraints().

131  {
132  Pointset_Ask_Tell& x = *this;
133  for (Sequence_iterator si = x.sequence.begin(),
134  s_end = x.sequence.end(); si != s_end; ++si) {
135  si->pointset().add_constraints(cs);
136  }
137  x.reduced = false;
138  PPL_ASSERT_HEAVY(x.OK());
139 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_disjunct ( const PSET &  ph)

Adds to *this the disjunct ph.

Exceptions
std::invalid_argumentThrown if *this and ph are dimension-incompatible.

Definition at line 44 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dimension().

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_load().

44  {
45  Pointset_Ask_Tell& x = *this;
46  if (x.space_dimension() != ph.space_dimension()) {
47  std::ostringstream s;
48  s << "PPL::Pointset_Ask_Tell<PSET>::add_disjunct(ph):\n"
49  << "this->space_dimension() == " << x.space_dimension() << ", "
50  << "ph.space_dimension() == " << ph.space_dimension() << ".";
51  throw std::invalid_argument(s.str());
52  }
53  x.sequence.push_back(Determinate<PSET>(ph));
54  x.reduced = false;
55  PPL_ASSERT_HEAVY(x.OK());
56 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::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 new space.

Definition at line 167 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_embed(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_embed().

167  {
168  Pointset_Ask_Tell& x = *this;
169  for (Sequence_iterator si = x.sequence.begin(),
170  s_end = x.sequence.end(); si != s_end; ++si) {
171  si->pointset().add_space_dimensions_and_embed(m);
172  }
173  x.space_dim += m;
174  PPL_ASSERT_HEAVY(x.OK());
175 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_project ( dimension_type  m)

Adds m new dimensions to the vector space containing *this without embedding the polyhedra in *this in the new space.

Definition at line 179 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_project(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_project().

179  {
180  Pointset_Ask_Tell& x = *this;
181  for (Sequence_iterator si = x.sequence.begin(),
182  s_end = x.sequence.end(); si != s_end; ++si) {
183  si->pointset().add_space_dimensions_and_project(m);
184  }
185  x.space_dim += m;
186  PPL_ASSERT_HEAVY(x.OK());
187 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump ( ) const

Writes to std::cerr an ASCII representation of *this.

template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_dump ( std::ostream &  s) const

Writes to s an ASCII representation of *this.

Definition at line 262 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), Parma_Polyhedra_Library::Ask_Tell< D >::size(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

262  {
263  const Pointset_Ask_Tell& x = *this;
264  s << "size " << x.size()
265  << "\nspace_dim " << x.space_dim
266  << "\n";
267  for (const_iterator xi = x.begin(), x_end = x.end(); xi != x_end; ++xi) {
268  xi->pointset().ascii_dump(s);
269  }
270 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_load ( std::istream &  s)

Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise.

Definition at line 276 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_disjunct(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim, and Parma_Polyhedra_Library::swap().

276  {
277  Pointset_Ask_Tell& x = *this;
278  std::string str;
279 
280  if (!(s >> str) || str != "size") {
281  return false;
282  }
283 
284  size_type sz;
285 
286  if (!(s >> sz)) {
287  return false;
288  }
289 
290  if (!(s >> str) || str != "space_dim") {
291  return false;
292  }
293 
294  if (!(s >> x.space_dim)) {
295  return false;
296  }
297 
298  Pointset_Ask_Tell new_x(x.space_dim, EMPTY);
299  while (sz-- > 0) {
300  PSET ph;
301  if (!ph.ascii_load(s)) {
302  return false;
303  }
304  new_x.add_disjunct(ph);
305  }
306  swap(x, new_x);
307 
308  // Check invariants.
309  PPL_ASSERT_HEAVY(x.OK());
310  return true;
311 }
The empty element, i.e., the empty set.
void swap(Pointset_Ask_Tell< PSET > &x, Pointset_Ask_Tell< PSET > &y)
Swaps x with y.
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET>
template<typename Widening >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::BGP99_extrapolation_assign ( const Pointset_Ask_Tell< PSET > &  y,
Widening  widen_fun,
unsigned  max_disjuncts 
)

Assigns to *this the result of applying the BGP99 extrapolation operator to *this and y, using the widening function widen_fun and the cardinality threshold max_disjuncts.

Parameters
yA finite powerset of polyhedra. It must definitely entail *this;
widen_funThe widening function to be used on polyhedra objects. It is obtained from the corresponding widening method by using the helper function Parma_Polyhedra_Library::widen_fun_ref. Legal values are, e.g., widen_fun_ref(&Polyhedron::H79_widening_assign) and widen_fun_ref(&Polyhedron::limited_H79_extrapolation_assign, cs);
max_disjunctsThe maximum number of disjuncts occurring in the powerset *this before starting the computation. If this number is exceeded, some of the disjuncts in *this are collapsed (i.e., joined together).
Exceptions
std::invalid_argumentThrown if *this and y are topology-incompatible or dimension-incompatible.

For a description of the extrapolation operator, see [BGP99] and [BHZ03b].

template<typename PSET>
template<typename Widening >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::BGP99_heuristics_assign ( const Pointset_Ask_Tell< PSET > &  y,
Widening  widen_fun 
)
private

Assigns to *this the result of applying the BGP99 heuristics to *this and y, using the widening function widen_fun.

template<typename PSET>
template<typename Cert , typename Widening >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::BHZ03_widening_assign ( const Pointset_Ask_Tell< PSET > &  y,
Widening  widen_fun 
)

Assigns to *this the result of computing the BHZ03-widening between *this and y, using the widening function widen_fun certified by the convergence certificate Cert.

Parameters
yThe finite powerset of polyhedra computed in the previous iteration step. It must definitely entail *this;
widen_funThe widening function to be used on polyhedra objects. It is obtained from the corresponding widening method by using the helper function widen_fun_ref. Legal values are, e.g., widen_fun_ref(&Polyhedron::H79_widening_assign) and widen_fun_ref(&Polyhedron::limited_H79_extrapolation_assign, cs).
Exceptions
std::invalid_argumentThrown if *this and y are topology-incompatible or dimension-incompatible.
Warning
In order to obtain a proper widening operator, the template parameter Cert should be a finite convergence certificate for the base-level widening function widen_fun; otherwise, an extrapolation operator is obtained. For a description of the methods that should be provided by Cert, see BHRZ03_Certificate or H79_Certificate.
template<typename PSET>
template<typename Cert >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::collect_certificates ( std::map< Cert, size_type, typename Cert::Compare > &  cert_ms) const
private

Records in cert_ms the certificates for this set of polyhedra.

template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign ( const Pointset_Ask_Tell< PSET > &  y)

Assigns to *this the concatenation of *this and y.

The result is obtained by computing the pairwise concatenation of each polyhedron in *this with each polyhedron in y.

Definition at line 101 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Determinate< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim, and Parma_Polyhedra_Library::UNIVERSE.

101  {
102  Pointset_Ask_Tell& x = *this;
103  for (const_iterator yi = y.begin(), y_end = y.end(); yi != y_end; ++yi) {
104  Det_PSET ask(PSET(space_dim, UNIVERSE));
105  ask.concatenate_assign(yi->ask());
106  Det_PSET tell(PSET(space_dim, UNIVERSE));
107  tell.concatenate_assign(yi->tell());
108  x.sequence.push_back(Pair(ask, tell));
109  }
110  space_dim += y.space_dim;
111  if (x.normalized) {
112  x.normalized = y.normalized;
113  }
114  PPL_ASSERT_HEAVY(x.OK());
115 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
The universe element, i.e., the whole vector space.
template<typename PSET >
memory_size_type Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::external_memory_in_bytes ( ) const
inline

Returns a lower bound to the size in bytes of the memory managed by *this.

Definition at line 164 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::external_memory_in_bytes().

164  {
166 }
memory_size_type external_memory_in_bytes() const
Returns a lower bound to the size in bytes of the memory managed by *this.
template<typename PSET >
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_covers ( const Pointset_Ask_Tell< PSET > &  y) const
inline

Returns true if and only if *this geometrically covers y, i.e., if any point (in some element) of y is also a point (of some element) of *this.

Exceptions
std::invalid_argumentThrown if *this and y are topology-incompatible or dimension-incompatible.
Warning
This may be really expensive!

Definition at line 139 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_covers().

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_covers(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_equals().

139  {
140  const Pointset_Ask_Tell<NNC_Polyhedron> xx(*this);
142  return xx.geometrically_covers(yy);
143 }
template<>
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< NNC_Polyhedron >::geometrically_covers ( const Pointset_Ask_Tell< PSET > &  y) const
template<typename PSET >
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_equals ( const Pointset_Ask_Tell< PSET > &  y) const
inline

Returns true if and only if *this is geometrically equal to y, i.e., if (the elements of) *this and y contain the same set of points.

Exceptions
std::invalid_argumentThrown if *this and y are topology-incompatible or dimension-incompatible.
Warning
This may be really expensive!

Definition at line 148 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_covers().

148  {
149  const Pointset_Ask_Tell<NNC_Polyhedron> xx(*this);
151  return xx.geometrically_covers(yy) && yy.geometrically_covers(xx);
152 }
template<>
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< NNC_Polyhedron >::geometrically_equals ( const Pointset_Ask_Tell< PSET > &  y) const
inline

Definition at line 157 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::geometrically_covers().

157  {
158  const Pointset_Ask_Tell& x = *this;
159  return x.geometrically_covers(y) && y.geometrically_covers(x);
160 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
int32_t Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::hash_code ( ) const
inline

Returns a 32-bit hash code for *this.

If x and y are such that x == y, then x.hash_code() == y.hash_code().

Definition at line 176 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::hash_code_from_dimension().

176  {
178 }
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
int32_t hash_code_from_dimension(dimension_type dim)
Returns the hash code for space dimension dim.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::intersection_assign ( const Pointset_Ask_Tell< PSET > &  y)
inline

Assigns to *this the intersection of *this and y.

The result is obtained by intersecting each polyhedron in *this with each polyhedron in y and collecting all these intersections.

Definition at line 120 of file Pointset_Ask_Tell_inlines.hh.

120  {
121  Pointset_Ask_Tell& x = *this;
122  x.pairwise_apply_assign
123  (y,
124  Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign)));
125 }
static Binary_Operator_Assign_Lifter< Binary_Operator_Assign > lift_op_assign(Binary_Operator_Assign op_assign)
Helper function returning a Binary_Operator_Assign_Lifter object, also allowing for the deduction of ...
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET>
template<typename Cert >
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::is_cert_multiset_stabilizing ( const std::map< Cert, size_type, typename Cert::Compare > &  y_cert_ms) const
private

Returns true if and only if the current set of polyhedra is stabilizing with respect to the multiset of certificates y_cert_ms.

template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::m_swap ( Pointset_Ask_Tell< PSET > &  y)
inline

Swaps *this with y.

Definition at line 101 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim, and Parma_Polyhedra_Library::swap().

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::swap().

101  {
102  Pointset_Ask_Tell& x = *this;
103  x.Base::m_swap(y);
104  using std::swap;
105  swap(x.space_dim, y.space_dim);
106 }
void swap(CO_Tree &x, CO_Tree &y)
void swap(Pointset_Ask_Tell< PSET > &x, Pointset_Ask_Tell< PSET > &y)
Swaps x with y.
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
template<typename Partial_Function >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions ( const Partial_Function pfunc)

Remaps the dimensions of the vector space according to a partial function.

See also Polyhedron::map_space_dimensions.

Definition at line 236 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< D >::is_bottom(), Parma_Polyhedra_Library::Partial_Function::maps(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

236  {
237  Pointset_Ask_Tell& x = *this;
238  if (x.is_bottom()) {
239  dimension_type n = 0;
240  for (dimension_type i = x.space_dim; i-- > 0; ) {
241  dimension_type new_i;
242  if (pfunc.maps(i, new_i)) {
243  ++n;
244  }
245  }
246  x.space_dim = n;
247  }
248  else {
249  Sequence_iterator s_begin = x.sequence.begin();
250  for (Sequence_iterator si = s_begin,
251  s_end = x.sequence.end(); si != s_end; ++si) {
252  si->pointset().map_space_dimensions(pfunc);
253  }
254  x.space_dim = s_begin->pointset().space_dimension();
255  x.reduced = false;
256  }
257  PPL_ASSERT_HEAVY(x.OK());
258 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
dimension_type Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::max_space_dimension ( )
inlinestatic

Returns the maximum space dimension a Pointset_Ask_Tell<PSET> can handle.

Definition at line 48 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::max_space_dimension().

48  {
50 }
dimension_type max_space_dimension()
Returns the maximum space dimension this library can handle.
template<typename PSET >
bool Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK ( ) const

Checks if all the invariants are satisfied.

Definition at line 315 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< D >::begin(), Parma_Polyhedra_Library::Ask_Tell< D >::end(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dimension().

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraint(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_constraints(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_disjunct(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_embed(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_space_dimensions_and_project(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::ascii_load(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::concatenate_assign(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::Pointset_Ask_Tell(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_higher_space_dimensions(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_space_dimensions(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain().

315  {
316  const Pointset_Ask_Tell& x = *this;
317  for (const_iterator xi = x.begin(), x_end = x.end(); xi != x_end; ++xi) {
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) {
322 #ifndef NDEBUG
323  std::cerr << "Space dimension mismatch: is ("
324  << ask_i.space_dimension()
325  << " -> "
326  << tell_i.space_dimension()
327  << ") in an element of the sequence,\nshould be "
328  << x.space_dim << "."
329  << std::endl;
330 #endif
331  return false;
332  }
333  }
334  return x.Base::OK();
335 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET>
template<typename QH >
Pointset_Ask_Tell<PSET>& Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::operator= ( const Pointset_Ask_Tell< QH > &  y)
inline

Definition at line 111 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::swap().

111  {
112  Pointset_Ask_Tell& x = *this;
113  Pointset_Ask_Tell<PSET> pps(y);
114  swap(x, pps);
115  return x;
116 }
void swap(Pointset_Ask_Tell< PSET > &x, Pointset_Ask_Tell< PSET > &y)
Swaps x with y.
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
Pointset_Ask_Tell< PSET > & Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::operator= ( const Pointset_Ask_Tell< PSET > &  y)
inline

The assignment operator (*this and y can be dimension-incompatible).

Definition at line 92 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

92  {
93  Pointset_Ask_Tell& x = *this;
94  x.Base::operator=(y);
95  x.space_dim = y.space_dim;
96  return x;
97 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET>
template<typename QH >
Pointset_Ask_Tell& Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::operator= ( const Pointset_Ask_Tell< QH > &  y)

Assignment operator allowing a source powerset with elements of a different polyhedron kind (*this and y can be dimension-incompatible).

template<typename PSET>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::pairwise_reduce ( )

Assign to *this the result of (recursively) merging together the pairs of polyhedra whose poly-hull is the same as their set-theoretical union.

On exit, for all the pairs $\cP$, $\cQ$ of different polyhedra in *this, we have $\cP \uplus \cQ \neq \cP \union \cQ$.

template<>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< C_Polyhedron >::poly_difference_assign ( const Pointset_Ask_Tell< PSET > &  y)
inline

Definition at line 183 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::poly_difference_assign().

183  {
184  Pointset_Ask_Tell<NNC_Polyhedron> nnc_this(*this);
186  nnc_this.poly_difference_assign(nnc_y);
187  *this = nnc_this;
188 }
template<typename PSET>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::poly_difference_assign ( const Pointset_Ask_Tell< PSET > &  y)

Assigns to *this the difference of *this and y.

The result is obtained by computing the poly-difference of each polyhedron in *this with each polyhedron in y and collecting all these differences.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::poly_difference_assign().

template<>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< NNC_Polyhedron >::poly_difference_assign ( const Pointset_Ask_Tell< PSET > &  y)
template<typename PSET>
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::print ( ) const

Prints *this to std::cerr using operator<<.

template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_higher_space_dimensions ( dimension_type  new_dimension)

Removes the higher space dimensions so that the resulting space will have dimension new_dimension.

Exceptions
std::invalid_argumentThrown if new_dimensions is greater than the space dimension of *this.

Definition at line 218 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_higher_space_dimensions(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_higher_space_dimensions().

219  {
220  Pointset_Ask_Tell& x = *this;
221  if (new_dimension < x.space_dim) {
222  for (Sequence_iterator si = x.sequence.begin(),
223  s_end = x.sequence.end(); si != s_end; ++si) {
224  si->ask().pointset().remove_higher_space_dimensions(new_dimension);
225  si->tell().pointset().remove_higher_space_dimensions(new_dimension);
226  x.reduced = false;
227  }
228  x.space_dim = new_dimension;
229  PPL_ASSERT_HEAVY(x.OK());
230  }
231 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::remove_space_dimensions ( const Variables_Set vars)

Removes all the specified space dimensions.

Parameters
varsThe set of Variable objects corresponding to the space dimensions to be removed.
Exceptions
std::invalid_argumentThrown if *this is dimension-incompatible with one of the Variable objects contained in vars.

Definition at line 192 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Ask_Tell< D >::normalized, Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dim.

192  {
193  Pointset_Ask_Tell& x = *this;
194  Variables_Set::size_type num_removed = vars.size();
195  if (num_removed > 0) {
196  for (Sequence_iterator si = x.sequence.begin(),
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)) {
203  si = x.sequence.erase(si);
204  s_end = x.sequence.end();
205  }
206  else {
207  x.normalized = false;
208  ++si;
209  }
210  }
211  x.space_dim -= num_removed;
212  PPL_ASSERT_HEAVY(x.OK());
213  }
214 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
dimension_type Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::space_dimension ( ) const
inline

Returns the dimension of the vector space enclosing *this.

Definition at line 42 of file Pointset_Ask_Tell_inlines.hh.

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::add_disjunct(), and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK().

42  {
43  return space_dim;
44 }
dimension_type space_dim
The number of dimensions of the enclosing vector space.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::time_elapse_assign ( const Pointset_Ask_Tell< PSET > &  y)
inline

Assigns to *this the result of computing the time-elapse between *this and y.

The result is obtained by computing the pairwise time elapse of each polyhedron in *this with each polyhedron in y.

Definition at line 129 of file Pointset_Ask_Tell_inlines.hh.

129  {
130  Pointset_Ask_Tell& x = *this;
131  x.pairwise_apply_assign
132  (y,
133  Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign)));
134 }
static Binary_Operator_Assign_Lifter< Binary_Operator_Assign > lift_op_assign(Binary_Operator_Assign op_assign)
Helper function returning a Binary_Operator_Assign_Lifter object, also allowing for the deduction of ...
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
memory_size_type Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::total_memory_in_bytes ( ) const
inline

Returns a lower bound to the total size in bytes of the memory occupied by *this.

Definition at line 170 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::external_memory_in_bytes().

170  {
171  return sizeof(*this) + external_memory_in_bytes();
172 }
memory_size_type external_memory_in_bytes() const
Returns a lower bound to the size in bytes of the memory managed by *this.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain ( Variable  var)

Computes the cylindrification of *this with respect to space dimension var, assigning the result to *this.

Parameters
varThe space dimension that will be unconstrained.
Exceptions
std::invalid_argumentThrown if var is not a space dimension of *this.

Definition at line 143 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain().

Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain().

143  {
144  Pointset_Ask_Tell& x = *this;
145  for (Sequence_iterator si = x.sequence.begin(),
146  s_end = x.sequence.end(); si != s_end; ++si) {
147  si->pointset().unconstrain(var);
148  }
149  x.reduced = false;
150  PPL_ASSERT_HEAVY(x.OK());
151 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.
template<typename PSET >
void Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain ( const Variables_Set vars)

Computes the cylindrification of *this with respect to the set of space dimensions vars, assigning the result to *this.

Parameters
varsThe set of space dimension that will be unconstrained.
Exceptions
std::invalid_argumentThrown if *this is dimension-incompatible with one of the Variable objects contained in vars.

Definition at line 155 of file Pointset_Ask_Tell_templates.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::OK(), Parma_Polyhedra_Library::Ask_Tell< D >::sequence, and Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::unconstrain().

155  {
156  Pointset_Ask_Tell& x = *this;
157  for (Sequence_iterator si = x.sequence.begin(),
158  s_end = x.sequence.end(); si != s_end; ++si) {
159  si->pointset().unconstrain(vars);
160  }
161  x.reduced = false;
162  PPL_ASSERT_HEAVY(x.OK());
163 }
Pointset_Ask_Tell(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Ask_Tell.

Friends And Related Function Documentation

template<typename PSET >
bool check_containment ( const PSET &  ph,
const Pointset_Ask_Tell< PSET > &  ps 
)
related

Definition at line 193 of file Pointset_Ask_Tell_inlines.hh.

Referenced by Parma_Polyhedra_Library::Pointset_Powerset< PSET >::geometrically_covers().

193  {
194  const NNC_Polyhedron pph = NNC_Polyhedron(ph.constraints());
195  const Pointset_Ask_Tell<NNC_Polyhedron> pps(ps);
196  return check_containment(pph, pps);
197 }
bool check_containment(const PSET &ph, const Pointset_Ask_Tell< PSET > &ps)
bool check_containment ( const C_Polyhedron ph,
const Pointset_Ask_Tell< C_Polyhedron > &  ps 
)
related

Definition at line 202 of file Pointset_Ask_Tell_inlines.hh.

203  {
204  return check_containment(NNC_Polyhedron(ph),
206 }
bool check_containment(const PSET &ph, const Pointset_Ask_Tell< PSET > &ps)
template<typename PSET>
friend class Pointset_Ask_Tell< NNC_Polyhedron >
friend

Definition at line 447 of file Pointset_Ask_Tell_defs.hh.

template<typename PSET >
void swap ( Pointset_Ask_Tell< PSET > &  x,
Pointset_Ask_Tell< PSET > &  y 
)
related

Definition at line 211 of file Pointset_Ask_Tell_inlines.hh.

References Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::m_swap().

211  {
212  x.m_swap(y);
213 }
template<typename PSET >
void swap ( Pointset_Ask_Tell< PSET > &  x,
Pointset_Ask_Tell< PSET > &  y 
)
related

Swaps x with y.

Member Data Documentation


The documentation for this class was generated from the following files: