#include <Partially_Reduced_Product.defs.hh>
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_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. | |
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 &to_be_unconstrained) |
Computes the cylindrification of *this with respect to the set of space dimensions to_be_unconstrained , 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 ![]() ![]() 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 ![]() ![]() 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 ![]() ![]() 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 ![]() ![]() 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 ![]() | |
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 ![]() | |
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 . | |
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 and Concatenating Grids. | |
void | remove_space_dimensions (const Variables_Set &to_be_removed) |
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 &to_be_folded, Variable var) |
Folds the space dimensions in to_be_folded into var . | |
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 () |
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 & | operator<< (std::ostream &s, const Partially_Reduced_Product< D1, D2, R > &dp) |
Output operator. | |
Related Functions | |
(Note that these are not member functions.) | |
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 . |
D1
and D2
are the simple pointset domains: C_Polyhedron
, NNC_Polyhedron
, Grid
, Octagonal_Shape<T>
, BD_Shape<T>
, Box<T>
.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.
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);
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);
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);
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;
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 296 of file Partially_Reduced_Product.defs.hh.
typedef D1 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Domain1 [protected] |
typedef D2 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::Domain2 [protected] |
The type of the second component.
Definition at line 1473 of file Partially_Reduced_Product.defs.hh.
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.
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. |
std::length_error | Thrown if num_dimensions exceeds the maximum allowed space dimension. |
Definition at line 39 of file Partially_Reduced_Product.inlines.hh.
00041 : d1(num_dimensions, kind), d2(num_dimensions, kind) { 00042 set_reduced_flag(); 00043 }
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.
cgs | The system of congruences to be approximated by the pair. |
std::length_error | Thrown if num_dimensions exceeds the maximum allowed space dimension. |
Definition at line 48 of file Partially_Reduced_Product.inlines.hh.
00049 : d1(ccgs), d2(ccgs) { 00050 clear_reduced_flag(); 00051 }
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.
cgs | The system of congruences to be approximates by the pair. Its data-structures may be recycled to build the pair. |
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(const_cast<const Congruence_System&>(cgs)), d2(cgs) { 00058 clear_reduced_flag(); 00059 }
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.
cs | The system of constraints to be approximated by the pair. |
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(ccs), d2(ccs) { 00066 clear_reduced_flag(); 00067 }
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.
cs | The system of constraints to be approximated by the pair. |
std::length_error | Thrown if the space dimension of cs exceeds the maximum allowed space dimension. |
Definition at line 72 of file Partially_Reduced_Product.inlines.hh.
00073 : d1(const_cast<const Constraint_System&>(cs)), d2(cs) { 00074 clear_reduced_flag(); 00075 }
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.
ph | The polyhedron to be approximated by the product. | |
complexity | The complexity that will not be exceeded. |
std::length_error | Thrown if the space dimension of ph exceeds the maximum allowed space dimension. |
Definition at line 80 of file Partially_Reduced_Product.inlines.hh.
00082 : d1(ph, complexity), d2(ph, complexity) { 00083 set_reduced_flag(); 00084 }
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.
ph | The polyhedron to be approximated by the product. | |
complexity | The complexity that will not be exceeded. |
std::length_error | Thrown if the space dimension of ph exceeds the maximum allowed space dimension. |
Definition at line 89 of file Partially_Reduced_Product.inlines.hh.
00091 : d1(ph, complexity), d2(ph, complexity) { 00092 set_reduced_flag(); 00093 }
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.
gr | The grid to be approximated by the product. | |
complexity | The complexity is ignored. |
std::length_error | Thrown if the space dimension of gr exceeds the maximum allowed space dimension. |
Definition at line 98 of file Partially_Reduced_Product.inlines.hh.
00099 : d1(gr), d2(gr) { 00100 set_reduced_flag(); 00101 }
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.
box | The box representing the pair to be built. | |
complexity | The complexity is ignored. |
std::length_error | Thrown if the space dimension of box exceeds the maximum allowed space dimension. |
Definition at line 107 of file Partially_Reduced_Product.inlines.hh.
00108 : d1(box), d2(box) { 00109 set_reduced_flag(); 00110 }
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.
bd | The BD shape representing the product to be built. | |
complexity | The complexity is ignored. |
std::length_error | Thrown if the space dimension of bd exceeds the maximum allowed space dimension. |
Definition at line 116 of file Partially_Reduced_Product.inlines.hh.
00117 : d1(bd), d2(bd) { 00118 set_reduced_flag(); 00119 }
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.
os | The octagonal shape representing the product to be built. | |
complexity | The complexity is ignored. |
std::length_error | Thrown if the space dimension of os exceeds the maximum allowed space dimension. |
Definition at line 125 of file Partially_Reduced_Product.inlines.hh.
00126 : d1(os), d2(os) { 00127 set_reduced_flag(); 00128 }
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 133 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.
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 143 of file Partially_Reduced_Product.inlines.hh.
00145 : d1(y.domain1(), complexity), d2(y.domain2(), complexity) { 00146 /* Even if y is reduced, the built product may not be reduced as 00147 the reduction method may have changed (i.e., S != R). */ 00148 clear_reduced_flag(); 00149 }
Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::~Partially_Reduced_Product | ( | ) | [inline] |
dimension_type Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::max_space_dimension | ( | ) | [inline, static] |
brief Returns the maximum space dimension this product can handle.
Definition at line 32 of file Partially_Reduced_Product.inlines.hh.
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 439 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.
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 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::Box< ITV >::Box(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::hash_code().
00170 { 00171 assert(d1.space_dimension() == d2.space_dimension()); 00172 return d1.space_dimension(); 00173 }
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 177 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().
00177 { 00178 reduce(); 00179 const dimension_type d1_dim = d1.affine_dimension(); 00180 const dimension_type d2_dim = d2.affine_dimension(); 00181 return std::min(d1_dim, d2_dim); 00182 }
const D1 & Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain1 | ( | ) | const [inline] |
Returns a constant reference to the first of the pair.
Definition at line 448 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 >::reduce().
Referenced by Parma_Polyhedra_Library::Box< ITV >::Box().
const D2 & Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::domain2 | ( | ) | const [inline] |
Returns a constant reference to the second of the pair.
Definition at line 455 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
Referenced by Parma_Polyhedra_Library::Box< ITV >::Box().
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 37 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().
00037 { 00038 reduce(); 00039 Constraint_System cs = d2.constraints(); 00040 const Constraint_System& cs1 = d1.constraints(); 00041 for (Constraint_System::const_iterator i = cs1.begin(), 00042 cs_end = cs1.end(); i != cs_end; ++i) 00043 cs.insert(*i); 00044 return cs; 00045 }
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 49 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().
00049 { 00050 reduce(); 00051 Constraint_System cs = d2.constraints(); 00052 const Constraint_System& cs1 = d1.constraints(); 00053 for (Constraint_System::const_iterator i = cs1.begin(), 00054 cs_end = cs1.end(); i != cs_end; ++i) 00055 cs.insert(*i); 00056 if (cs.has_strict_inequalities()) { 00057 NNC_Polyhedron ph(cs); 00058 return ph.minimized_constraints(); 00059 } 00060 else { 00061 C_Polyhedron ph(cs); 00062 return ph.minimized_constraints(); 00063 } 00064 }
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 68 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().
00068 { 00069 reduce(); 00070 Congruence_System cgs = d2.congruences(); 00071 const Congruence_System& cgs1 = d1.congruences(); 00072 for (Congruence_System::const_iterator i = cgs1.begin(), 00073 cgs_end = cgs1.end(); i != cgs_end; ++i) 00074 cgs.insert(*i); 00075 return cgs; 00076 }
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 80 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().
00080 { 00081 reduce(); 00082 Congruence_System cgs = d2.congruences(); 00083 const Congruence_System& cgs1 = d1.congruences(); 00084 for (Congruence_System::const_iterator i = cgs1.begin(), 00085 cgs_end = cgs1.end(); i != cgs_end; ++i) 00086 cgs.insert(*i); 00087 Grid gr(cgs); 00088 return gr.minimized_congruences(); 00089 }
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 146 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, 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(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), and Parma_Polyhedra_Library::Poly_Con_Relation::saturates().
00146 { 00147 reduce(); 00148 Poly_Con_Relation relation1 = d1.relation_with(c); 00149 Poly_Con_Relation relation2 = d2.relation_with(c); 00150 00151 Poly_Con_Relation result = Poly_Con_Relation::nothing(); 00152 00153 if (relation1.implies(Poly_Con_Relation::is_included())) 00154 result = result && Poly_Con_Relation::is_included(); 00155 else if (relation2.implies(Poly_Con_Relation::is_included())) 00156 result = result && Poly_Con_Relation::is_included(); 00157 if (relation1.implies(Poly_Con_Relation::saturates())) 00158 result = result && Poly_Con_Relation::saturates(); 00159 else if (relation2.implies(Poly_Con_Relation::saturates())) 00160 result = result && Poly_Con_Relation::saturates(); 00161 if (relation1.implies(Poly_Con_Relation::is_disjoint())) 00162 result = result && Poly_Con_Relation::is_disjoint(); 00163 else if (relation2.implies(Poly_Con_Relation::is_disjoint())) 00164 result = result && Poly_Con_Relation::is_disjoint(); 00165 00166 return result; 00167 }
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 172 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, 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(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), and Parma_Polyhedra_Library::Poly_Con_Relation::saturates().
00172 { 00173 reduce(); 00174 Poly_Con_Relation relation1 = d1.relation_with(cg); 00175 Poly_Con_Relation relation2 = d2.relation_with(cg); 00176 00177 Poly_Con_Relation result = Poly_Con_Relation::nothing(); 00178 00179 if (relation1.implies(Poly_Con_Relation::is_included())) 00180 result = result && Poly_Con_Relation::is_included(); 00181 else if (relation2.implies(Poly_Con_Relation::is_included())) 00182 result = result && Poly_Con_Relation::is_included(); 00183 if (relation1.implies(Poly_Con_Relation::saturates())) 00184 result = result && Poly_Con_Relation::saturates(); 00185 else if (relation2.implies(Poly_Con_Relation::saturates())) 00186 result = result && Poly_Con_Relation::saturates(); 00187 if (relation1.implies(Poly_Con_Relation::is_disjoint())) 00188 result = result && Poly_Con_Relation::is_disjoint(); 00189 else if (relation2.implies(Poly_Con_Relation::is_disjoint())) 00190 result = result && Poly_Con_Relation::is_disjoint(); 00191 00192 return result; 00193 }
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 134 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, Parma_Polyhedra_Library::Poly_Gen_Relation::nothing(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce(), and Parma_Polyhedra_Library::Poly_Gen_Relation::subsumes().
00134 { 00135 reduce(); 00136 if (Poly_Gen_Relation::nothing() == d1.relation_with(g) 00137 || Poly_Gen_Relation::nothing() == d2.relation_with(g)) 00138 return Poly_Gen_Relation::nothing(); 00139 else 00140 return Poly_Gen_Relation::subsumes(); 00141 }
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty | ( | ) | const [inline] |
Returns true
if and only if either of the components of *this
are empty.
Definition at line 462 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().
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::maximize(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize(), and Parma_Polyhedra_Library::Pointset_Powerset< PS >::Pointset_Powerset().
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 469 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.
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 475 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().
00475 { 00476 reduce(); 00477 return d1.is_topologically_closed() && d2.is_topologically_closed(); 00478 }
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.
std::invalid_argument | Thrown if x and y are dimension-incompatible. |
Definition at line 483 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().
00483 { 00484 reduce(); 00485 y.reduce(); 00486 return d1.is_disjoint_from(y.d1) || d2.is_disjoint_from(y.d2); 00487 }
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 491 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().
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 498 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().
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
.
std::invalid_argument | Thrown if var is not a space dimension of *this . |
Definition at line 521 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().
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.
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
Definition at line 506 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().
00506 { 00507 reduce(); 00508 return d1.bounds_from_above(expr) || d2.bounds_from_above(expr); 00509 }
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.
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
Definition at line 514 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().
00514 { 00515 reduce(); 00516 return d1.bounds_from_below(expr) || d2.bounds_from_below(expr); 00517 }
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.
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 . |
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
*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 198 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00201 { 00202 reduce(); 00203 if (is_empty()) 00204 return false; 00205 Coefficient sup1_n; 00206 Coefficient sup1_d; 00207 Coefficient sup2_n; 00208 Coefficient sup2_d; 00209 bool maximum1; 00210 bool maximum2; 00211 bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1); 00212 bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2); 00213 // If neither is bounded from above, return false. 00214 if (!r1 && !r2) 00215 return false; 00216 // If only d2 is bounded from above, then use the values for d2. 00217 if (!r1) { 00218 sup_n = sup2_n; 00219 sup_d = sup2_d; 00220 maximum = maximum2; 00221 return true; 00222 } 00223 // If only d1 is bounded from above, then use the values for d1. 00224 if (!r2) { 00225 sup_n = sup1_n; 00226 sup_d = sup1_d; 00227 maximum = maximum1; 00228 return true; 00229 } 00230 // If both d1 and d2 are bounded from above, then use the minimum values. 00231 if (sup2_d * sup1_n >= sup1_d * sup2_n) { 00232 sup_n = sup1_n; 00233 sup_d = sup1_d; 00234 maximum = maximum1; 00235 } 00236 else { 00237 sup_n = sup2_n; 00238 sup_d = sup2_d; 00239 maximum = maximum2; 00240 } 00241 return true; 00242 }
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.
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. |
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
*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 296 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00300 { 00301 reduce(); 00302 if (is_empty()) 00303 return false; 00304 Coefficient sup1_n; 00305 Coefficient sup1_d; 00306 Coefficient sup2_n; 00307 Coefficient sup2_d; 00308 bool maximum1; 00309 bool maximum2; 00310 Generator pnt1(point()); 00311 Generator pnt2(point()); 00312 bool r1 = d1.maximize(expr, sup1_n, sup1_d, maximum1, pnt1); 00313 bool r2 = d2.maximize(expr, sup2_n, sup2_d, maximum2, pnt2); 00314 // If neither is bounded from above, return false. 00315 if (!r1 && !r2) 00316 return false; 00317 // If only d2 is bounded from above, then use the values for d2. 00318 if (!r1) { 00319 sup_n = sup2_n; 00320 sup_d = sup2_d; 00321 maximum = maximum2; 00322 pnt = pnt2; 00323 return true; 00324 } 00325 // If only d1 is bounded from above, then use the values for d1. 00326 if (!r2) { 00327 sup_n = sup1_n; 00328 sup_d = sup1_d; 00329 maximum = maximum1; 00330 pnt = pnt1; 00331 return true; 00332 } 00333 // If both d1 and d2 are bounded from above, then use the minimum values. 00334 if (sup2_d * sup1_n >= sup1_d * sup2_n) { 00335 sup_n = sup1_n; 00336 sup_d = sup1_d; 00337 maximum = maximum1; 00338 pnt = pnt1; 00339 } 00340 else { 00341 sup_n = sup2_n; 00342 sup_d = sup2_d; 00343 maximum = maximum2; 00344 pnt = pnt2; 00345 } 00346 return true; 00347 }
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.
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 . |
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
*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 247 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00250 { 00251 reduce(); 00252 if (is_empty()) 00253 return false; 00254 Coefficient inf1_n; 00255 Coefficient inf1_d; 00256 Coefficient inf2_n; 00257 Coefficient inf2_d; 00258 bool minimum1; 00259 bool minimum2; 00260 bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1); 00261 bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2); 00262 // If neither is bounded from below, return false. 00263 if (!r1 && !r2) 00264 return false; 00265 // If only d2 is bounded from below, then use the values for d2. 00266 if (!r1) { 00267 inf_n = inf2_n; 00268 inf_d = inf2_d; 00269 minimum = minimum2; 00270 return true; 00271 } 00272 // If only d1 is bounded from below, then use the values for d1. 00273 if (!r2) { 00274 inf_n = inf1_n; 00275 inf_d = inf1_d; 00276 minimum = minimum1; 00277 return true; 00278 } 00279 // If both d1 and d2 are bounded from below, then use the minimum values. 00280 if (inf2_d * inf1_n <= inf1_d * inf2_n) { 00281 inf_n = inf1_n; 00282 inf_d = inf1_d; 00283 minimum = minimum1; 00284 } 00285 else { 00286 inf_n = inf2_n; 00287 inf_d = inf2_d; 00288 minimum = minimum2; 00289 } 00290 return true; 00291 }
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.
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. |
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
*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 352 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_empty(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00356 { 00357 reduce(); 00358 if (is_empty()) 00359 return false; 00360 Coefficient inf1_n; 00361 Coefficient inf1_d; 00362 Coefficient inf2_n; 00363 Coefficient inf2_d; 00364 bool minimum1; 00365 bool minimum2; 00366 Generator pnt1(point()); 00367 Generator pnt2(point()); 00368 bool r1 = d1.minimize(expr, inf1_n, inf1_d, minimum1, pnt1); 00369 bool r2 = d2.minimize(expr, inf2_n, inf2_d, minimum2, pnt2); 00370 // If neither is bounded from below, return false. 00371 if (!r1 && !r2) 00372 return false; 00373 // If only d2 is bounded from below, then use the values for d2. 00374 if (!r1) { 00375 inf_n = inf2_n; 00376 inf_d = inf2_d; 00377 minimum = minimum2; 00378 pnt = pnt2; 00379 return true; 00380 } 00381 // If only d1 is bounded from below, then use the values for d1. 00382 if (!r2) { 00383 inf_n = inf1_n; 00384 inf_d = inf1_d; 00385 minimum = minimum1; 00386 pnt = pnt1; 00387 return true; 00388 } 00389 // If both d1 and d2 are bounded from below, then use the minimum values. 00390 if (inf2_d * inf1_n <= inf1_d * inf2_n) { 00391 inf_n = inf1_n; 00392 inf_d = inf1_d; 00393 minimum = minimum1; 00394 pnt = pnt1; 00395 } 00396 else { 00397 inf_n = inf2_n; 00398 inf_d = inf2_d; 00399 minimum = minimum2; 00400 pnt = pnt2; 00401 } 00402 return true; 00403 }
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
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 613 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().
00613 { 00614 reduce(); 00615 y.reduce(); 00616 return d1.contains(y.d1) && d2.contains(y.d2); 00617 }
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
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 622 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().
00622 { 00623 reduce(); 00624 y.reduce(); 00625 return (d1.contains(y.d1) && d2.strictly_contains(y.d2)) 00626 || (d2.contains(y.d2) && d1.strictly_contains(y.d1)); 00627 }
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK | ( | ) | const [inline] |
Checks if all the invariants are satisfied.
Definition at line 407 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.
00407 { 00408 if (reduced) { 00409 Partially_Reduced_Product<D1, D2, R> pd1 = *this; 00410 Partially_Reduced_Product<D1, D2, R> pd2 = *this; 00411 /* Force pd1 reduction */ 00412 pd1.clear_reduced_flag(); 00413 pd1.reduce(); 00414 if (pd1 != pd2) 00415 return false; 00416 } 00417 return d1.OK() && d2.OK(); 00418 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint | ( | const Constraint & | c | ) | [inline] |
Adds constraint c
to *this
.
std::invalid_argument | Thrown if *this and c are dimension-incompatible. |
Definition at line 370 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.
00370 { 00371 d1.add_constraint(c); 00372 d2.add_constraint(c); 00373 clear_reduced_flag(); 00374 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint | ( | const Constraint & | c | ) | [inline] |
Use the constraint c
to refine *this
.
c | The constraint to be used for refinement. |
std::invalid_argument | Thrown if *this and c are dimension-incompatible. |
Definition at line 378 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.
00378 { 00379 d1.refine_with_constraint(c); 00380 d2.refine_with_constraint(c); 00381 clear_reduced_flag(); 00382 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruence | ( | const Congruence & | cg | ) | [inline] |
Adds a copy of congruence cg
to *this
.
std::invalid_argument | Thrown if *this and congruence cg are dimension-incompatible. |
Definition at line 386 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.
00386 { 00387 d1.add_congruence(cg); 00388 d2.add_congruence(cg); 00389 clear_reduced_flag(); 00390 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruence | ( | const Congruence & | cg | ) | [inline] |
Use the congruence cg
to refine *this
.
cg | The congruence to be used for refinement. |
std::invalid_argument | Thrown if *this and cg are dimension-incompatible. |
Definition at line 394 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.
00394 { 00395 d1.refine_with_congruence(cg); 00396 d2.refine_with_congruence(cg); 00397 clear_reduced_flag(); 00398 }
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
.
cgs | The congruence system to be added. |
std::invalid_argument | Thrown if *this and cgs are dimension-incompatible. |
Definition at line 421 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.
00421 { 00422 d1.add_congruences(cgs); 00423 d2.add_congruences(cgs); 00424 clear_reduced_flag(); 00425 }
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
.
cgs | The congruences to be used for refinement. |
std::invalid_argument | Thrown if *this and cgs are dimension-incompatible. |
Definition at line 430 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.
00430 { 00431 d1.refine_with_congruences(cgs); 00432 d2.refine_with_congruences(cgs); 00433 clear_reduced_flag(); 00434 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences | ( | Congruence_System & | cgs | ) | [inline] |
Adds the congruences in cgs
to *this.
cgs | The congruence system to be added that may be recycled. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible. |
cgs
upon successful or exceptional return is that it can be safely destroyed. Definition at line 114 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, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.
00114 { 00115 if (d1.can_recycle_congruence_systems()) { 00116 d2.refine_with_congruences(cgs); 00117 d1.add_recycled_congruences(cgs); 00118 } 00119 else 00120 if (d2.can_recycle_congruence_systems()) { 00121 d1.refine_with_congruences(cgs); 00122 d2.add_recycled_congruences(cgs); 00123 } 00124 else { 00125 d1.add_congruences(cgs); 00126 d2.add_congruences(cgs); 00127 } 00128 clear_reduced_flag(); 00129 }
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
.
cs | The constraint system to be added. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible. |
Definition at line 403 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.
00403 { 00404 d1.add_constraints(cs); 00405 d2.add_constraints(cs); 00406 clear_reduced_flag(); 00407 }
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
.
cs | The constraints to be used for refinement. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible. |
Definition at line 412 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.
00412 { 00413 d1.refine_with_constraints(cs); 00414 d2.refine_with_constraints(cs); 00415 clear_reduced_flag(); 00416 }
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
.
cs | The constraint system to be added that may be recycled. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible. |
cs
upon successful or exceptional return is that it can be safely destroyed. Definition at line 94 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, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2.
00094 { 00095 if (d1.can_recycle_constraint_systems()) { 00096 d2.refine_with_constraints(cs); 00097 d1.add_recycled_constraints(cs); 00098 } 00099 else 00100 if (d2.can_recycle_constraint_systems()) { 00101 d1.refine_with_constraints(cs); 00102 d2.add_recycled_constraints(cs); 00103 } 00104 else { 00105 d1.add_constraints(cs); 00106 d2.add_constraints(cs); 00107 } 00108 clear_reduced_flag(); 00109 }
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
.
var | The space dimension that will be unconstrained. |
std::invalid_argument | Thrown if var is not a space dimension of *this . |
Definition at line 187 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().
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::unconstrain | ( | const Variables_Set & | to_be_unconstrained | ) | [inline] |
Computes the cylindrification of *this
with respect to the set of space dimensions to_be_unconstrained
, assigning the result to *this
.
to_be_unconstrained | The set of space dimension that will be unconstrained. |
std::invalid_argument | Thrown if *this is dimension-incompatible with one of the Variable objects contained in to_be_removed . |
Definition at line 196 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().
00196 { 00197 reduce(); 00198 d1.unconstrain(to_be_unconstrained); 00199 d2.unconstrain(to_be_unconstrained); 00200 }
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
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 205 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.
00205 { 00206 d1.intersection_assign(y.d1); 00207 d2.intersection_assign(y.d2); 00208 clear_reduced_flag(); 00209 }
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.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 226 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().
00226 { 00227 reduce(); 00228 y.reduce(); 00229 d1.upper_bound_assign(y.d1); 00230 d2.upper_bound_assign(y.d2); 00231 // CHECKME: if upper_bound_assign is not a least_upper_bound 00232 // it may not be reduced. 00233 // clear_reduced_flag(); 00234 }
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.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 239 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().
00239 { 00240 reduce(); 00241 y.reduce(); 00242 D1 d1_copy = d1; 00243 bool ub_exact = d1_copy.upper_bound_assign_if_exact(y.d1); 00244 if (!ub_exact) 00245 return false; 00246 ub_exact = d2.upper_bound_assign_if_exact(y.d2); 00247 if (!ub_exact) 00248 return false; 00249 std::swap(d1,d1_copy); 00250 return true; 00251 }
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
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 214 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00214 { 00215 reduce(); 00216 y.reduce(); 00217 d1.difference_assign(y.d1); 00218 d2.difference_assign(y.d2); 00219 // FIXME: check this. 00220 clear_reduced_flag(); 00221 }
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
.
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). |
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 256 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.
00258 { 00259 d1.affine_image(var, expr, denominator); 00260 d2.affine_image(var, expr, denominator); 00261 }
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
.
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). |
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 266 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.
00268 { 00269 d1.affine_preimage(var, expr, denominator); 00270 d2.affine_preimage(var, expr, denominator); 00271 }
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.).
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). |
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 276 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.
00279 { 00280 d1.generalized_affine_image(var, relsym, expr, denominator); 00281 d2.generalized_affine_image(var, relsym, expr, denominator); 00282 }
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.).
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). |
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 287 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.
00290 { 00291 d1.generalized_affine_preimage(var, relsym, expr, denominator); 00292 d2.generalized_affine_preimage(var, relsym, expr, denominator); 00293 }
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.).
lhs | The left hand side affine expression; | |
relsym | The relation symbol; | |
rhs | The right hand side affine expression. |
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 298 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.
00300 { 00301 d1.generalized_affine_image(lhs, relsym, rhs); 00302 d2.generalized_affine_image(lhs, relsym, rhs); 00303 }
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.).
lhs | The left hand side affine expression; | |
relsym | The relation symbol; | |
rhs | The right hand side affine expression. |
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 308 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.
00310 { 00311 d1.generalized_affine_preimage(lhs, relsym, rhs); 00312 d2.generalized_affine_preimage(lhs, relsym, rhs); 00313 }
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 .
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). |
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 319 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.
00322 { 00323 d1.bounded_affine_image(var, lb_expr, ub_expr, denominator); 00324 d2.bounded_affine_image(var, lb_expr, ub_expr, denominator); 00325 // FIXME: check this. 00326 clear_reduced_flag(); 00327 }
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 .
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). |
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.
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.
00335 { 00336 d1.bounded_affine_preimage(var, lb_expr, ub_expr, denominator); 00337 d2.bounded_affine_preimage(var, lb_expr, ub_expr, denominator); 00338 // FIXME: check this. 00339 clear_reduced_flag(); 00340 }
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.).
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 345 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00345 { 00346 reduce(); 00347 d1.time_elapse_assign(y.d1); 00348 d2.time_elapse_assign(y.d2); 00349 // FIXME: check this. 00350 clear_reduced_flag(); 00351 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::topological_closure_assign | ( | ) | [inline] |
Assigns to *this
its topological closure.
Definition at line 355 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.
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.
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). |
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
Definition at line 529 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 // FIXME: In general this is _NOT_ a widening since the reduction 00532 // may mean that the sequence does not satisfy the ascending 00533 // chain condition. 00534 // However, for the direct, smash and constraints product 00535 // it may be ok - but this still needs checking. 00536 reduce(); 00537 y.reduce(); 00538 d1.widening_assign(y.d1, tp); 00539 d2.widening_assign(y.d2, tp); 00540 }
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.
m | The number of dimensions to add. |
std::length_error | Thrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension() . |
Definition at line 545 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.
00545 { 00546 d1.add_space_dimensions_and_embed(m); 00547 d2.add_space_dimensions_and_embed(m); 00548 }
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.
m | The number of space dimensions to add. |
std::length_error | Thrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension() . |
Definition at line 553 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.
00553 { 00554 d1.add_space_dimensions_and_project(m); 00555 d2.add_space_dimensions_and_project(m); 00556 }
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 and Concatenating Grids.
std::length_error | Thrown if the concatenation would cause the vector space to exceed dimension max_space_dimension() . |
Definition at line 561 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, Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2, and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced().
00561 { 00562 d1.concatenate_assign(y.d1); 00563 d2.concatenate_assign(y.d2); 00564 if (!is_reduced() || !y.is_reduced()) 00565 clear_reduced_flag(); 00566 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_space_dimensions | ( | const Variables_Set & | to_be_removed | ) | [inline] |
Removes all the specified dimensions from the vector space.
to_be_removed | The set of Variable objects corresponding to the space dimensions to be removed. |
std::invalid_argument | Thrown if *this is dimension-incompatible with one of the Variable objects contained in to_be_removed . |
Definition at line 571 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.
00571 { 00572 d1.remove_space_dimensions(to_be_removed); 00573 d2.remove_space_dimensions(to_be_removed); 00574 }
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
.
std::invalid_argument | Thrown if new_dimensions is greater than the space dimension of *this . |
Definition at line 579 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.
00579 { 00580 d1.remove_higher_space_dimensions(new_dimension); 00581 d2.remove_higher_space_dimensions(new_dimension); 00582 }
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
.
pfunc | The partial function specifying the destiny of each space dimension. |
Partial_Function
must provide the following methods. bool has_empty_codomain() const
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
max_in_codomain()
method is called at most once. bool maps(dimension_type i, dimension_type& j) const
i
. If j
and true
is returned. If false
is returned. This method is called at most *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 588 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.
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
.
var | The variable corresponding to the space dimension to be replicated; | |
m | The number of replicas to be created. |
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() . |
*this
has space dimension var
has space dimension m
new space dimensions Definition at line 596 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.
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::fold_space_dimensions | ( | const Variables_Set & | to_be_folded, | |
Variable | var | |||
) | [inline] |
Folds the space dimensions in to_be_folded
into var
.
to_be_folded | The set of Variable objects corresponding to the space dimensions to be folded; | |
var | The variable corresponding to the space dimension that is the destination of the folding operation. |
std::invalid_argument | Thrown if *this is dimension-incompatible with var or with one of the Variable objects contained in to_be_folded . Also thrown if var is contained in to_be_folded . |
*this
has space dimension var
has space dimension to_be_folded
is a set of variables whose maximum space dimension is also less than or equal to var
is not a member of to_be_folded
, then the space dimensions corresponding to variables in to_be_folded
are folded into the Definition at line 604 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.
00605 { 00606 d1.fold_space_dimensions(to_be_folded, var); 00607 d2.fold_space_dimensions(to_be_folded, var); 00608 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap | ( | Partially_Reduced_Product< D1, D2, R > & | y | ) | [inline] |
Swaps *this
with product y
. (*this
and y
can be dimension-incompatible.).
Definition at line 362 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 >::reduced, and Parma_Polyhedra_Library::swap().
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap().
00362 { 00363 std::swap(d1, y.d1); 00364 std::swap(d2, y.d2); 00365 std::swap(reduced, y.reduced); 00366 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump | ( | ) | const |
Writes to std::cerr
an ASCII representation of *this
.
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 665 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.
00665 { 00666 const char yes = '+'; 00667 const char no = '-'; 00668 s << "Partially_Reduced_Product\n"; 00669 s << (reduced ? yes : no) << "reduced\n"; 00670 s << "Domain 1:\n"; 00671 d1.ascii_dump(s); 00672 s << "Domain 2:\n"; 00673 d2.ascii_dump(s); 00674 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::print | ( | ) | const |
Prints *this
to std::cerr
using operator<<
.
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 422 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.
00422 { 00423 const char yes = '+'; 00424 const char no = '-'; 00425 std::string str; 00426 if (!(s >> str) || str != "Partially_Reduced_Product") 00427 return false; 00428 if (!(s >> str) 00429 || (str[0] != yes && str[0] != no) 00430 || str.substr(1) != "reduced") 00431 return false; 00432 reduced = (str[0] == yes); 00433 return ((s >> str) && str == "Domain" 00434 && (s >> str) && str == "1:" 00435 && d1.ascii_load(s) 00436 && (s >> str) && str == "Domain" 00437 && (s >> str) && str == "2:" 00438 && d2.ascii_load(s)); 00439 }
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 164 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes().
00164 { 00165 return sizeof(*this) + external_memory_in_bytes(); 00166 }
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 158 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().
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 678 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::space_dimension().
00678 { 00679 return space_dimension() & 0x7fffffff; 00680 }
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce | ( | ) | const [inline] |
Reduce.
Definition at line 631 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 >::bounds_from_above(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_below(), 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 >::maximize(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize(), 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 >::relation_with(), 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().
00631 { 00632 Partially_Reduced_Product& dp 00633 = const_cast<Partially_Reduced_Product&>(*this); 00634 if (dp.is_reduced()) 00635 return false; 00636 R r; 00637 r.product_reduce(dp.d1, dp.d2); 00638 set_reduced_flag(); 00639 return true; 00640 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::clear_reduced_flag | ( | ) | const [inline, protected] |
Clears the reduced flag.
Definition at line 650 of file Partially_Reduced_Product.inlines.hh.
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_preimage(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::concatenate_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::difference_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::intersection_assign(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::OK(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruence(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraints(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::time_elapse_assign().
00650 { 00651 const_cast<Partially_Reduced_Product&>(*this).reduced = false; 00652 }
void Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::set_reduced_flag | ( | ) | const [inline, protected] |
Sets the reduced flag.
Definition at line 656 of file Partially_Reduced_Product.inlines.hh.
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00656 { 00657 const_cast<Partially_Reduced_Product&>(*this).reduced = true; 00658 }
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced | ( | ) | const [inline, protected] |
Return true
if and only if the reduced flag is set.
Definition at line 644 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced.
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::concatenate_assign(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduce().
00644 { 00645 return reduced; 00646 }
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 685 of file Partially_Reduced_Product.inlines.hh.
std::ostream & operator<< | ( | std::ostream & | s, | |
const Partially_Reduced_Product< D1, D2, R > & | pd | |||
) | [friend] |
Output operator.
Writes a textual representation of dp
on s
.
Definition at line 703 of file Partially_Reduced_Product.inlines.hh.
00703 { 00704 return s << "Domain 1:\n" 00705 << pd.d1 00706 << "Domain 2:\n" 00707 << pd.d2; 00708 }
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 695 of file Partially_Reduced_Product.inlines.hh.
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 761 of file Partially_Reduced_Product.inlines.hh.
References Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap().
00762 { 00763 x.swap(y); 00764 }
D1 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d1 [protected] |
The first component.
Definition at line 1476 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_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_embed(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_project(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_preimage(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_preimage(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_above(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_below(), 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 >::expand_space_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::fold_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_preimage(), 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 >::map_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::maximize(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize(), 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_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::relation_with(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_higher_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_space_dimensions(), 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().
D2 Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::d2 [protected] |
The second component.
Definition at line 1479 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_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_recycled_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_embed(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::add_space_dimensions_and_project(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::affine_preimage(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounded_affine_preimage(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_above(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::bounds_from_below(), 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 >::expand_space_dimension(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::external_memory_in_bytes(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::fold_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_image(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::generalized_affine_preimage(), 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 >::map_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::maximize(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::minimize(), 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_congruences(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraint(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::refine_with_constraints(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::relation_with(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_higher_space_dimensions(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::remove_space_dimensions(), 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().
bool Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::reduced [protected] |
Flag to record whether the components are reduced with respect to each other and the reduction class.
Definition at line 1495 of file Partially_Reduced_Product.defs.hh.
Referenced by Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_dump(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::ascii_load(), Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::is_reduced(), 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 >::Partially_Reduced_Product(), and Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >::swap().