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

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

`#include <ppl.hh>`

## Public Member Functions

| Partially_Reduced_Product (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
| Builds an object having the specified properties. More...
| Partially_Reduced_Product (const Congruence_System &cgs)
| Builds a pair, copying a system of congruences. More...
| Partially_Reduced_Product (Congruence_System &cgs)
| Builds a pair, recycling a system of congruences. More...
| Partially_Reduced_Product (const Constraint_System &cs)
| Builds a pair, copying a system of constraints. More...
| Partially_Reduced_Product (Constraint_System &cs)
| Builds a pair, recycling a system of constraints. More...
| Partially_Reduced_Product (const C_Polyhedron &ph, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product, from a C polyhedron. More...
| Partially_Reduced_Product (const NNC_Polyhedron &ph, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product, from an NNC polyhedron. More...
| Partially_Reduced_Product (const Grid &gr, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product, from a grid. More...
template<typename Interval >
| Partially_Reduced_Product (const Box< Interval > &box, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product out of a box. More...
template<typename U >
| Partially_Reduced_Product (const BD_Shape< U > &bd, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product out of a BD shape. More...
template<typename U >
| Partially_Reduced_Product (const Octagonal_Shape< U > &os, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a product out of an octagonal shape. More...
| 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`. More...
Partially_Reduced_Product & | operator= (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. More...
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`. More...
bool | bounds_from_above (const Linear_Expression &expr) const
| Returns `true` if and only if `expr` is bounded in `*this`. More...
bool | bounds_from_below (const Linear_Expression &expr) const
| Returns `true` if and only if `expr` is bounded in `*this`. More...
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. More...
bool | maximize (const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum, Generator &g) 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. More...
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. More...
bool | minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum, Generator &g) 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. More...
bool | contains (const Partially_Reduced_Product &y) const
| Returns `true` if and only if each component of `*this` contains the corresponding component of `y`. More...
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`. More...
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`. More...
void | refine_with_constraint (const Constraint &c)
| Use the constraint `c` to refine `*this`. More...
void | add_congruence (const Congruence &cg)
| Adds a copy of congruence `cg` to `*this`. More...
void | refine_with_congruence (const Congruence &cg)
| Use the congruence `cg` to refine `*this`. More...
void | add_congruences (const Congruence_System &cgs)
| Adds a copy of the congruences in `cgs` to `*this`. More...
void | refine_with_congruences (const Congruence_System &cgs)
| Use the congruences in `cgs` to refine `*this`. More...
void | add_recycled_congruences (Congruence_System &cgs)
| Adds the congruences in `cgs` to *this. More...
void | add_constraints (const Constraint_System &cs)
| Adds a copy of the constraint system in `cs` to `*this`. More...
void | refine_with_constraints (const Constraint_System &cs)
| Use the constraints in `cs` to refine `*this`. More...
void | add_recycled_constraints (Constraint_System &cs)
| Adds the constraint system in `cs` to `*this`. More...
void | unconstrain (Variable var)
| Computes the cylindrification of `*this` with respect to space dimension `var`, assigning the result to `*this`. More...
void | unconstrain (const Variables_Set &vars)
| Computes the cylindrification of `*this` with respect to the set of space dimensions `vars`, assigning the result to `*this`. More...
void | intersection_assign (const Partially_Reduced_Product &y)
| Assigns to `*this` the componentwise intersection of `*this` and `y`. More...
void | upper_bound_assign (const Partially_Reduced_Product &y)
| Assigns to `*this` an upper bound of `*this` and `y` computed on the corresponding components. More...
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. More...
void | difference_assign (const Partially_Reduced_Product &y)
| Assigns to `*this` an approximation of the set-theoretic difference of `*this` and `y`. More...
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`. More...
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`. More...
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 , where is the relation symbol encoded by `relsym` (see also generalized affine relation.) More...
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 , where is the relation symbol encoded by `relsym`. (see also generalized affine relation.) More...
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 , where is the relation symbol encoded by `relsym`. (see also generalized affine relation.) More...
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 , where is the relation symbol encoded by `relsym`. (see also generalized affine relation.) More...
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 . More...
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 . More...
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.) More...
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`. More...
void | drop_some_non_integer_points (Complexity_Class complexity=ANY_COMPLEXITY)
| Possibly tightens `*this` by dropping some points with non-integer coordinates. More...
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`. More...
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. More...
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. More...
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. More...
void | remove_space_dimensions (const Variables_Set &vars)
| Removes all the specified dimensions from the vector space. More...
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`. More...
template<typename Partial_Function >
void | map_space_dimensions (const Partial_Function &pfunc)
| Remaps the dimensions of the vector space according to a partial function. More...
void | expand_space_dimension (Variable var, dimension_type m)
| Creates `m` copies of the space dimension corresponding to `var`. More...
void | fold_space_dimensions (const Variables_Set &vars, Variable dest)
| Folds the space dimensions in `vars` into `dest`. More...
Miscellaneous Member Functions
| ~Partially_Reduced_Product ()
| Destructor.
void | m_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`. More...

## 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.

## 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. More...
template<typename D1 , typename D2 , typename R >
void | swap (Partially_Reduced_Product< D1, D2, R > &x, Partially_Reduced_Product< D1, D2, R > &y)
| Swaps `x` with `y`. More...
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 pairwise equal. More...
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. More...
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)
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)
template<typename D1 , typename D2 , typename R >
std::ostream & | operator<< (std::ostream &s, const Partially_Reduced_Product< D1, D2, R > &dp)
template<typename D1 , typename D2 , typename R >
void | swap (Partially_Reduced_Product< D1, D2, R > &x, Partially_Reduced_Product< D1, D2, R > &y)

## 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 and are two abstract domains with concretization functions: and , respectively.

The partially reduced product , for any reduction class `R`, has a concretization where, if

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 is a direct product in one dimension where denotes the set of numbers that are integral multiples of 3 while 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 , 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 :
  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;

## 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`
| ) |  |

inlineexplicit

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.

template<typename D1 , typename D2 , typename R >

Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product | ( | const Congruence_System & | cgs | ) |

inlineexplicit

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.

template<typename D1 , typename D2 , typename R >

Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product | ( | Congruence_System & | cgs | ) |

inlineexplicit

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.

template<typename D1 , typename D2 , typename R >

Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product | ( | const Constraint_System & | cs | ) |

inlineexplicit

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.

template<typename D1 , typename D2 , typename R >

Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Partially_Reduced_Product | ( | Constraint_System & | cs | ) |

inlineexplicit

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.

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`
| ) |  |

inlineexplicit

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.

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`
| ) |  |

inlineexplicit

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.

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`
| ) |  |

inlineexplicit

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.

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.

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.

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.

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`
| ) |  |

