Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R > Class Template Reference
[C++ Language Interface]

The partially reduced product of two abstractions. More...

#include <Partially_Reduced_Product.defs.hh>

List of all members.

Public Member Functions

 Partially_Reduced_Product (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
 Builds an object having the specified properties.
 Partially_Reduced_Product (const Congruence_System &cgs)
 Builds a pair, copying a system of congruences.
 Partially_Reduced_Product (Congruence_System &cgs)
 Builds a pair, recycling a system of congruences.
 Partially_Reduced_Product (const Constraint_System &cs)
 Builds a pair, copying a system of constraints.
 Partially_Reduced_Product (Constraint_System &cs)
 Builds a pair, recycling a system of constraints.
 Partially_Reduced_Product (const C_Polyhedron &ph, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product, from a C polyhedron.
 Partially_Reduced_Product (const NNC_Polyhedron &ph, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product, from an NNC polyhedron.
 Partially_Reduced_Product (const Grid &gr, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product, from a grid.
template<typename Interval >
 Partially_Reduced_Product (const Box< Interval > &box, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product out of a box.
template<typename U >
 Partially_Reduced_Product (const BD_Shape< U > &bd, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product out of a BD shape.
template<typename U >
 Partially_Reduced_Product (const Octagonal_Shape< U > &os, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a product out of an octagonal shape.
 Partially_Reduced_Product (const Partially_Reduced_Product &y, Complexity_Class complexity=ANY_COMPLEXITY)
 Ordinary copy constructor.
template<typename E1 , typename E2 , typename S >
 Partially_Reduced_Product (const Partially_Reduced_Product< E1, E2, S > &y, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a conservative, upward approximation of y.
Partially_Reduced_Productoperator= (const Partially_Reduced_Product &y)
 The assignment operator. (*this and y can be dimension-incompatible.).
bool reduce () const
 Reduce.
Member Functions that Do Not Modify the Partially_Reduced_Product

dimension_type space_dimension () const
 Returns the dimension of the vector space enclosing *this.
dimension_type affine_dimension () const
 Returns the minimum affine dimension (see also grid affine dimension) of the components of *this.
const D1 & domain1 () const
 Returns a constant reference to the first of the pair.
const D2 & domain2 () const
 Returns a constant reference to the second of the pair.
Constraint_System constraints () const
 Returns a system of constraints which approximates *this.
Constraint_System minimized_constraints () const
 Returns a system of constraints which approximates *this, in reduced form.
Congruence_System congruences () const
 Returns a system of congruences which approximates *this.
Congruence_System minimized_congruences () const
 Returns a system of congruences which approximates *this, in reduced form.
Poly_Con_Relation relation_with (const Constraint &c) const
 Returns the relations holding between *this and c.
Poly_Con_Relation relation_with (const Congruence &cg) const
 Returns the relations holding between *this and cg.
Poly_Gen_Relation relation_with (const Generator &g) const
 Returns the relations holding between *this and g.
bool is_empty () const
 Returns true if and only if either of the components of *this are empty.
bool is_universe () const
 Returns true if and only if both of the components of *this are the universe.
bool is_topologically_closed () const
 Returns true if and only if both of the components of *this are topologically closed subsets of the vector space.
bool is_disjoint_from (const Partially_Reduced_Product &y) const
 Returns true if and only if *this and y are componentwise disjoint.
bool is_discrete () const
 Returns true if and only if a component of *this is discrete.
bool is_bounded () const
 Returns true if and only if a component of *this is bounded.
bool constrains (Variable var) const
 Returns true if and only if var is constrained in *this.
bool bounds_from_above (const Linear_Expression &expr) const
 Returns true if and only if expr is bounded in *this.
bool bounds_from_below (const Linear_Expression &expr) const
 Returns true if and only if expr is bounded in *this.
bool maximize (const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const
 Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed.
bool maximize (const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum, Generator &point) const
 Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value and a point where expr reaches it are computed.
bool minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const
 Returns true if and only if *this is not empty and expr is bounded from below i *this, in which case the infimum value is computed.
bool minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum, Generator &point) const
 Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value and a point where expr reaches it are computed.
bool contains (const Partially_Reduced_Product &y) const
 Returns true if and only if each component of *this contains the corresponding component of y.
bool strictly_contains (const Partially_Reduced_Product &y) const
 Returns true if and only if each component of *this strictly contains the corresponding component of y.
bool OK () const
 Checks if all the invariants are satisfied.
Space Dimension Preserving Member Functions that May Modify the Partially_Reduced_Product

void add_constraint (const Constraint &c)
 Adds constraint c to *this.
void refine_with_constraint (const Constraint &c)
 Use the constraint c to refine *this.
void add_congruence (const Congruence &cg)
 Adds a copy of congruence cg to *this.
void refine_with_congruence (const Congruence &cg)
 Use the congruence cg to refine *this.
void add_congruences (const Congruence_System &cgs)
 Adds a copy of the congruences in cgs to *this.
void refine_with_congruences (const Congruence_System &cgs)
 Use the congruences in cgs to refine *this.
void add_recycled_congruences (Congruence_System &cgs)
 Adds the congruences in cgs to *this.
void add_constraints (const Constraint_System &cs)
 Adds a copy of the constraint system in cs to *this.
void refine_with_constraints (const Constraint_System &cs)
 Use the constraints in cs to refine *this.
void add_recycled_constraints (Constraint_System &cs)
 Adds the constraint system in cs to *this.
void unconstrain (Variable var)
 Computes the cylindrification of *this with respect to space dimension var, assigning the result to *this.
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.
void intersection_assign (const Partially_Reduced_Product &y)
 Assigns to *this the componentwise intersection of *this and y.
void upper_bound_assign (const Partially_Reduced_Product &y)
 Assigns to *this an upper bound of *this and y computed on the corresponding components.
bool upper_bound_assign_if_exact (const Partially_Reduced_Product &y)
 Assigns to *this an upper bound of *this and y computed on the corresponding components. If it is exact on each of the components of *this, true is returned, otherwise false is returned.
void difference_assign (const Partially_Reduced_Product &y)
 Assigns to *this an approximation of the set-theoretic difference of *this and y.
void affine_image (Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the affine image of this under the function mapping variable var to the affine expression specified by expr and denominator.
void affine_preimage (Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the affine preimage of *this under the function mapping variable var to the affine expression specified by expr and denominator.
void generalized_affine_image (Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym (see also generalized affine relation.).
void generalized_affine_preimage (Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).
void generalized_affine_image (const Linear_Expression &lhs, Relation_Symbol relsym, const Linear_Expression &rhs)
 Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).
void generalized_affine_preimage (const Linear_Expression &lhs, Relation_Symbol relsym, const Linear_Expression &rhs)
 Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).
void bounded_affine_image (Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the image of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$.
void bounded_affine_preimage (Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the preimage of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$.
void time_elapse_assign (const Partially_Reduced_Product &y)
 Assigns to *this the result of computing the time-elapse between *this and y. (See also time-elapse.).
void topological_closure_assign ()
 Assigns to *this its topological closure.
void widening_assign (const Partially_Reduced_Product &y, unsigned *tp=NULL)
 Assigns to *this the result of computing the "widening" between *this and y.
void drop_some_non_integer_points (Complexity_Class complexity=ANY_COMPLEXITY)
 Possibly tightens *this by dropping some points with non-integer coordinates.
void drop_some_non_integer_points (const Variables_Set &vars, Complexity_Class complexity=ANY_COMPLEXITY)
 Possibly tightens *this by dropping some points with non-integer coordinates for the space dimensions corresponding to vars.
Member Functions that May Modify the Dimension of the Vector Space

void add_space_dimensions_and_embed (dimension_type m)
 Adds m new space dimensions and embeds the components of *this in the new vector space.
void add_space_dimensions_and_project (dimension_type m)
 Adds m new space dimensions and does not embed the components in the new vector space.
void concatenate_assign (const Partially_Reduced_Product &y)
 Assigns to the first (resp., second) component of *this the "concatenation" of the first (resp., second) components of *this and y, taken in this order. See also Concatenating Polyhedra.
void remove_space_dimensions (const Variables_Set &vars)
 Removes all the specified dimensions from the vector space.
void remove_higher_space_dimensions (dimension_type new_dimension)
 Removes the higher dimensions of the vector space so that the resulting space will have dimension new_dimension.
template<typename Partial_Function >
void map_space_dimensions (const Partial_Function &pfunc)
 Remaps the dimensions of the vector space according to a partial function.
void expand_space_dimension (Variable var, dimension_type m)
 Creates m copies of the space dimension corresponding to var.
void fold_space_dimensions (const Variables_Set &vars, Variable dest)
 Folds the space dimensions in vars into dest.
Miscellaneous Member Functions

 ~Partially_Reduced_Product ()
 Destructor.
void swap (Partially_Reduced_Product &y)
 Swaps *this with product y. (*this and y can be dimension-incompatible.).
void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this.
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this.
void print () const
 Prints *this to std::cerr using operator<<.
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.
memory_size_type total_memory_in_bytes () const
 Returns the total size in bytes of the memory occupied by *this.
memory_size_type external_memory_in_bytes () const
 Returns the size in bytes of the memory managed by *this.
int32_t hash_code () const
 Returns a 32-bit hash code for *this.

Static Public Member Functions

static dimension_type max_space_dimension ()
 Returns the maximum space dimension this product can handle.

Protected Types

typedef D1 Domain1
 The type of the first component.
typedef D2 Domain2
 The type of the second component.

Protected Member Functions

void clear_reduced_flag () const
 Clears the reduced flag.
void set_reduced_flag () const
 Sets the reduced flag.
bool is_reduced () const
 Return true if and only if the reduced flag is set.

Protected Attributes

D1 d1
 The first component.
D2 d2
 The second component.
bool reduced
 Flag to record whether the components are reduced with respect to each other and the reduction class.

Friends

bool operator== (const Partially_Reduced_Product< D1, D2, R > &x, const Partially_Reduced_Product< D1, D2, R > &y)
 Returns true if and only if the components of x and y are pairwise equal.
std::ostream & Parma_Polyhedra_Library::IO_Operators::operator<< (std::ostream &s, const Partially_Reduced_Product< D1, D2, R > &dp)

Related Functions

(Note that these are not member functions.)



template<typename D1 , typename D2 , typename R >
std::ostream & operator<< (std::ostream &s, const Partially_Reduced_Product< D1, D2, R > &dp)
 Output operator.
template<typename D1 , typename D2 , typename R >
bool operator!= (const Partially_Reduced_Product< D1, D2, R > &x, const Partially_Reduced_Product< D1, D2, R > &y)
 Returns true if and only if the components of x and y are not pairwise equal.
template<typename D1 , typename D2 , typename R >
void swap (Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R > &x, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R > &y)
 Specializes std::swap.

Detailed Description

template<typename D1, typename D2, typename R>
class Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >

The partially reduced product of two abstractions.

Warning:
At present, the supported instantiations for the two domain templates D1 and D2 are the simple pointset domains: C_Polyhedron, NNC_Polyhedron, Grid, Octagonal_Shape<T>, BD_Shape<T>, Box<T>.

An object of the class Partially_Reduced_Product<D1, D2, R> represents the (partially reduced) product of two pointset domains D1 and D2 where the form of any reduction is defined by the reduction class R.

Suppose $D_1$ and $D_2$ are two abstract domains with concretization functions: $\fund{\gamma_1}{D_1}{\Rset^n}$ and $\fund{\gamma_2}{D_2}{\Rset^n}$, respectively.

The partially reduced product $D = D_1 \times D_2$, for any reduction class R, has a concretization $\fund{\gamma}{D}{\Rset^n}$ where, if $d = (d_1, d_2) \in D$

\[ \gamma(d) = \gamma_1(d_1) \inters \gamma_2(d_2). \]

The operations are defined to be the result of applying the corresponding operations on each of the components provided the product is already reduced by the reduction method defined by R. In particular, if R is the No_Reduction<D1, D2> class, then the class Partially_Reduced_Product<D1, D2, R> domain is the direct product as defined in [CC79].

How the results on the components are interpreted and combined depend on the specific test. For example, the test for emptiness will first make sure the product is reduced (using the reduction method provided by R if it is not already known to be reduced) and then test if either component is empty; thus, if R defines no reduction between its components and $d = (G, P) \in (\Gset \times \Pset)$ is a direct product in one dimension where $G$ denotes the set of numbers that are integral multiples of 3 while $P$ denotes the set of numbers between 1 and 2, then an operation that tests for emptiness should return false. However, the test for the universe returns true if and only if the test is_universe() on both components returns true.

In all the examples it is assumed that the template R is the No_Reduction<D1, D2> class and that variables x and y are defined (where they are used) as follows:
  Variable x(0);
  Variable y(1);
Example 1
The following code builds a direct product of a Grid and NNC Polyhedron, corresponding to the positive even integer pairs in $\Rset^2$, given as a system of congruences:
  Congruence_System cgs;
  cgs.insert((x %= 0) / 2);
  cgs.insert((y %= 0) / 2);
  Partially_Reduced_Product<Grid, NNC_Polyhedron, No_Reduction<D1, D2> >
    dp(cgs);
  dp.add_constraint(x >= 0);
  dp.add_constraint(y >= 0);
Example 2
The following code builds the same product in $\Rset^2$:
  Partially_Reduced_Product<Grid, NNC_Polyhedron, No_Reduction<D1, D2> > dp(2);
  dp.add_constraint(x >= 0);
  dp.add_constraint(y >= 0);
  dp.add_congruence((x %= 0) / 2);
  dp.add_congruence((y %= 0) / 2);
Example 3
The following code will write "dp is empty":
  Partially_Reduced_Product<Grid, NNC_Polyhedron, No_Reduction<D1, D2> > dp(1);
  dp.add_congruence((x %= 0) / 2);
  dp.add_congruence((x %= 1) / 2);
  if (dp.is_empty())
    cout << "dp is empty." << endl;
  else
    cout << "dp is not empty." << endl;
Example 4
The following code will write "dp is not empty":
  Partially_Reduced_Product<Grid, NNC_Polyhedron, No_Reduction<D1, D2> > dp(1);
  dp.add_congruence((x %= 0) / 2);
  dp.add_constraint(x >= 1);
  dp.add_constraint(x <= 1);
  if (dp.is_empty())
    cout << "dp is empty." << endl;
  else
    cout << "dp is not empty." << endl;

Definition at line 412 of file Partially_Reduced_Product.defs.hh.


Member Typedef Documentation

template<typename D1, typename D2, typename R>
typedef D1 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Domain1 [protected]

The type of the first component.

Definition at line 1617 of file Partially_Reduced_Product.defs.hh.

template<typename D1, typename D2, typename R>
typedef D2 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Domain2 [protected]

The type of the second component.

Definition at line 1620 of file Partially_Reduced_Product.defs.hh.


Constructor & Destructor Documentation

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( dimension_type  num_dimensions = 0,
Degenerate_Element  kind = UNIVERSE 
) [inline, explicit]

Builds an object having the specified properties.

Parameters:
num_dimensions The number of dimensions of the vector space enclosing the pair;
kind Specifies whether a universe or an empty pair has to be built.
Exceptions:
std::length_error Thrown if num_dimensions exceeds the maximum allowed space dimension.

Definition at line 46 of file Partially_Reduced_Product.inlines.hh.

00048   : d1(num_dimensions, kind),
00049     d2(num_dimensions, kind) {
00050   set_reduced_flag();
00051 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Congruence_System cgs  )  [inline, explicit]

Builds a pair, copying a system of congruences.

The pair inherits the space dimension of the congruence system.

Parameters:
cgs The system of congruences to be approximated by the pair.
Exceptions:
std::length_error Thrown if num_dimensions exceeds the maximum allowed space dimension.

Definition at line 56 of file Partially_Reduced_Product.inlines.hh.

00057   : d1(ccgs), d2(ccgs) {
00058   clear_reduced_flag();
00059 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( Congruence_System cgs  )  [inline, explicit]

Builds a pair, recycling a system of congruences.

The pair inherits the space dimension of the congruence system.

Parameters:
cgs The system of congruences to be approximates by the pair. Its data-structures may be recycled to build the pair.
Exceptions:
std::length_error Thrown if num_dimensions exceeds the maximum allowed space dimension.

Definition at line 64 of file Partially_Reduced_Product.inlines.hh.

00065   : d1(const_cast<const Congruence_System&>(cgs)), d2(cgs) {
00066   clear_reduced_flag();
00067 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Constraint_System cs  )  [inline, explicit]

Builds a pair, copying a system of constraints.

The pair inherits the space dimension of the constraint system.

Parameters:
cs The system of constraints to be approximated by the pair.
Exceptions:
std::length_error Thrown if num_dimensions exceeds the maximum allowed space dimension.

Definition at line 72 of file Partially_Reduced_Product.inlines.hh.

00073   : d1(ccs), d2(ccs) {
00074   clear_reduced_flag();
00075 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( Constraint_System cs  )  [inline, explicit]

Builds a pair, recycling a system of constraints.

The pair inherits the space dimension of the constraint system.

Parameters:
cs The system of constraints to be approximated by the pair.
Exceptions:
std::length_error Thrown if the space dimension of cs exceeds the maximum allowed space dimension.

Definition at line 80 of file Partially_Reduced_Product.inlines.hh.

00081   : d1(const_cast<const Constraint_System&>(cs)), d2(cs) {
00082   clear_reduced_flag();
00083 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const C_Polyhedron ph,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline, explicit]

Builds a product, from a C polyhedron.

Builds a product containing ph using algorithms whose complexity does not exceed the one specified by complexity. If complexity is ANY_COMPLEXITY, then the built product is the smallest one containing ph. The product inherits the space dimension of the polyhedron.

Parameters:
ph The polyhedron to be approximated by the product.
complexity The complexity that will not be exceeded.
Exceptions:
std::length_error Thrown if the space dimension of ph exceeds the maximum allowed space dimension.

Definition at line 88 of file Partially_Reduced_Product.inlines.hh.

00090   : d1(ph, complexity), d2(ph, complexity) {
00091   set_reduced_flag();
00092 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const NNC_Polyhedron ph,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline, explicit]

Builds a product, from an NNC polyhedron.

Builds a product containing ph using algorithms whose complexity does not exceed the one specified by complexity. If complexity is ANY_COMPLEXITY, then the built product is the smallest one containing ph. The product inherits the space dimension of the polyhedron.

Parameters:
ph The polyhedron to be approximated by the product.
complexity The complexity that will not be exceeded.
Exceptions:
std::length_error Thrown if the space dimension of ph exceeds the maximum allowed space dimension.

Definition at line 97 of file Partially_Reduced_Product.inlines.hh.

00099   : d1(ph, complexity), d2(ph, complexity) {
00100   set_reduced_flag();
00101 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Grid gr,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline, explicit]

Builds a product, from a grid.

Builds a product containing gr. The product inherits the space dimension of the grid.

Parameters:
gr The grid to be approximated by the product.
complexity The complexity is ignored.
Exceptions:
std::length_error Thrown if the space dimension of gr exceeds the maximum allowed space dimension.

Definition at line 106 of file Partially_Reduced_Product.inlines.hh.

00107   : d1(gr), d2(gr) {
00108   set_reduced_flag();
00109 }

template<typename D1 , typename D2 , typename R >
template<typename Interval >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Box< Interval > &  box,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline]

Builds a product out of a box.

Builds a product containing box. The product inherits the space dimension of the box.

Parameters:
box The box representing the pair to be built.
complexity The complexity is ignored.
Exceptions:
std::length_error Thrown if the space dimension of box exceeds the maximum allowed space dimension.

Definition at line 115 of file Partially_Reduced_Product.inlines.hh.

00116   : d1(box), d2(box) {
00117   set_reduced_flag();
00118 }

template<typename D1 , typename D2 , typename R >
template<typename U >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const BD_Shape< U > &  bd,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline]

Builds a product out of a BD shape.

Builds a product containing bd. The product inherits the space dimension of the BD shape.

Parameters:
bd The BD shape representing the product to be built.
complexity The complexity is ignored.
Exceptions:
std::length_error Thrown if the space dimension of bd exceeds the maximum allowed space dimension.

Definition at line 124 of file Partially_Reduced_Product.inlines.hh.

00125   : d1(bd), d2(bd) {
00126   set_reduced_flag();
00127 }

template<typename D1 , typename D2 , typename R >
template<typename U >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Octagonal_Shape< U > &  os,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline]

Builds a product out of an octagonal shape.

Builds a product containing os. The product inherits the space dimension of the octagonal shape.

Parameters:
os The octagonal shape representing the product to be built.
complexity The complexity is ignored.
Exceptions:
std::length_error Thrown if the space dimension of os exceeds the maximum allowed space dimension.

Definition at line 133 of file Partially_Reduced_Product.inlines.hh.

00134   : d1(os), d2(os) {
00135   set_reduced_flag();
00136 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Partially_Reduced_Product< D1, D2, R > &  y,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline]

Ordinary copy constructor.

Definition at line 141 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.

00143   : d1(y.d1), d2(y.d2) {
00144   reduced = y.reduced;
00145 }

template<typename D1 , typename D2 , typename R >
template<typename E1 , typename E2 , typename S >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product ( const Partially_Reduced_Product< E1, E2, S > &  y,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline, explicit]

Builds a conservative, upward approximation of y.

The complexity argument is ignored.

Definition at line 151 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain1(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain2(), and Parma_Polyhedra_Library::swap().

00153   : d1(y.space_dimension()), d2(y.space_dimension()) {
00154   Partially_Reduced_Product<D1, D2, R> pg1(y.domain1(), complexity);
00155   Partially_Reduced_Product<D1, D2, R> pg2(y.domain2(), complexity);
00156   pg1.intersection_assign(pg2);
00157   swap(pg1);
00158   /* Even if y is reduced, the built product may not be reduced as
00159      the reduction method may have changed (i.e., S != R). */
00160   clear_reduced_flag();
00161 }

template<typename D1 , typename D2 , typename R >
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::~Partially_Reduced_Product (  )  [inline]

Destructor.

Definition at line 165 of file Partially_Reduced_Product.inlines.hh.

00165                                                                  {
00166 }


Member Function Documentation

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruence ( const Congruence cg  )  [inline]

Adds a copy of congruence cg to *this.

Exceptions:
std::invalid_argument Thrown if *this and congruence cg are dimension-incompatible.

Definition at line 397 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00397                                                                          {
00398   d1.add_congruence(cg);
00399   d2.add_congruence(cg);
00400   clear_reduced_flag();
00401 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruences ( const Congruence_System cgs  )  [inline]

Adds a copy of the congruences in cgs to *this.

Parameters:
cgs The congruence system to be added.
Exceptions:
std::invalid_argument Thrown if *this and cgs are dimension-incompatible.

Definition at line 432 of file Partially_Reduced_Product.inlines.hh.

00432                                               {
00433   d1.add_congruences(cgs);
00434   d2.add_congruences(cgs);
00435   clear_reduced_flag();
00436 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint ( const Constraint c  )  [inline]

Adds constraint c to *this.

Exceptions:
std::invalid_argument Thrown if *this and c are dimension-incompatible.

Definition at line 381 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00381                                                                         {
00382   d1.add_constraint(c);
00383   d2.add_constraint(c);
00384   clear_reduced_flag();
00385 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraints ( const Constraint_System cs  )  [inline]

Adds a copy of the constraint system in cs to *this.

Parameters:
cs The constraint system to be added.
Exceptions:
std::invalid_argument Thrown if *this and cs are dimension-incompatible.

Definition at line 414 of file Partially_Reduced_Product.inlines.hh.

00414                                              {
00415   d1.add_constraints(cs);
00416   d2.add_constraints(cs);
00417   clear_reduced_flag();
00418 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences ( Congruence_System cgs  )  [inline]

Adds the congruences in cgs to *this.

Parameters:
cgs The congruence system to be added that may be recycled.
Exceptions:
std::invalid_argument Thrown if *this and cs are dimension-incompatible.
Warning:
The only assumption that can be made about cgs upon successful or exceptional return is that it can be safely destroyed.

Definition at line 115 of file Partially_Reduced_Product.templates.hh.

00115                                                  {
00116   if (d1.can_recycle_congruence_systems()) {
00117     d2.refine_with_congruences(cgs);
00118     d1.add_recycled_congruences(cgs);
00119   }
00120   else
00121     if (d2.can_recycle_congruence_systems()) {
00122       d1.refine_with_congruences(cgs);
00123       d2.add_recycled_congruences(cgs);
00124     }
00125     else {
00126       d1.add_congruences(cgs);
00127       d2.add_congruences(cgs);
00128     }
00129   clear_reduced_flag();
00130 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_constraints ( Constraint_System cs  )  [inline]

Adds the constraint system in cs to *this.

Parameters:
cs The constraint system to be added that may be recycled.
Exceptions:
std::invalid_argument Thrown if *this and cs are dimension-incompatible.
Warning:
The only assumption that can be made about cs upon successful or exceptional return is that it can be safely destroyed.

Definition at line 95 of file Partially_Reduced_Product.templates.hh.

00095                                                 {
00096   if (d1.can_recycle_constraint_systems()) {
00097     d2.refine_with_constraints(cs);
00098     d1.add_recycled_constraints(cs);
00099   }
00100   else
00101     if (d2.can_recycle_constraint_systems()) {
00102       d1.refine_with_constraints(cs);
00103       d2.add_recycled_constraints(cs);
00104     }
00105     else {
00106       d1.add_constraints(cs);
00107       d2.add_constraints(cs);
00108     }
00109   clear_reduced_flag();
00110 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_embed ( dimension_type  m  )  [inline]

Adds m new space dimensions and embeds the components of *this in the new vector space.

Parameters:
m The number of dimensions to add.
Exceptions:
std::length_error Thrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension().

Definition at line 577 of file Partially_Reduced_Product.inlines.hh.

00577                                                  {
00578   d1.add_space_dimensions_and_embed(m);
00579   d2.add_space_dimensions_and_embed(m);
00580 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_project ( dimension_type  m  )  [inline]

Adds m new space dimensions and does not embed the components in the new vector space.

Parameters:
m The number of space dimensions to add.
Exceptions:
std::length_error Thrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension().

Definition at line 585 of file Partially_Reduced_Product.inlines.hh.

00585                                                    {
00586   d1.add_space_dimensions_and_project(m);
00587   d2.add_space_dimensions_and_project(m);
00588 }

template<typename D1 , typename D2 , typename R >
dimension_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension (  )  const [inline]

Returns the minimum affine dimension (see also grid affine dimension) of the components of *this.

Definition at line 189 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00189                                                              {
00190   reduce();
00191   const dimension_type d1_dim = d1.affine_dimension();
00192   const dimension_type d2_dim = d2.affine_dimension();
00193   return std::min(d1_dim, d2_dim);
00194 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_image ( Variable  var,
const Linear_Expression expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the affine image of this under the function mapping variable var to the affine expression specified by expr and denominator.

Parameters:
var The variable to which the affine expression is assigned;
expr The numerator of the affine expression;
denominator The denominator of the affine expression (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if expr and *this are dimension-incompatible or if var is not a space dimension of *this.

Definition at line 263 of file Partially_Reduced_Product.inlines.hh.

00265                                                               {
00266   d1.affine_image(var, expr, denominator);
00267   d2.affine_image(var, expr, denominator);
00268   clear_reduced_flag();
00269 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_preimage ( Variable  var,
const Linear_Expression expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the affine preimage of *this under the function mapping variable var to the affine expression specified by expr and denominator.

Parameters:
var The variable to which the affine expression is substituted;
expr The numerator of the affine expression;
denominator The denominator of the affine expression (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if expr and *this are dimension-incompatible or if var is not a space dimension of *this.

Definition at line 274 of file Partially_Reduced_Product.inlines.hh.

00276                                                                  {
00277   d1.affine_preimage(var, expr, denominator);
00278   d2.affine_preimage(var, expr, denominator);
00279   clear_reduced_flag();
00280 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump ( std::ostream &  s  )  const [inline]

Writes to s an ASCII representation of *this.

Definition at line 696 of file Partially_Reduced_Product.inlines.hh.

00696                                                                     {
00697   const char yes = '+';
00698   const char no = '-';
00699   s << "Partially_Reduced_Product\n";
00700   s << (reduced ? yes : no) << "reduced\n";
00701   s << "Domain 1:\n";
00702   d1.ascii_dump(s);
00703   s << "Domain 2:\n";
00704   d2.ascii_dump(s);
00705 }

template<typename D1, typename D2, typename R>
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump (  )  const

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

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load ( std::istream &  s  )  [inline]

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 434 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.

00434                                                               {
00435   const char yes = '+';
00436   const char no = '-';
00437   std::string str;
00438   if (!(s >> str) || str != "Partially_Reduced_Product")
00439     return false;
00440   if (!(s >> str)
00441       || (str[0] != yes && str[0] != no)
00442       || str.substr(1) != "reduced")
00443     return false;
00444   reduced = (str[0] == yes);
00445   return ((s >> str) && str == "Domain"
00446           && (s >> str) && str == "1:"
00447           && d1.ascii_load(s)
00448           && (s >> str) && str == "Domain"
00449           && (s >> str) && str == "2:"
00450           && d2.ascii_load(s));
00451 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_image ( Variable  var,
const Linear_Expression lb_expr,
const Linear_Expression ub_expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the image of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$.

Parameters:
var The variable updated by the affine relation;
lb_expr The numerator of the lower bounding affine expression;
ub_expr The numerator of the upper bounding affine expression;
denominator The (common) denominator for the lower and upper bounding affine expressions (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if lb_expr (resp., ub_expr) and *this are dimension-incompatible or if var is not a space dimension of *this.

Definition at line 332 of file Partially_Reduced_Product.inlines.hh.

00335                                                                       {
00336   d1.bounded_affine_image(var, lb_expr, ub_expr, denominator);
00337   d2.bounded_affine_image(var, lb_expr, ub_expr, denominator);
00338   clear_reduced_flag();
00339 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_preimage ( Variable  var,
const Linear_Expression lb_expr,
const Linear_Expression ub_expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the preimage of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$.

Parameters:
var The variable updated by the affine relation;
lb_expr The numerator of the lower bounding affine expression;
ub_expr The numerator of the upper bounding affine expression;
denominator The (common) denominator for the lower and upper bounding affine expressions (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if lb_expr (resp., ub_expr) and *this are dimension-incompatible or if var is not a space dimension of *this.

Definition at line 344 of file Partially_Reduced_Product.inlines.hh.

00347                                                                          {
00348   d1.bounded_affine_preimage(var, lb_expr, ub_expr, denominator);
00349   d2.bounded_affine_preimage(var, lb_expr, ub_expr, denominator);
00350   clear_reduced_flag();
00351 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_above ( const Linear_Expression expr  )  const [inline]

Returns true if and only if expr is bounded in *this.

This method is the same as bounds_from_below.

Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

Definition at line 538 of file Partially_Reduced_Product.inlines.hh.

00538                                                        {
00539   reduce();
00540   return d1.bounds_from_above(expr) || d2.bounds_from_above(expr);
00541 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_below ( const Linear_Expression expr  )  const [inline]

Returns true if and only if expr is bounded in *this.

This method is the same as bounds_from_above.

Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

Definition at line 546 of file Partially_Reduced_Product.inlines.hh.

00546                                                        {
00547   reduce();
00548   return d1.bounds_from_below(expr) || d2.bounds_from_below(expr);
00549 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag (  )  const [inline, protected]
template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::concatenate_assign ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

Assigns to the first (resp., second) component of *this the "concatenation" of the first (resp., second) components of *this and y, taken in this order. See also Concatenating Polyhedra.

Exceptions:
std::length_error Thrown if the concatenation would cause the vector space to exceed dimension max_space_dimension().

Definition at line 593 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced().

00593                                                        {
00594   d1.concatenate_assign(y.d1);
00595   d2.concatenate_assign(y.d2);
00596   if (!is_reduced() || !y.is_reduced())
00597     clear_reduced_flag();
00598 }

template<typename D1 , typename D2 , typename R >
Congruence_System Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::congruences (  )  const [inline]

Returns a system of congruences which approximates *this.

Definition at line 69 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Congruence_System::begin(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Congruence_System::end(), Parma_Polyhedra_Library::Congruence_System::insert(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00069                                                         {
00070   reduce();
00071   Congruence_System cgs = d2.congruences();
00072   const Congruence_System& cgs1 = d1.congruences();
00073   for (Congruence_System::const_iterator i = cgs1.begin(),
00074          cgs_end = cgs1.end(); i != cgs_end; ++i)
00075     cgs.insert(*i);
00076   return cgs;
00077 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constrains ( Variable  var  )  const [inline]

Returns true if and only if var is constrained in *this.

Exceptions:
std::invalid_argument Thrown if var is not a space dimension of *this.

Definition at line 553 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00553                                                                    {
00554   reduce();
00555   return d1.constrains(var) || d2.constrains(var);
00556 }

template<typename D1 , typename D2 , typename R >
Constraint_System Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constraints (  )  const [inline]

Returns a system of constraints which approximates *this.

Definition at line 38 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Constraint_System::begin(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Constraint_System::end(), Parma_Polyhedra_Library::Constraint_System::insert(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00038                                                         {
00039   reduce();
00040   Constraint_System cs = d2.constraints();
00041   const Constraint_System& cs1 = d1.constraints();
00042   for (Constraint_System::const_iterator i = cs1.begin(),
00043          cs_end = cs1.end(); i != cs_end; ++i)
00044     cs.insert(*i);
00045   return cs;
00046 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::contains ( const Partially_Reduced_Product< D1, D2, R > &  y  )  const [inline]

Returns true if and only if each component of *this contains the corresponding component of y.

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 645 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00645                                                    {
00646   reduce();
00647   y.reduce();
00648   return d1.contains(y.d1) && d2.contains(y.d2);
00649 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::difference_assign ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

Assigns to *this an approximation of the set-theoretic difference of *this and y.

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 225 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00225                                                       {
00226   reduce();
00227   y.reduce();
00228   d1.difference_assign(y.d1);
00229   d2.difference_assign(y.d2);
00230   clear_reduced_flag();
00231 }

template<typename D1 , typename D2 , typename R >
const D1 & Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain1 (  )  const [inline]
template<typename D1 , typename D2 , typename R >
const D2 & Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain2 (  )  const [inline]
template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::drop_some_non_integer_points ( const Variables_Set vars,
Complexity_Class  complexity = ANY_COMPLEXITY 
) [inline]

Possibly tightens *this by dropping some points with non-integer coordinates for the space dimensions corresponding to vars.

Parameters:
vars Points with non-integer coordinates for these variables/space-dimensions can be discarded.
complexity The maximal complexity of any algorithms used.
Note:
Currently there is no optimality guarantee, not even if complexity is ANY_COMPLEXITY.

Definition at line 460 of file Partially_Reduced_Product.inlines.hh.

00461                                                                  {
00462   reduce();
00463   d1.drop_some_non_integer_points(vars, complexity);
00464   d2.drop_some_non_integer_points(vars, complexity);
00465   clear_reduced_flag();
00466 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::drop_some_non_integer_points ( Complexity_Class  complexity = ANY_COMPLEXITY  )  [inline]

Possibly tightens *this by dropping some points with non-integer coordinates.

Parameters:
complexity The maximal complexity of any algorithms used.
Note:
Currently there is no optimality guarantee, not even if complexity is ANY_COMPLEXITY.

Definition at line 450 of file Partially_Reduced_Product.inlines.hh.

00450                                                           {
00451   reduce();
00452   d1.drop_some_non_integer_points(complexity);
00453   d2.drop_some_non_integer_points(complexity);
00454   clear_reduced_flag();
00455 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::expand_space_dimension ( Variable  var,
dimension_type  m 
) [inline]

Creates m copies of the space dimension corresponding to var.

Parameters:
var The variable corresponding to the space dimension to be replicated;
m The number of replicas to be created.
Exceptions:
std::invalid_argument Thrown if var does not correspond to a dimension of the vector space.
std::length_error Thrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension().

If *this has space dimension $n$, with $n > 0$, and var has space dimension $k \leq n$, then the $k$-th space dimension is expanded to m new space dimensions $n$, $n+1$, $\dots$, $n+m-1$.

Definition at line 628 of file Partially_Reduced_Product.inlines.hh.

00628                                                        {
00629   d1.expand_space_dimension(var, m);
00630   d2.expand_space_dimension(var, m);
00631 }

template<typename D1 , typename D2 , typename R >
memory_size_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes (  )  const [inline]

Returns the size in bytes of the memory managed by *this.

Definition at line 170 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::total_memory_in_bytes().

00170                                                                      {
00171   return d1.external_memory_in_bytes() + d2.external_memory_in_bytes();
00172 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::fold_space_dimensions ( const Variables_Set vars,
Variable  dest 
) [inline]

Folds the space dimensions in vars into dest.

Parameters:
vars The set of Variable objects corresponding to the space dimensions to be folded;
dest The variable corresponding to the space dimension that is the destination of the folding operation.
Exceptions:
std::invalid_argument Thrown if *this is dimension-incompatible with dest or with one of the Variable objects contained in vars. Also thrown if dest is contained in vars.

If *this has space dimension $n$, with $n > 0$, dest has space dimension $k \leq n$, vars is a set of variables whose maximum space dimension is also less than or equal to $n$, and dest is not a member of vars, then the space dimensions corresponding to variables in vars are folded into the $k$-th space dimension.

Definition at line 636 of file Partially_Reduced_Product.inlines.hh.

00637                                        {
00638   d1.fold_space_dimensions(vars, dest);
00639   d2.fold_space_dimensions(vars, dest);
00640 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_image ( const Linear_Expression lhs,
Relation_Symbol  relsym,
const Linear_Expression rhs 
) [inline]

Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).

Parameters:
lhs The left hand side affine expression;
relsym The relation symbol;
rhs The right hand side affine expression.
Exceptions:
std::invalid_argument Thrown if *this is dimension-incompatible with lhs or rhs or if *this is a C_Polyhedron and relsym is a strict relation symbol.

Definition at line 309 of file Partially_Reduced_Product.inlines.hh.

00311                                                          {
00312   d1.generalized_affine_image(lhs, relsym, rhs);
00313   d2.generalized_affine_image(lhs, relsym, rhs);
00314   clear_reduced_flag();
00315 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_image ( Variable  var,
Relation_Symbol  relsym,
const Linear_Expression expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym (see also generalized affine relation.).

Parameters:
var The left hand side variable of the generalized affine relation;
relsym The relation symbol;
expr The numerator of the right hand side affine expression;
denominator The denominator of the right hand side affine expression (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if expr and *this are dimension-incompatible or if var is not a space dimension of *this or if *this is a C_Polyhedron and relsym is a strict relation symbol.

Definition at line 285 of file Partially_Reduced_Product.inlines.hh.

00288                                                                           {
00289   d1.generalized_affine_image(var, relsym, expr, denominator);
00290   d2.generalized_affine_image(var, relsym, expr, denominator);
00291   clear_reduced_flag();
00292 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_preimage ( const Linear_Expression lhs,
Relation_Symbol  relsym,
const Linear_Expression rhs 
) [inline]

Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).

Parameters:
lhs The left hand side affine expression;
relsym The relation symbol;
rhs The right hand side affine expression.
Exceptions:
std::invalid_argument Thrown if *this is dimension-incompatible with lhs or rhs or if *this is a C_Polyhedron and relsym is a strict relation symbol.

Definition at line 320 of file Partially_Reduced_Product.inlines.hh.

00322                                                             {
00323   d1.generalized_affine_preimage(lhs, relsym, rhs);
00324   d2.generalized_affine_preimage(lhs, relsym, rhs);
00325   clear_reduced_flag();
00326 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_preimage ( Variable  var,
Relation_Symbol  relsym,
const Linear_Expression expr,
Coefficient_traits::const_reference  denominator = Coefficient_one() 
) [inline]

Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. (see also generalized affine relation.).

Parameters:
var The left hand side variable of the generalized affine relation;
relsym The relation symbol;
expr The numerator of the right hand side affine expression;
denominator The denominator of the right hand side affine expression (optional argument with default value 1).
Exceptions:
std::invalid_argument Thrown if denominator is zero or if expr and *this are dimension-incompatible or if var is not a space dimension of *this or if *this is a C_Polyhedron and relsym is a strict relation symbol.

Definition at line 297 of file Partially_Reduced_Product.inlines.hh.

00300                                                                              {
00301   d1.generalized_affine_preimage(var, relsym, expr, denominator);
00302   d2.generalized_affine_preimage(var, relsym, expr, denominator);
00303   clear_reduced_flag();
00304 }

template<typename D1 , typename D2 , typename R >
int32_t Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::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 709 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::space_dimension().

00709                                                       {
00710   return space_dimension() & 0x7fffffff;
00711 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::intersection_assign ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

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

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 216 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00216                                                         {
00217   d1.intersection_assign(y.d1);
00218   d2.intersection_assign(y.d2);
00219   clear_reduced_flag();
00220 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_bounded (  )  const [inline]

Returns true if and only if a component of *this is bounded.

Definition at line 530 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00530                                                        {
00531   reduce();
00532   return d1.is_bounded() || d2.is_bounded();
00533 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_discrete (  )  const [inline]

Returns true if and only if a component of *this is discrete.

Definition at line 523 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00523                                                         {
00524   reduce();
00525   return d1.is_discrete() || d2.is_discrete();
00526 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_disjoint_from ( const Partially_Reduced_Product< D1, D2, R > &  y  )  const [inline]

Returns true if and only if *this and y are componentwise disjoint.

Exceptions:
std::invalid_argument Thrown if x and y are dimension-incompatible.

Definition at line 515 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00515                                                            {
00516   reduce();
00517   y.reduce();
00518   return d1.is_disjoint_from(y.d1) || d2.is_disjoint_from(y.d2);
00519 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty (  )  const [inline]
template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced (  )  const [inline, protected]
template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_topologically_closed (  )  const [inline]

Returns true if and only if both of the components of *this are topologically closed subsets of the vector space.

Definition at line 507 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00507                                                                     {
00508   reduce();
00509   return d1.is_topologically_closed() && d2.is_topologically_closed();
00510 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_universe (  )  const [inline]

Returns true if and only if both of the components of *this are the universe.

Definition at line 501 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00501                                                         {
00502   return d1.is_universe() && d2.is_universe();
00503 }

template<typename D1 , typename D2 , typename R >
template<typename Partial_Function >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::map_space_dimensions ( const Partial_Function &  pfunc  )  [inline]

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

If pfunc maps only some of the dimensions of *this then the rest will be projected away.

If the highest dimension mapped to by pfunc is higher than the highest dimension in *this then the number of dimensions in this will be increased to the highest dimension mapped to by pfunc.

Parameters:
pfunc The partial function specifying the destiny of each space dimension.

The template class Partial_Function must provide the following methods.

      bool has_empty_codomain() const

returns true if and only if the represented partial function has an empty codomain (i.e., it is always undefined). The has_empty_codomain() method will always be called before the methods below. However, if has_empty_codomain() returns true, none of the functions below will be called.

      dimension_type max_in_codomain() const

returns the maximum value that belongs to the codomain of the partial function. The max_in_codomain() method is called at most once.

      bool maps(dimension_type i, dimension_type& j) const

Let $f$ be the represented function and $k$ be the value of i. If $f$ is defined in $k$, then $f(k)$ is assigned to j and true is returned. If $f$ is undefined in $k$, then false is returned. This method is called at most $n$ times, where $n$ is the dimension of the vector space enclosing *this.

The result is undefined if pfunc does not encode a partial function with the properties described in specification of the mapping operator.

Definition at line 620 of file Partially_Reduced_Product.inlines.hh.

00620                                                     {
00621   d1.map_space_dimensions(pfunc);
00622   d2.map_space_dimensions(pfunc);
00623 }

template<typename D1 , typename D2 , typename R >
dimension_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::max_space_dimension (  )  [inline, static]

Returns the maximum space dimension this product can handle.

Definition at line 37 of file Partially_Reduced_Product.inlines.hh.

00037                                                           {
00038   return (D1::max_space_dimension() < D2::max_space_dimension())
00039     ? D1::max_space_dimension()
00040     : D2::max_space_dimension();
00041 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::maximize ( const Linear_Expression expr,
Coefficient sup_n,
Coefficient sup_d,
bool &  maximum,
Generator point 
) const [inline]

Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value and a point where expr reaches it are computed.

Parameters:
expr The linear expression to be maximized subject to *this;
sup_n The numerator of the supremum value;
sup_d The denominator of the supremum value;
maximum true if the supremum value can be reached in this.
point When maximization succeeds, will be assigned a generator point where expr reaches its supremum value.
Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

If *this is empty or expr is not bounded by *this, false is returned and sup_n, sup_d, maximum and point are left untouched.

Definition at line 302 of file Partially_Reduced_Product.templates.hh.

References PPL_DIRTY_TEMP_COEFFICIENT.

00306                                  {
00307   reduce();
00308 
00309   if (is_empty())
00310     return false;
00311   PPL_ASSERT(reduced);
00312 
00313   PPL_DIRTY_TEMP_COEFFICIENT(sup1_n);
00314   PPL_DIRTY_TEMP_COEFFICIENT(sup1_d);
00315   PPL_DIRTY_TEMP_COEFFICIENT(sup2_n);
00316   PPL_DIRTY_TEMP_COEFFICIENT(sup2_d);
00317   bool maximum1;
00318   bool maximum2;
00319   Generator pnt1(point());
00320   Generator pnt2(point());
00321   bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1, pnt1);
00322   bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2, pnt2);
00323   // If neither is bounded from above, return false.
00324   if (!r1 && !r2)
00325     return false;
00326   // If only d2 is bounded from above, then use the values for d2.
00327   if (!r1) {
00328     sup_n = sup2_n;
00329     sup_d = sup2_d;
00330     maximum = maximum2;
00331     pnt = pnt2;
00332     return true;
00333   }
00334   // If only d1 is bounded from above, then use the values for d1.
00335   if (!r2) {
00336     sup_n = sup1_n;
00337     sup_d = sup1_d;
00338     maximum = maximum1;
00339     pnt = pnt1;
00340     return true;
00341   }
00342   // If both d1 and d2 are bounded from above, then use the minimum values.
00343   if (sup2_d * sup1_n >= sup1_d * sup2_n) {
00344     sup_n = sup1_n;
00345     sup_d = sup1_d;
00346     maximum = maximum1;
00347     pnt = pnt1;
00348   }
00349   else {
00350     sup_n = sup2_n;
00351     sup_d = sup2_d;
00352     maximum = maximum2;
00353     pnt = pnt2;
00354   }
00355   return true;
00356  }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::maximize ( const Linear_Expression expr,
Coefficient sup_n,
Coefficient sup_d,
bool &  maximum 
) const [inline]

Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed.

Parameters:
expr The linear expression to be maximized subject to *this;
sup_n The numerator of the supremum value;
sup_d The denominator of the supremum value;
maximum true if the supremum value can be reached in this.
Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

If *this is empty or expr is not bounded by *this, false is returned and sup_n, sup_d and maximum are left untouched.

Definition at line 199 of file Partially_Reduced_Product.templates.hh.

References PPL_DIRTY_TEMP_COEFFICIENT.

00202                                 {
00203   reduce();
00204 
00205   if (is_empty())
00206     return false;
00207 
00208   PPL_DIRTY_TEMP_COEFFICIENT(sup1_n);
00209   PPL_DIRTY_TEMP_COEFFICIENT(sup1_d);
00210   PPL_DIRTY_TEMP_COEFFICIENT(sup2_n);
00211   PPL_DIRTY_TEMP_COEFFICIENT(sup2_d);
00212   bool maximum1;
00213   bool maximum2;
00214   bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1);
00215   bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2);
00216   // If neither is bounded from above, return false.
00217   if (!r1 && !r2)
00218     return false;
00219   // If only d2 is bounded from above, then use the values for d2.
00220   if (!r1) {
00221     sup_n = sup2_n;
00222     sup_d = sup2_d;
00223     maximum = maximum2;
00224     return true;
00225   }
00226   // If only d1 is bounded from above, then use the values for d1.
00227   if (!r2) {
00228     sup_n = sup1_n;
00229     sup_d = sup1_d;
00230     maximum = maximum1;
00231     return true;
00232   }
00233   // If both d1 and d2 are bounded from above, then use the minimum values.
00234   if (sup2_d * sup1_n >= sup1_d * sup2_n) {
00235     sup_n = sup1_n;
00236     sup_d = sup1_d;
00237     maximum = maximum1;
00238   }
00239   else {
00240     sup_n = sup2_n;
00241     sup_d = sup2_d;
00242     maximum = maximum2;
00243   }
00244   return true;
00245  }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize ( const Linear_Expression expr,
Coefficient inf_n,
Coefficient inf_d,
bool &  minimum,
Generator point 
) const [inline]

Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value and a point where expr reaches it are computed.

Parameters:
expr The linear expression to be minimized subject to *this;
inf_n The numerator of the infimum value;
inf_d The denominator of the infimum value;
minimum true if the infimum value can be reached in this.
point When minimization succeeds, will be assigned a generator point where expr reaches its infimum value.
Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

If *this is empty or expr is not bounded from below, false is returned and inf_n, inf_d, minimum and point are left untouched.

Definition at line 361 of file Partially_Reduced_Product.templates.hh.

References PPL_DIRTY_TEMP_COEFFICIENT.

00365                                  {
00366   reduce();
00367 
00368   if (is_empty())
00369     return false;
00370   PPL_ASSERT(reduced);
00371 
00372   PPL_DIRTY_TEMP_COEFFICIENT(inf1_n);
00373   PPL_DIRTY_TEMP_COEFFICIENT(inf1_d);
00374   PPL_DIRTY_TEMP_COEFFICIENT(inf2_n);
00375   PPL_DIRTY_TEMP_COEFFICIENT(inf2_d);
00376   bool minimum1;
00377   bool minimum2;
00378   Generator pnt1(point());
00379   Generator pnt2(point());
00380   bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1, pnt1);
00381   bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2, pnt2);
00382   // If neither is bounded from below, return false.
00383   if (!r1 && !r2)
00384     return false;
00385   // If only d2 is bounded from below, then use the values for d2.
00386   if (!r1) {
00387     inf_n = inf2_n;
00388     inf_d = inf2_d;
00389     minimum = minimum2;
00390     pnt = pnt2;
00391     return true;
00392   }
00393   // If only d1 is bounded from below, then use the values for d1.
00394   if (!r2) {
00395     inf_n = inf1_n;
00396     inf_d = inf1_d;
00397     minimum = minimum1;
00398     pnt = pnt1;
00399     return true;
00400   }
00401   // If both d1 and d2 are bounded from below, then use the minimum values.
00402   if (inf2_d * inf1_n <= inf1_d * inf2_n) {
00403     inf_n = inf1_n;
00404     inf_d = inf1_d;
00405     minimum = minimum1;
00406     pnt = pnt1;
00407   }
00408   else {
00409     inf_n = inf2_n;
00410     inf_d = inf2_d;
00411     minimum = minimum2;
00412     pnt = pnt2;
00413   }
00414   return true;
00415  }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize ( const Linear_Expression expr,
Coefficient inf_n,
Coefficient inf_d,
bool &  minimum 
) const [inline]

Returns true if and only if *this is not empty and expr is bounded from below i *this, in which case the infimum value is computed.

Parameters:
expr The linear expression to be minimized subject to *this;
inf_n The numerator of the infimum value;
inf_d The denominator of the infimum value;
minimum true if the infimum value can be reached in this.
Exceptions:
std::invalid_argument Thrown if expr and *this are dimension-incompatible.

If *this is empty or expr is not bounded from below, false is returned and inf_n, inf_d and minimum are left untouched.

Definition at line 250 of file Partially_Reduced_Product.templates.hh.

References PPL_DIRTY_TEMP_COEFFICIENT.

00253                                 {
00254   reduce();
00255 
00256   if (is_empty())
00257     return false;
00258   PPL_ASSERT(reduced);
00259 
00260   PPL_DIRTY_TEMP_COEFFICIENT(inf1_n);
00261   PPL_DIRTY_TEMP_COEFFICIENT(inf1_d);
00262   PPL_DIRTY_TEMP_COEFFICIENT(inf2_n);
00263   PPL_DIRTY_TEMP_COEFFICIENT(inf2_d);
00264   bool minimum1;
00265   bool minimum2;
00266   bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1);
00267   bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2);
00268   // If neither is bounded from below, return false.
00269   if (!r1 && !r2)
00270     return false;
00271   // If only d2 is bounded from below, then use the values for d2.
00272   if (!r1) {
00273     inf_n = inf2_n;
00274     inf_d = inf2_d;
00275     minimum = minimum2;
00276     return true;
00277   }
00278   // If only d1 is bounded from below, then use the values for d1.
00279   if (!r2) {
00280     inf_n = inf1_n;
00281     inf_d = inf1_d;
00282     minimum = minimum1;
00283     return true;
00284   }
00285   // If both d1 and d2 are bounded from below, then use the minimum values.
00286   if (inf2_d * inf1_n <= inf1_d * inf2_n) {
00287     inf_n = inf1_n;
00288     inf_d = inf1_d;
00289     minimum = minimum1;
00290   }
00291   else {
00292     inf_n = inf2_n;
00293     inf_d = inf2_d;
00294     minimum = minimum2;
00295   }
00296   return true;
00297  }

template<typename D1 , typename D2 , typename R >
Congruence_System Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_congruences (  )  const [inline]

Returns a system of congruences which approximates *this, in reduced form.

Definition at line 81 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Congruence_System::begin(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Congruence_System::end(), Parma_Polyhedra_Library::Congruence_System::insert(), Parma_Polyhedra_Library::Grid::minimized_congruences(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00081                                                                   {
00082   reduce();
00083   Congruence_System cgs = d2.congruences();
00084   const Congruence_System& cgs1 = d1.congruences();
00085   for (Congruence_System::const_iterator i = cgs1.begin(),
00086          cgs_end = cgs1.end(); i != cgs_end; ++i)
00087     cgs.insert(*i);
00088   Grid gr(cgs);
00089   return gr.minimized_congruences();
00090 }

template<typename D1 , typename D2 , typename R >
Constraint_System Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_constraints (  )  const [inline]

Returns a system of constraints which approximates *this, in reduced form.

Definition at line 50 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Constraint_System::begin(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Constraint_System::end(), Parma_Polyhedra_Library::Constraint_System::has_strict_inequalities(), Parma_Polyhedra_Library::Constraint_System::insert(), Parma_Polyhedra_Library::Polyhedron::minimized_constraints(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00050                                                                   {
00051   reduce();
00052   Constraint_System cs = d2.constraints();
00053   const Constraint_System& cs1 = d1.constraints();
00054   for (Constraint_System::const_iterator i = cs1.begin(),
00055          cs_end = cs1.end(); i != cs_end; ++i)
00056     cs.insert(*i);
00057   if (cs.has_strict_inequalities()) {
00058     NNC_Polyhedron ph(cs);
00059     return ph.minimized_constraints();
00060   }
00061   else {
00062     C_Polyhedron ph(cs);
00063     return ph.minimized_constraints();
00064   }
00065 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK (  )  const [inline]

Checks if all the invariants are satisfied.

Definition at line 419 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.

00419                                                {
00420   if (reduced) {
00421     Partially_Reduced_Product<D1, D2, R> pd1 = *this;
00422     Partially_Reduced_Product<D1, D2, R> pd2 = *this;
00423     /* Force pd1 reduction */
00424     pd1.clear_reduced_flag();
00425     pd1.reduce();
00426     if (pd1 != pd2)
00427       return false;
00428   }
00429   return d1.OK() && d2.OK();
00430 }

template<typename D1 , typename D2 , typename R >
Partially_Reduced_Product< D1, D2, R > & Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::operator= ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

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

Definition at line 471 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.

00471                                               {
00472   d1 = y.d1;
00473   d2 = y.d2;
00474   reduced = y.reduced;
00475   return *this;
00476 }

template<typename D1, typename D2, typename R>
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::print (  )  const

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

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce (  )  const [inline]

Reduce.

Definition at line 663 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::set_reduced_flag().

Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constrains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::difference_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain1(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain2(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_bounded(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_discrete(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_disjoint_from(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_topologically_closed(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::strictly_contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::time_elapse_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign_if_exact(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::widening_assign().

00663                                                    {
00664   Partially_Reduced_Product& dp
00665     = const_cast<Partially_Reduced_Product&>(*this);
00666   if (dp.is_reduced())
00667     return false;
00668   R r;
00669   r.product_reduce(dp.d1, dp.d2);
00670   set_reduced_flag();
00671   return true;
00672 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruence ( const Congruence cg  )  [inline]

Use the congruence cg to refine *this.

Parameters:
cg The congruence to be used for refinement.
Exceptions:
std::invalid_argument Thrown if *this and cg are dimension-incompatible.

Definition at line 405 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00405                                                                                  {
00406   d1.refine_with_congruence(cg);
00407   d2.refine_with_congruence(cg);
00408   clear_reduced_flag();
00409 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruences ( const Congruence_System cgs  )  [inline]

Use the congruences in cgs to refine *this.

Parameters:
cgs The congruences to be used for refinement.
Exceptions:
std::invalid_argument Thrown if *this and cgs are dimension-incompatible.

Definition at line 441 of file Partially_Reduced_Product.inlines.hh.

00441                                                       {
00442   d1.refine_with_congruences(cgs);
00443   d2.refine_with_congruences(cgs);
00444   clear_reduced_flag();
00445 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint ( const Constraint c  )  [inline]

Use the constraint c to refine *this.

Parameters:
c The constraint to be used for refinement.
Exceptions:
std::invalid_argument Thrown if *this and c are dimension-incompatible.

Definition at line 389 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00389                                                                                 {
00390   d1.refine_with_constraint(c);
00391   d2.refine_with_constraint(c);
00392   clear_reduced_flag();
00393 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraints ( const Constraint_System cs  )  [inline]

Use the constraints in cs to refine *this.

Parameters:
cs The constraints to be used for refinement.
Exceptions:
std::invalid_argument Thrown if *this and cs are dimension-incompatible.

Definition at line 423 of file Partially_Reduced_Product.inlines.hh.

00423                                                      {
00424   d1.refine_with_constraints(cs);
00425   d2.refine_with_constraints(cs);
00426   clear_reduced_flag();
00427 }

template<typename D1 , typename D2 , typename R >
Poly_Gen_Relation Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::relation_with ( const Generator g  )  const [inline]

Returns the relations holding between *this and g.

Definition at line 135 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Poly_Gen_Relation::nothing(), and Parma_Polyhedra_Library::Poly_Gen_Relation::subsumes().

00135                                         {
00136   reduce();
00137   if (Poly_Gen_Relation::nothing() == d1.relation_with(g)
00138       || Poly_Gen_Relation::nothing() == d2.relation_with(g))
00139     return Poly_Gen_Relation::nothing();
00140   else
00141     return Poly_Gen_Relation::subsumes();
00142 }

template<typename D1 , typename D2 , typename R >
Poly_Con_Relation Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::relation_with ( const Congruence cg  )  const [inline]

Returns the relations holding between *this and cg.

Definition at line 173 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Poly_Con_Relation::implies(), Parma_Polyhedra_Library::Poly_Con_Relation::is_disjoint(), Parma_Polyhedra_Library::Poly_Con_Relation::is_included(), Parma_Polyhedra_Library::Poly_Con_Relation::nothing(), and Parma_Polyhedra_Library::Poly_Con_Relation::saturates().

00173                                           {
00174   reduce();
00175   Poly_Con_Relation relation1 = d1.relation_with(cg);
00176   Poly_Con_Relation relation2 = d2.relation_with(cg);
00177 
00178   Poly_Con_Relation result = Poly_Con_Relation::nothing();
00179 
00180   if (relation1.implies(Poly_Con_Relation::is_included()))
00181     result = result && Poly_Con_Relation::is_included();
00182   else if (relation2.implies(Poly_Con_Relation::is_included()))
00183     result = result && Poly_Con_Relation::is_included();
00184   if (relation1.implies(Poly_Con_Relation::saturates()))
00185     result = result && Poly_Con_Relation::saturates();
00186   else if (relation2.implies(Poly_Con_Relation::saturates()))
00187     result = result && Poly_Con_Relation::saturates();
00188   if (relation1.implies(Poly_Con_Relation::is_disjoint()))
00189     result = result && Poly_Con_Relation::is_disjoint();
00190   else if (relation2.implies(Poly_Con_Relation::is_disjoint()))
00191     result = result && Poly_Con_Relation::is_disjoint();
00192 
00193   return result;
00194 }

template<typename D1 , typename D2 , typename R >
Poly_Con_Relation Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::relation_with ( const Constraint c  )  const [inline]

Returns the relations holding between *this and c.

Definition at line 147 of file Partially_Reduced_Product.templates.hh.

References Parma_Polyhedra_Library::Poly_Con_Relation::implies(), Parma_Polyhedra_Library::Poly_Con_Relation::is_disjoint(), Parma_Polyhedra_Library::Poly_Con_Relation::is_included(), Parma_Polyhedra_Library::Poly_Con_Relation::nothing(), and Parma_Polyhedra_Library::Poly_Con_Relation::saturates().

00147                                          {
00148   reduce();
00149   Poly_Con_Relation relation1 = d1.relation_with(c);
00150   Poly_Con_Relation relation2 = d2.relation_with(c);
00151 
00152   Poly_Con_Relation result = Poly_Con_Relation::nothing();
00153 
00154   if (relation1.implies(Poly_Con_Relation::is_included()))
00155     result = result && Poly_Con_Relation::is_included();
00156   else if (relation2.implies(Poly_Con_Relation::is_included()))
00157     result = result && Poly_Con_Relation::is_included();
00158   if (relation1.implies(Poly_Con_Relation::saturates()))
00159     result = result && Poly_Con_Relation::saturates();
00160   else if (relation2.implies(Poly_Con_Relation::saturates()))
00161     result = result && Poly_Con_Relation::saturates();
00162   if (relation1.implies(Poly_Con_Relation::is_disjoint()))
00163     result = result && Poly_Con_Relation::is_disjoint();
00164   else if (relation2.implies(Poly_Con_Relation::is_disjoint()))
00165     result = result && Poly_Con_Relation::is_disjoint();
00166 
00167   return result;
00168 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_higher_space_dimensions ( dimension_type  new_dimension  )  [inline]

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

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

Definition at line 611 of file Partially_Reduced_Product.inlines.hh.

00611                                                              {
00612   d1.remove_higher_space_dimensions(new_dimension);
00613   d2.remove_higher_space_dimensions(new_dimension);
00614 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_space_dimensions ( const Variables_Set vars  )  [inline]

Removes all the specified dimensions from the vector space.

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

Definition at line 603 of file Partially_Reduced_Product.inlines.hh.

00603                                                    {
00604   d1.remove_space_dimensions(vars);
00605   d2.remove_space_dimensions(vars);
00606 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::set_reduced_flag (  )  const [inline, protected]

Sets the reduced flag.

Definition at line 688 of file Partially_Reduced_Product.inlines.hh.

Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00688                                                              {
00689   const_cast<Partially_Reduced_Product&>(*this).reduced = true;
00690 }

template<typename D1 , typename D2 , typename R >
dimension_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::space_dimension (  )  const [inline]

Returns the dimension of the vector space enclosing *this.

Definition at line 182 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

Referenced by Parma_Polyhedra_Library::Box< ITV >::Box(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::hash_code().

00182                                                             {
00183   PPL_ASSERT(d1.space_dimension() == d2.space_dimension());
00184   return d1.space_dimension();
00185 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::strictly_contains ( const Partially_Reduced_Product< D1, D2, R > &  y  )  const [inline]

Returns true if and only if each component of *this strictly contains the corresponding component of y.

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 654 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00654                                                             {
00655   reduce();
00656   y.reduce();
00657   return (d1.contains(y.d1) && d2.strictly_contains(y.d2))
00658     || (d2.contains(y.d2) && d1.strictly_contains(y.d1));
00659 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap ( Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]
template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::time_elapse_assign ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

Assigns to *this the result of computing the time-elapse between *this and y. (See also time-elapse.).

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 356 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00356                                                        {
00357   reduce();
00358   y.reduce();
00359   d1.time_elapse_assign(y.d1);
00360   d2.time_elapse_assign(y.d2);
00361   PPL_ASSERT_HEAVY(OK());
00362 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::topological_closure_assign (  )  [inline]

Assigns to *this its topological closure.

Definition at line 366 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.

00366                                                                  {
00367   d1.topological_closure_assign();
00368   d2.topological_closure_assign();
00369 }

template<typename D1 , typename D2 , typename R >
memory_size_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::total_memory_in_bytes (  )  const [inline]

Returns the total size in bytes of the memory occupied by *this.

Definition at line 176 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes().

00176                                                                   {
00177   return sizeof(*this) + external_memory_in_bytes();
00178 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain ( const Variables_Set vars  )  [inline]

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

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

Definition at line 207 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00207                                                                            {
00208   reduce();
00209   d1.unconstrain(vars);
00210   d2.unconstrain(vars);
00211 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain ( Variable  var  )  [inline]

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

Parameters:
var The space dimension that will be unconstrained.
Exceptions:
std::invalid_argument Thrown if var is not a space dimension of *this.

Definition at line 199 of file Partially_Reduced_Product.inlines.hh.

00199                                 {
00200   reduce();
00201   d1.unconstrain(var);
00202   d2.unconstrain(var);
00203 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

Assigns to *this an upper bound of *this and y computed on the corresponding components.

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 236 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00236                                                        {
00237   reduce();
00238   y.reduce();
00239   d1.upper_bound_assign(y.d1);
00240   d2.upper_bound_assign(y.d2);
00241 }

template<typename D1 , typename D2 , typename R >
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign_if_exact ( const Partially_Reduced_Product< D1, D2, R > &  y  )  [inline]

Assigns to *this an upper bound of *this and y computed on the corresponding components. If it is exact on each of the components of *this, true is returned, otherwise false is returned.

Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 246 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), and Parma_Polyhedra_Library::swap().

00246                                                                 {
00247   reduce();
00248   y.reduce();
00249   D1 d1_copy = d1;
00250   bool ub_exact = d1_copy.upper_bound_assign_if_exact(y.d1);
00251   if (!ub_exact)
00252     return false;
00253   ub_exact = d2.upper_bound_assign_if_exact(y.d2);
00254   if (!ub_exact)
00255     return false;
00256   std::swap(d1,d1_copy);
00257   return true;
00258 }

template<typename D1 , typename D2 , typename R >
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::widening_assign ( const Partially_Reduced_Product< D1, D2, R > &  y,
unsigned *  tp = NULL 
) [inline]

Assigns to *this the result of computing the "widening" between *this and y.

This widening uses either the congruence or generator systems depending on which of the systems describing x and y are up to date and minimized.

Parameters:
y A product that must be contained in *this;
tp An optional pointer to an unsigned variable storing the number of available tokens (to be used when applying the widening with tokens delay technique).
Exceptions:
std::invalid_argument Thrown if *this and y are dimension-incompatible.

Definition at line 561 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().

00562                                 {
00563   // FIXME(0.10.1): In general this is _NOT_ a widening since the reduction
00564   //        may mean that the sequence does not satisfy the ascending
00565   //        chain condition.
00566   //        However, for the direct, smash and constraints product
00567   //        it may be ok - but this still needs checking.
00568   reduce();
00569   y.reduce();
00570   d1.widening_assign(y.d1, tp);
00571   d2.widening_assign(y.d2, tp);
00572 }


Friends And Related Function Documentation

template<typename D1 , typename D2 , typename R >
bool operator!= ( const Partially_Reduced_Product< D1, D2, R > &  x,
const Partially_Reduced_Product< D1, D2, R > &  y 
) [related]

Returns true if and only if the components of x and y are not pairwise equal.

Note that x and y may be dimension-incompatible: in those cases, the value true is returned.

Definition at line 726 of file Partially_Reduced_Product.inlines.hh.

00727                                                           {
00728   return !(x == y);
00729 }

template<typename D1 , typename D2 , typename R >
std::ostream & operator<< ( std::ostream &  s,
const Partially_Reduced_Product< D1, D2, R > &  pd 
) [related]

Output operator.

Writes a textual representation of dp on s.

Definition at line 734 of file Partially_Reduced_Product.inlines.hh.

00734                                                                                       {
00735   return s << "Domain 1:\n"
00736            << pd.d1
00737            << "Domain 2:\n"
00738            << pd.d2;
00739 }

template<typename D1, typename D2, typename R>
bool operator== ( const Partially_Reduced_Product< D1, D2, R > &  x,
const Partially_Reduced_Product< D1, D2, R > &  y 
) [friend]

Returns true if and only if the components of x and y are pairwise equal.

Note that x and y may be dimension-incompatible: in those cases, the value false is returned.

Definition at line 716 of file Partially_Reduced_Product.inlines.hh.

00717                                                           {
00718   x.reduce();
00719   y.reduce();
00720   return x.d1 == y.d1 && x.d2 == y.d2;
00721 }

template<typename D1, typename D2, typename R>
std::ostream& Parma_Polyhedra_Library::IO_Operators::operator<< ( std::ostream &  s,
const Partially_Reduced_Product< D1, D2, R > &  dp 
) [friend]
template<typename D1 , typename D2 , typename R >
void swap ( Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R > &  x,
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R > &  y 
) [related]

Specializes std::swap.

Definition at line 804 of file Partially_Reduced_Product.inlines.hh.

References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap().

00805                                                                           {
00806   x.swap(y);
00807 }


Member Data Documentation

template<typename D1, typename D2, typename R>
D1 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1 [protected]

The first component.

Definition at line 1623 of file Partially_Reduced_Product.defs.hh.

Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::concatenate_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constrains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::difference_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain1(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::intersection_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_bounded(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_discrete(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_disjoint_from(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_topologically_closed(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_universe(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::operator=(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::space_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::strictly_contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::time_elapse_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::topological_closure_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign_if_exact(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::widening_assign().

template<typename D1, typename D2, typename R>
D2 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2 [protected]

The second component.

Definition at line 1626 of file Partially_Reduced_Product.defs.hh.

Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::concatenate_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constrains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::difference_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain2(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::intersection_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_bounded(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_discrete(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_disjoint_from(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_topologically_closed(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_universe(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimized_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::operator=(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::space_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::strictly_contains(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::time_elapse_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::topological_closure_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::upper_bound_assign_if_exact(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::widening_assign().

template<typename D1, typename D2, typename R>
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced [protected]

The documentation for this class was generated from the following files:
Generated on Sun Feb 27 16:20:29 2011 for PPL by  doxygen 1.6.3