24 #include "ppl-config.h"
45 ns_end = new_sequence.end(); itr != ns_end; ++itr) {
46 const std::pair<NNC_Polyhedron, Pointset_Powerset<NNC_Polyhedron> >
50 std::copy(residues.begin(), residues.end(), back_inserter(tmp_sequence));
52 swap(tmp_sequence, new_sequence);
56 PPL_ASSERT_HEAVY(x.
OK());
83 i = ps.
begin(), ps_end = ps.
end(); i != ps_end; ++i) {
86 j = tmp.begin(); j != tmp.end(); ) {
89 j = tmp.drop_disjunct(j);
102 j = tmp.begin(); j != tmp.end(); ) {
108 const std::pair<NNC_Polyhedron, Pointset_Powerset<NNC_Polyhedron> >
110 new_disjuncts.upper_bound_assign(partition.second);
111 j = tmp.drop_disjunct(j);
114 tmp.upper_bound_assign(new_disjuncts);
123 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
131 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
138 const Grid gr_copy(gr);
150 if (c_modulus == 0) {
171 le -= c_inhomogeneous_term;
173 rem_assign(n, c_inhomogeneous_term, c_modulus);
178 for (i = c_modulus; i-- > 0; ) {
180 Grid gr_tmp(gr_copy);
193 std::pair<PPL::Grid, PPL::Pointset_Powerset<PPL::Grid> >
194 PPL::approximate_partition(
const Grid& p,
const Grid& q,
195 bool& finite_partition) {
197 finite_partition =
true;
205 p_congruences_end = p_congruences.
end();
206 i != p_congruences_end; ++i) {
207 if (!approximate_partition_aux(*i, gr, r)) {
208 finite_partition =
false;
210 return std::make_pair(gr, s);
213 return std::make_pair(gr, r);
218 PPL::check_containment(
const Grid& ph,
226 i = ps.
begin(), ps_end = ps.
end(); i != ps_end; ++i) {
227 const Grid& pi = i->pointset();
229 j = tmp.begin(); j != tmp.end(); ) {
230 const Grid& pj = j->pointset();
232 j = tmp.drop_disjunct(j);
245 j = tmp.begin(); j != tmp.end(); ) {
246 const Grid& pj = j->pointset();
251 bool finite_partition;
252 const std::pair<Grid, Pointset_Powerset<Grid> >
253 partition = approximate_partition(pi, pj, finite_partition);
262 if (!finite_partition) {
265 new_disjuncts.upper_bound_assign(partition.second);
266 j = tmp.drop_disjunct(j);
269 tmp.upper_bound_assign(new_disjuncts);
286 const Grid& gr_yi = yi->pointset();
289 ns_end = new_sequence.end(); itr != ns_end; ++itr) {
290 bool finite_partition;
291 const std::pair<Grid, Pointset_Powerset<Grid> > partition
292 = approximate_partition(gr_yi, itr->pointset(), finite_partition);
295 std::copy(residues.begin(), residues.end(), back_inserter(tmp_sequence));
297 swap(tmp_sequence, new_sequence);
301 PPL_ASSERT_HEAVY(x.
OK());
311 if (!check_containment(yi->pointset(), x)) {
323 :
Base(), space_dim(y.space_dimension()) {
326 y_end = y.
end(); i != y_end; ++i) {
331 PPL_ASSERT_HEAVY(x.
OK());
339 :
Base(), space_dim(y.space_dimension()) {
342 y_end = y.
end(); i != y_end; ++i) {
347 PPL_ASSERT_HEAVY(x.
OK());
355 :
Base(), space_dim(y.space_dimension()) {
358 y_end = y.
end(); i != y_end; ++i) {
368 PPL_ASSERT_HEAVY(x.
OK());
The empty element, i.e., the empty set.
Coefficient_traits::const_reference modulus() const
Returns a const reference to the modulus of *this.
void swap(CO_Tree &x, CO_Tree &y)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Sequence sequence
The sequence container holding powerset's elements.
const Congruence_System & congruences() const
Returns the system of congruences.
bool check_containment(const PSET &ph, const Pointset_Ask_Tell< PSET > &ps)
bool is_empty() const
Returns true if and only if *this is an empty polyhedron.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
bool is_disjoint_from(const Grid &y) const
Returns true if and only if *this and y are disjoint.
bool is_disjoint_from(const Polyhedron &y) const
Returns true if and only if *this and y are disjoint.
const_iterator end() const
Returns the past-the-end const_iterator.
expr_type expression() const
Partial read access to the (adapted) internal expression.
dimension_type num_equalities() const
Returns the number of equalities.
bool OK() const
Checks if all the invariants are satisfied.
Coefficient_traits::const_reference inhomogeneous_term() const
Returns the inhomogeneous term of *this.
void difference_assign(const Pointset_Powerset &y)
Assigns to *this an (a smallest) over-approximation as a powerset of the disjunct domain of the set-t...
A wrapper for PPL pointsets, providing them with a determinate constraint system interface, as defined in [Bag98].
iterator begin()
Returns an iterator pointing to the first disjunct, if *this is not empty; otherwise, returns the past-the-end iterator.
void omega_reduce() const
Drops from the sequence of disjuncts in *this all the non-maximal elements so that *this is non-redun...
The powerset construction on a base-level domain.
Complexity_Class
Complexity pseudo-classes.
bool geometrically_covers(const Pointset_Powerset &y) const
Returns true if and only if *this geometrically covers y, i.e., if any point (in some element) of y i...
std::pair< PSET, Pointset_Powerset< NNC_Polyhedron > > linear_partition(const PSET &p, const PSET &q)
Partitions q with respect to p.
bool reduced
If true, *this is Omega-reduced.
const Congruence_System & minimized_congruences() const
Returns the system of congruences in minimal form.
void rem_assign(GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
Pointset_Powerset(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a universe (top) or empty (bottom) Pointset_Powerset.
A not necessarily closed convex polyhedron.
dimension_type num_proper_congruences() const
Returns the number of proper congruences.
A closed convex polyhedron.
const_iterator begin() const
Returns the const_iterator pointing to the first congruence, if this is not empty; otherwise...
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
bool contains(const Grid &y) const
Returns true if and only if *this contains y.
iterator end()
Returns the past-the-end iterator.
A const_iterator on a sequence of read-only objects.
The powerset construction instantiated on PPL pointset domains.
The entire library is confined to this namespace.
An iterator over a system of congruences.
void add_disjunct(const PSET &ph)
Adds to *this the disjunct ph.
bool contains(const Polyhedron &y) const
Returns true if and only if *this contains y.
void add_congruence(const Congruence &cg)
Adds a copy of congruence cg to *this.
void swap(Affine_Space &x, Affine_Space &y)
Swaps x with y.
bool approximate_partition_aux(const PPL::Congruence &c, PPL::Grid &gr, PPL::Pointset_Powerset< PPL::Grid > &r)
Uses the congruence c to approximately partition the grid gr.
An iterator on a sequence of read-only objects.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool le(Boundary_Type type1, const T1 &x1, const Info1 &info1, Boundary_Type type2, const T2 &x2, const Info2 &info2)
bool is_empty() const
Returns true if and only if *this is an empty grid.
Base::Sequence_const_iterator Sequence_const_iterator