inlineexplicit

Builds a conservative, upward approximation of `y`.

The complexity argument is ignored.

## Member Function Documentation

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.

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`.

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.

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.

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

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.

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 & | g
| ) |  | 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.

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`.
  g | When maximization succeeds, will be assigned the point or closure 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 `g` are left untouched.

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

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.

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 & | g
| ) |  | 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.

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`.
  g | When minimization succeeds, will be assigned the point or closure 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.

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.

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.

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.

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.

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.

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.

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.

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.

template<typename D1 , typename D2 , typename R >

void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences | ( | Congruence_System & | cgs | ) |

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.

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.

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.

template<typename D1 , typename D2 , typename R >

void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_constraints | ( | Constraint_System & | cs | ) |

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.

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`.

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`.

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.

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.

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.

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.

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`.

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`.

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 , where 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.

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 , where 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.

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 , where 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.

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 , where 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.

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 .

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`.

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 .

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`.

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.

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.

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`.

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`.

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()`.

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()`.

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()`.

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`.

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`.

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 be the represented function and be the value of `i`. If is defined in , then is assigned to `j` and `true` is returned. If is undefined in , then `false` is returned. This method is called at most times, where 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.

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 , with , and `var` has space dimension , then the -th space dimension is expanded to `m` new space dimensions , , , .

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 , with , `dest` has space dimension , `vars` is a set of variables whose maximum space dimension is also less than or equal to , and `dest` is not a member of `vars`, then the space dimensions corresponding to variables in `vars` are folded into the -th space dimension.

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()`.

## Friends And Related Function Documentation

template<typename D1 , typename D2 , typename R >

std::ostream & operator<< | ( | std::ostream & | s,
|  | const Partially_Reduced_Product< D1, D2, R > & | dp
| ) |  |

related

Output operator.

Writes a textual representation of `dp` on `s`.

template<typename D1 , typename D2 , typename R >

void swap | ( | Partially_Reduced_Product< D1, D2, R > & | x,
|  | Partially_Reduced_Product< D1, D2, R > & | y
| ) |  |

related

Swaps `x` with `y`.

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 pairwise equal.

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

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.

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

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

template<typename D1 , typename D2 , typename R >

std::ostream & operator<< | ( | std::ostream & | s,
|  | const Partially_Reduced_Product< D1, D2, R > & | dp
| ) |  |

related

template<typename D1 , typename D2 , typename R >

void swap | ( | Partially_Reduced_Product< D1, D2, R > & | x,
|  | Partially_Reduced_Product< D1, D2, R > & | y
| ) |  |

related

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

- ppl.hh