#include <ppl.hh>
Public Types | |
typedef ITV | interval_type |
The type of intervals used to implement the box. | |
Public Member Functions | |
const ITV & | get_interval (Variable var) const |
Returns a reference the interval that bounds var . | |
void | set_interval (Variable var, const ITV &i) |
Sets to i the interval that bounds var . | |
bool | get_lower_bound (dimension_type k, bool &closed, Coefficient &n, Coefficient &d) const |
If the k -th space dimension is unbounded below, returns false . Otherwise returns true and set closed , n and d accordingly. | |
bool | get_upper_bound (dimension_type k, bool &closed, Coefficient &n, Coefficient &d) const |
If the k -th space dimension is unbounded above, returns false . Otherwise returns true and set closed , n and d accordingly. | |
Constraint_System | constraints () const |
Returns a system of constraints defining *this . | |
Constraint_System | minimized_constraints () const |
Returns a minimized system of constraints defining *this . | |
Congruence_System | congruences () const |
Returns a system of congruences approximating *this . | |
Congruence_System | minimized_congruences () const |
Returns a minimized system of congruences approximating *this . | |
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 . | |
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<< . | |
void | set_empty () |
Causes the box to become empty, i.e., to represent the empty set. | |
Constructors, Assignment, Swap and Destructor | |
Box (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE) | |
Builds a universe or empty box of the specified space dimension. | |
Box (const Box &y, Complexity_Class complexity=ANY_COMPLEXITY) | |
Ordinary copy-constructor. | |
template<typename Other_ITV > | |
Box (const Box< Other_ITV > &y, Complexity_Class complexity=ANY_COMPLEXITY) | |
Builds a conservative, upward approximation of y . | |
Box (const Constraint_System &cs) | |
Builds a box from the system of constraints cs . | |
Box (const Constraint_System &cs, Recycle_Input dummy) | |
Builds a box recycling a system of constraints cs . | |
Box (const Generator_System &gs) | |
Builds a box from the system of generators gs . | |
Box (const Generator_System &gs, Recycle_Input dummy) | |
Builds a box recycling the system of generators gs . | |
Box (const Congruence_System &cgs) | |
Box (const Congruence_System &cgs, Recycle_Input dummy) | |
template<typename T > | |
Box (const BD_Shape< T > &bds, Complexity_Class complexity=POLYNOMIAL_COMPLEXITY) | |
Builds a box containing the BDS bds . | |
template<typename T > | |
Box (const Octagonal_Shape< T > &oct, Complexity_Class complexity=POLYNOMIAL_COMPLEXITY) | |
Builds a box containing the octagonal shape oct . | |
Box (const Polyhedron &ph, Complexity_Class complexity=ANY_COMPLEXITY) | |
Builds a box containing the polyhedron ph . | |
Box (const Grid &ph, Complexity_Class complexity=POLYNOMIAL_COMPLEXITY) | |
Builds a box containing the grid gr . | |
template<typename D1 , typename D2 , typename R > | |
Box (const Partially_Reduced_Product< D1, D2, R > &dp, Complexity_Class complexity=ANY_COMPLEXITY) | |
Builds a box containing the partially reduced product dp . | |
Box & | operator= (const Box &y) |
The assignment operator (*this and y can be dimension-incompatible). | |
void | swap (Box &y) |
Swaps *this with y (*this and y can be dimension-incompatible). | |
Member Functions that Do Not Modify the Box | |
dimension_type | space_dimension () const |
Returns the dimension of the vector space enclosing *this . | |
dimension_type | affine_dimension () const |
Returns ![]() *this is empty; otherwise, returns the affine dimension of *this . | |
bool | is_empty () const |
Returns true if and only if *this is an empty box. | |
bool | is_universe () const |
Returns true if and only if *this is a universe box. | |
bool | is_topologically_closed () const |
Returns true if and only if *this is a topologically closed subset of the vector space. | |
bool | is_discrete () const |
Returns true if and only if *this is discrete. | |
bool | is_bounded () const |
Returns true if and only if *this is a bounded box. | |
bool | contains_integer_point () const |
Returns true if and only if *this contains at least one integer point. | |
bool | constrains (Variable var) const |
Returns true if and only if var is constrained in *this . | |
Poly_Con_Relation | relation_with (const Constraint &c) const |
Returns the relations holding between *this and the constraint c . | |
Poly_Con_Relation | relation_with (const Congruence &cg) const |
Returns the relations holding between *this and the congruence cg . | |
Poly_Gen_Relation | relation_with (const Generator &g) const |
Returns the relations holding between *this and the generator g . | |
bool | bounds_from_above (const Linear_Expression &expr) const |
Returns true if and only if expr is bounded from above in *this . | |
bool | bounds_from_below (const Linear_Expression &expr) const |
Returns true if and only if expr is bounded from below 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 &g) const |
Returns true if and only if *this is not empty and expr is bounded from above in *this , in which case the supremum value and a point where expr reaches it are computed. | |
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 in *this , in which case the infimum value is computed. | |
bool | minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum, Generator &g) const |
Returns true if and only if *this is not empty and expr is bounded from below in *this , in which case the infimum value and a point where expr reaches it are computed. | |
bool | contains (const Box &) const |
Returns true if and only if *this contains y . | |
bool | strictly_contains (const Box &) const |
Returns true if and only if *this strictly contains y . | |
bool | is_disjoint_from (const Box &y) const |
Returns true if and only if *this and y are disjoint. | |
bool | OK () const |
Returns true if and only if *this satisfies all its invariants. | |
Space-Dimension Preserving Member Functions that May Modify the Box | |
void | add_constraint (const Constraint &c) |
Adds a copy of constraint c to the system of constraints defining *this . | |
void | add_constraints (const Constraint_System &cs) |
Adds the constraints in cs to the system of constraints defining *this . | |
void | add_recycled_constraints (Constraint_System &cs) |
Adds the constraints in cs to the system of constraints defining *this . | |
void | add_congruence (const Congruence &cg) |
Adds to *this a constraint equivalent to the congruence cg . | |
void | add_congruences (const Congruence_System &cgs) |
Adds to *this constraints equivalent to the congruences in cgs . | |
void | add_recycled_congruences (Congruence_System &cgs) |
Adds to *this constraints equivalent to the congruences in cgs . | |
void | refine_with_constraint (const Constraint &c) |
Use the constraint c to refine *this . | |
void | refine_with_constraints (const Constraint_System &cs) |
Use the constraints in cs to refine *this . | |
void | refine_with_congruence (const Congruence &cg) |
Use the congruence cg to refine *this . | |
void | refine_with_congruences (const Congruence_System &cgs) |
Use the congruences in cgs to refine *this . | |
void | propagate_constraint (const Constraint &c) |
Use the constraint c for constraint propagation on *this . | |
void | propagate_constraints (const Constraint_System &cs) |
Use the constraints in cs for constraint propagagion on *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 Box &y) |
Assigns to *this the intersection of *this and y . | |
void | upper_bound_assign (const Box &y) |
Assigns to *this the smallest box containing the union of *this and y . | |
bool | upper_bound_assign_if_exact (const Box &y) |
If the upper bound of *this and y is exact, it is assigned to *this and true is returned, otherwise false is returned. | |
void | difference_assign (const Box &y) |
Assigns to *this the difference of *this and y . | |
bool | simplify_using_context_assign (const Box &y) |
Assigns to *this a meet-preserving simplification of *this with respect to y . If false is returned, then the intersection is empty. | |
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 . | |
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 . | |
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 . | |
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 . | |
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 Box &y) |
Assigns to *this the result of computing the time-elapse between *this and y . | |
void | topological_closure_assign () |
Assigns to *this its topological closure. | |
void | CC76_widening_assign (const Box &y, unsigned *tp=0) |
Assigns to *this the result of computing the CC76-widening between *this and y . | |
template<typename Iterator > | |
void | CC76_widening_assign (const Box &y, Iterator first, Iterator last) |
Assigns to *this the result of computing the CC76-widening between *this and y . | |
void | widening_assign (const Box &y, unsigned *tp=0) |
Same as CC76_widening_assign(y, tp). | |
void | limited_CC76_extrapolation_assign (const Box &y, const Constraint_System &cs, unsigned *tp=0) |
Improves the result of the CC76-extrapolation computation by also enforcing those constraints in cs that are satisfied by all the points of *this . | |
void | CC76_narrowing_assign (const Box &y) |
Assigns to *this the result of restoring in y the constraints of *this that were lost by CC76-extrapolation applications. | |
Member Functions that May Modify the Dimension of the Vector Space | |
void | add_space_dimensions_and_embed (dimension_type m) |
Adds m new dimensions and embeds the old box into the new space. | |
void | add_space_dimensions_and_project (dimension_type m) |
Adds m new dimensions to the box and does not embed it in the new vector space. | |
void | concatenate_assign (const Box &y) |
Seeing a box as a set of tuples (its points), assigns to *this all the tuples that can be obtained by concatenating, in the order given, a tuple of *this with a tuple of y . | |
void | remove_space_dimensions (const Variables_Set &to_be_removed) |
Removes all the specified dimensions. | |
void | remove_higher_space_dimensions (dimension_type new_dimension) |
Removes the higher dimensions 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 . | |
Static Public Member Functions | |
static dimension_type | max_space_dimension () |
Returns the maximum space dimension that a Box can handle. | |
static bool | can_recycle_constraint_systems () |
Returns false indicating that this domain does not recycle constraints. | |
static bool | can_recycle_congruence_systems () |
Returns false indicating that this domain does not recycle congruences. | |
Friends | |
bool | operator== (const Box< ITV > &x, const Box< ITV > &y) |
Returns true if and only if x and y are the same box. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename ITV > | |
bool | operator!= (const Box< ITV > &x, const Box< ITV > &y) |
Returns true if and only if x and y aren't the same box. | |
template<typename ITV > | |
std::ostream & | operator<< (std::ostream &s, const Box< ITV > &box) |
Output operator. | |
template<typename To , typename ITV > | |
bool | rectilinear_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir) |
Computes the rectilinear (or Manhattan) distance between x and y . | |
template<typename Temp , typename To , typename ITV > | |
bool | rectilinear_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2) |
Computes the rectilinear (or Manhattan) distance between x and y . | |
template<typename To , typename ITV > | |
bool | euclidean_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir) |
Computes the euclidean distance between x and y . | |
template<typename Temp , typename To , typename ITV > | |
bool | euclidean_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2) |
Computes the euclidean distance between x and y . | |
template<typename To , typename ITV > | |
bool | l_infinity_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir) |
Computes the ![]() x and y . | |
template<typename Temp , typename To , typename ITV > | |
bool | l_infinity_distance_assign (Checked_Number< To, Extended_Number_Policy > &r, const Box< ITV > &x, const Box< ITV > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2) |
Computes the ![]() x and y . |
A Box object represents the smash product of not necessarily closed and possibly unbounded intervals represented by objects of class
ITV
, where is the space dimension of the box.
An interval constraint (resp., interval congruence) is a syntactic constraint (resp., congruence) that only mentions a single space dimension.
The Box domain optimally supports:
ITV
;ITV
.Depending on the method, using a constraint or congruence that is not optimally supported by the domain will either raise an exception or result in a (possibly non-optimal) upward approximation.
The user interface for the Box domain is meant to be as similar as possible to the one developed for the polyhedron class C_Polyhedron.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | dimension_type | num_dimensions = 0 , |
|
Degenerate_Element | kind = UNIVERSE | |||
) | [inline, explicit] |
Builds a universe or empty box of the specified space dimension.
num_dimensions | The number of dimensions of the vector space enclosing the box; | |
kind | Specifies whether the universe or the empty box has to be built. |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Box< ITV > & | y, | |
Complexity_Class | complexity = ANY_COMPLEXITY | |||
) | [inline] |
Ordinary copy-constructor.
The complexity argument is ignored.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Box< Other_ITV > & | y, | |
Complexity_Class | complexity = ANY_COMPLEXITY | |||
) | [inline, explicit] |
Builds a conservative, upward approximation of y
.
The complexity argument is ignored.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Constraint_System & | cs | ) | [inline, explicit] |
Builds a box from the system of constraints cs
.
The box inherits the space dimension of cs
.
cs | A system of constraints: constraints that are not interval constraints are ignored (even though they may have contributed to the space dimension). |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Constraint_System & | cs, | |
Recycle_Input | dummy | |||
) | [inline] |
Builds a box recycling a system of constraints cs
.
The box inherits the space dimension of cs
.
cs | A system of constraints: constraints that are not interval constraints are ignored (even though they may have contributed to the space dimension). | |
dummy | A dummy tag to syntactically differentiate this one from the other constructors. |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Generator_System & | gs | ) | [inline, explicit] |
Builds a box from the system of generators gs
.
Builds the smallest box containing the polyhedron defined by gs
. The box inherits the space dimension of gs
.
std::invalid_argument | Thrown if the system of generators is not empty but has no points. |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Generator_System & | gs, | |
Recycle_Input | dummy | |||
) | [inline] |
Builds a box recycling the system of generators gs
.
Builds the smallest box containing the polyhedron defined by gs
. The box inherits the space dimension of gs
.
gs | The generator system describing the polyhedron to be approximated. | |
dummy | A dummy tag to syntactically differentiate this one from the other constructors. |
std::invalid_argument | Thrown if the system of generators is not empty but has no points. |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Congruence_System & | cgs | ) | [inline, explicit] |
Builds the smallest box containing the grid defined by a system of congruences cgs
. The box inherits the space dimension of cgs
.
cgs | A system of congruences: congruences that are not non-relational equality constraints are ignored (though they may have contributed to the space dimension). |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Congruence_System & | cgs, | |
Recycle_Input | dummy | |||
) | [inline] |
Builds the smallest box containing the grid defined by a system of congruences cgs
, recycling cgs
. The box inherits the space dimension of cgs
.
cgs | A system of congruences: congruences that are not non-relational equality constraints are ignored (though they will contribute to the space dimension). | |
dummy | A dummy tag to syntactically differentiate this one from the other constructors. |
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const BD_Shape< T > & | bds, | |
Complexity_Class | complexity = POLYNOMIAL_COMPLEXITY | |||
) | [inline, explicit] |
Builds a box containing the BDS bds
.
Builds the smallest box containing bds
using a polynomial algorithm. The complexity
argument is ignored.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Octagonal_Shape< T > & | oct, | |
Complexity_Class | complexity = POLYNOMIAL_COMPLEXITY | |||
) | [inline, explicit] |
Builds a box containing the octagonal shape oct
.
Builds the smallest box containing oct
using a polynomial algorithm. The complexity
argument is ignored.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Polyhedron & | ph, | |
Complexity_Class | complexity = ANY_COMPLEXITY | |||
) | [inline, explicit] |
Builds a box containing the polyhedron ph
.
Builds a box containing ph
using algorithms whose complexity does not exceed the one specified by complexity
. If complexity
is ANY_COMPLEXITY
, then the built box is the smallest one containing ph
.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Grid & | ph, | |
Complexity_Class | complexity = POLYNOMIAL_COMPLEXITY | |||
) | [inline, explicit] |
Builds a box containing the grid gr
.
Builds the smallest box containing gr
using a polynomial algorithm. The complexity
argument is ignored.
Parma_Polyhedra_Library::Box< ITV >::Box | ( | const Partially_Reduced_Product< D1, D2, R > & | dp, | |
Complexity_Class | complexity = ANY_COMPLEXITY | |||
) | [inline, explicit] |
Builds a box containing the partially reduced product dp
.
Builds a box containing ph
using algorithms whose complexity does not exceed the one specified by complexity
.
bool Parma_Polyhedra_Library::Box< ITV >::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 . |
Poly_Con_Relation Parma_Polyhedra_Library::Box< ITV >::relation_with | ( | const Constraint & | c | ) | const [inline] |
Returns the relations holding between *this
and the constraint c
.
std::invalid_argument | Thrown if *this and constraint c are dimension-incompatible. |
Poly_Con_Relation Parma_Polyhedra_Library::Box< ITV >::relation_with | ( | const Congruence & | cg | ) | const [inline] |
Returns the relations holding between *this
and the congruence cg
.
std::invalid_argument | Thrown if *this and constraint cg are dimension-incompatible. |
Poly_Gen_Relation Parma_Polyhedra_Library::Box< ITV >::relation_with | ( | const Generator & | g | ) | const [inline] |
Returns the relations holding between *this
and the generator g
.
std::invalid_argument | Thrown if *this and generator g are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::bounds_from_above | ( | const Linear_Expression & | expr | ) | const [inline] |
Returns true
if and only if expr
is bounded from above in *this
.
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::bounds_from_below | ( | const Linear_Expression & | expr | ) | const [inline] |
Returns true
if and only if expr
is bounded from below in *this
.
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::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 and only if the supremum is also the maximum value. |
std::invalid_argument | Thrown if expr and *this are dimension-incompatible. |
*this
is empty or expr
is not bounded from above, false
is returned and sup_n
, sup_d
and maximum
are left untouched.
bool Parma_Polyhedra_Library::Box< ITV >::maximize | ( | const Linear_Expression & | expr, | |
Coefficient & | sup_n, | |||
Coefficient & | sup_d, | |||
bool & | maximum, | |||
Generator & | g | |||
) | 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 and only if the supremum is also the maximum value; | |
g | When maximization succeeds, will be assigned the point or closure 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 from above, false
is returned and sup_n
, sup_d
, maximum
and g
are left untouched.
bool Parma_Polyhedra_Library::Box< ITV >::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 in *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 and only if the infimum is also the minimum 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
and minimum
are left untouched.
bool Parma_Polyhedra_Library::Box< ITV >::minimize | ( | const Linear_Expression & | expr, | |
Coefficient & | inf_n, | |||
Coefficient & | inf_d, | |||
bool & | minimum, | |||
Generator & | g | |||
) | 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 and only if the infimum is also the minimum value; | |
g | When minimization succeeds, will be assigned a point or closure 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 g
are left untouched.
bool Parma_Polyhedra_Library::Box< ITV >::contains | ( | const Box< ITV > & | y | ) | const [inline] |
Returns true
if and only if *this
contains y
.
std::invalid_argument | Thrown if x and y are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::strictly_contains | ( | const Box< ITV > & | y | ) | const [inline] |
Returns true
if and only if *this
strictly contains y
.
std::invalid_argument | Thrown if x and y are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::is_disjoint_from | ( | const Box< ITV > & | y | ) | const [inline] |
Returns true
if and only if *this
and y
are disjoint.
std::invalid_argument | Thrown if x and y are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::add_constraint | ( | const Constraint & | c | ) | [inline] |
Adds a copy of constraint c
to the system of constraints defining *this
.
c | The constraint to be added. |
std::invalid_argument | Thrown if *this and constraint c are dimension-incompatible, or c is not optimally supported by the Box domain. |
void Parma_Polyhedra_Library::Box< ITV >::add_constraints | ( | const Constraint_System & | cs | ) | [inline] |
Adds the constraints in cs
to the system of constraints defining *this
.
cs | The constraints to be added. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible, or cs contains a constraint which is not optimally supported by the box domain. |
void Parma_Polyhedra_Library::Box< T >::add_recycled_constraints | ( | Constraint_System & | cs | ) | [inline] |
Adds the constraints in cs
to the system of constraints defining *this
.
cs | The constraints to be added. They may be recycled. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible, or cs contains a constraint which is not optimally supported by the box domain. |
cs
upon successful or exceptional return is that it can be safely destroyed. void Parma_Polyhedra_Library::Box< ITV >::add_congruence | ( | const Congruence & | cg | ) | [inline] |
Adds to *this
a constraint equivalent to the congruence cg
.
cg | The congruence to be added. |
std::invalid_argument | Thrown if *this and congruence cg are dimension-incompatible, or cg is not optimally supported by the box domain. |
void Parma_Polyhedra_Library::Box< ITV >::add_congruences | ( | const Congruence_System & | cgs | ) | [inline] |
Adds to *this
constraints equivalent to the congruences in cgs
.
cgs | The congruences to be added. |
std::invalid_argument | Thrown if *this and cgs are dimension-incompatible, or cgs contains a congruence which is not optimally supported by the box domain. |
void Parma_Polyhedra_Library::Box< T >::add_recycled_congruences | ( | Congruence_System & | cgs | ) | [inline] |
Adds to *this
constraints equivalent to the congruences in cgs
.
cgs | The congruence system to be added to *this . The congruences in cgs may be recycled. |
std::invalid_argument | Thrown if *this and cgs are dimension-incompatible, or cgs contains a congruence which is not optimally supported by the box domain. |
cgs
upon successful or exceptional return is that it can be safely destroyed. void Parma_Polyhedra_Library::Box< ITV >::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. |
void Parma_Polyhedra_Library::Box< ITV >::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. |
void Parma_Polyhedra_Library::Box< ITV >::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. |
void Parma_Polyhedra_Library::Box< ITV >::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. |
void Parma_Polyhedra_Library::Box< ITV >::propagate_constraint | ( | const Constraint & | c | ) | [inline] |
Use the constraint c
for constraint propagation on *this
.
c | The constraint to be used for constraint propagation. |
std::invalid_argument | Thrown if *this and c are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::propagate_constraints | ( | const Constraint_System & | cs | ) | [inline] |
Use the constraints in cs
for constraint propagagion on *this
.
cs | The constraints to be used for constraint propagation. |
std::invalid_argument | Thrown if *this and cs are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::intersection_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
the intersection of *this
and y
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::upper_bound_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
the smallest box containing the union of *this
and y
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::upper_bound_assign_if_exact | ( | const Box< ITV > & | y | ) | [inline] |
If the upper bound of *this
and y
is exact, it is assigned to *this
and true
is returned, otherwise false
is returned.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::difference_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
the difference of *this
and y
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
bool Parma_Polyhedra_Library::Box< ITV >::simplify_using_context_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
a meet-preserving simplification of *this
with respect to y
. If false
is returned, then the intersection is empty.
std::invalid_argument | Thrown if *this and y are topology-incompatible or dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::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
.
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 . |
void Parma_Polyhedra_Library::Box< ITV >::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
.
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 . |
void Parma_Polyhedra_Library::Box< ITV >::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
.
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 . |
void Parma_Polyhedra_Library::Box< ITV >::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
.
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 . |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::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 . |
void Parma_Polyhedra_Library::Box< ITV >::time_elapse_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
the result of computing the time-elapse between *this
and y
.
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::CC76_widening_assign | ( | const Box< ITV > & | y, | |
unsigned * | tp = 0 | |||
) | [inline] |
Assigns to *this
the result of computing the CC76-widening between *this
and y
.
y | A box 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. |
void Parma_Polyhedra_Library::Box< ITV >::CC76_widening_assign | ( | const Box< ITV > & | y, | |
Iterator | first, | |||
Iterator | last | |||
) | [inline] |
Assigns to *this
the result of computing the CC76-widening between *this
and y
.
y | A box that must be contained in *this . | |
first | An iterator that points to the first stop-point. | |
last | An iterator that points one past the last stop-point. |
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
void Parma_Polyhedra_Library::Box< ITV >::limited_CC76_extrapolation_assign | ( | const Box< ITV > & | y, | |
const Constraint_System & | cs, | |||
unsigned * | tp = 0 | |||
) | [inline] |
Improves the result of the CC76-extrapolation computation by also enforcing those constraints in cs
that are satisfied by all the points of *this
.
y | A box that must be contained in *this . | |
cs | The system of constraints used to improve the widened box. | |
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 , y and cs are dimension-incompatible or if cs contains a strict inequality. |
void Parma_Polyhedra_Library::Box< ITV >::CC76_narrowing_assign | ( | const Box< ITV > & | y | ) | [inline] |
Assigns to *this
the result of restoring in y
the constraints of *this
that were lost by CC76-extrapolation applications.
y | A Box that must contain *this . |
std::invalid_argument | Thrown if *this and y are dimension-incompatible. |
y
is meant to denote the value computed in the previous iteration step, whereas *this
denotes the value computed in the current iteration step (in the decreasing iteration sequence). Hence, the call x.CC76_narrowing_assign(y)
will assign to x
the result of the computation void Parma_Polyhedra_Library::Box< ITV >::add_space_dimensions_and_embed | ( | dimension_type | m | ) | [inline] |
Adds m
new dimensions and embeds the old box into the new space.
m | The number of dimensions to add. |
void Parma_Polyhedra_Library::Box< ITV >::add_space_dimensions_and_project | ( | dimension_type | m | ) | [inline] |
Adds m
new dimensions to the box and does not embed it in the new vector space.
m | The number of dimensions to add. |
void Parma_Polyhedra_Library::Box< ITV >::concatenate_assign | ( | const Box< ITV > & | y | ) | [inline] |
Seeing a box as a set of tuples (its points), assigns to *this
all the tuples that can be obtained by concatenating, in the order given, a tuple of *this
with a tuple of y
.
Let and
be the boxes corresponding, on entry, to
*this
and y
, respectively. Upon successful completion, *this
will represent the box such that
Another way of seeing it is as follows: first increases the space dimension of *this
by adding y.space_dimension()
new dimensions; then adds to the system of constraints of *this
a renamed-apart version of the constraints of y
.
void Parma_Polyhedra_Library::Box< ITV >::remove_space_dimensions | ( | const Variables_Set & | to_be_removed | ) | [inline] |
void Parma_Polyhedra_Library::Box< ITV >::remove_higher_space_dimensions | ( | dimension_type | new_dimension | ) | [inline] |
Removes the higher dimensions so that the resulting space will have dimension new_dimension
.
std::invalid_argument | Thrown if new_dimension is greater than the space dimension of *this . |
void Parma_Polyhedra_Library::Box< ITV >::map_space_dimensions | ( | const Partial_Function & | pfunc | ) | [inline] |
Remaps the dimensions of the vector space according to a partial function.
pfunc | The partial function specifying the destiny of each dimension. |
bool has_empty_codomain() const
true
if and only if the represented partial function has an empty co-domain (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
bool maps(dimension_type i, dimension_type& j) const
i
. If j
and true
is returned. If false
is returned.
The result is undefined if pfunc
does not encode a partial function with the properties described in the specification of the mapping operator.
void Parma_Polyhedra_Library::Box< ITV >::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 void Parma_Polyhedra_Library::Box< ITV >::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 const ITV & Parma_Polyhedra_Library::Box< ITV >::get_interval | ( | Variable | var | ) | const [inline] |
Returns a reference the interval that bounds var
.
std::invalid_argument | Thrown if var is not a space dimension of *this . |
void Parma_Polyhedra_Library::Box< ITV >::set_interval | ( | Variable | var, | |
const ITV & | i | |||
) | [inline] |
Sets to i
the interval that bounds var
.
std::invalid_argument | Thrown if var is not a space dimension of *this . |
bool Parma_Polyhedra_Library::Box< ITV >::get_lower_bound | ( | dimension_type | k, | |
bool & | closed, | |||
Coefficient & | n, | |||
Coefficient & | d | |||
) | const [inline] |
If the k
-th space dimension is unbounded below, returns false
. Otherwise returns true
and set closed
, n
and d
accordingly.
Let the interval corresponding to the
k
-th space dimension. If is not bounded from below, simply return
false
. Otherwise, set closed
, n
and d
as follows: closed
is set to true
if the the lower boundary of is closed and is set to
false
otherwise; n
and d
are assigned the integers and
such that the canonical fraction
corresponds to the greatest lower bound of
. The fraction
is in canonical form if and only if
and
have no common factors and
is positive,
being the unique representation for zero.
An undefined behavior is obtained if k
is greater than or equal to the space dimension of *this
.
bool Parma_Polyhedra_Library::Box< ITV >::get_upper_bound | ( | dimension_type | k, | |
bool & | closed, | |||
Coefficient & | n, | |||
Coefficient & | d | |||
) | const [inline] |
If the k
-th space dimension is unbounded above, returns false
. Otherwise returns true
and set closed
, n
and d
accordingly.
Let the interval corresponding to the
k
-th space dimension. If is not bounded from above, simply return
false
. Otherwise, set closed
, n
and d
as follows: closed
is set to true
if the the upper boundary of is closed and is set to
false
otherwise; n
and d
are assigned the integers and
such that the canonical fraction
corresponds to the least upper bound of
.
An undefined behavior is obtained if k
is greater than or equal to the space dimension of *this
.
Returns true
if and only if x
and y
are the same box.
Note that x
and y
may be dimension-incompatible boxes: in this case, the value false
is returned.
Returns true
if and only if x
and y
aren't the same box.
Note that x
and y
may be dimension-incompatible boxes: in this case, the value true
is returned.
std::ostream & operator<< | ( | std::ostream & | s, | |
const Box< ITV > & | box | |||
) | [related] |
Output operator.
bool rectilinear_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir | |||
) | [related] |
Computes the rectilinear (or Manhattan) distance between x
and y
.
If the rectilinear distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<To, Extended_Number_Policy>.
If the rectilinear distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<Temp, Extended_Number_Policy>.
bool rectilinear_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir, | |||
Temp & | tmp0, | |||
Temp & | tmp1, | |||
Temp & | tmp2 | |||
) | [related] |
Computes the rectilinear (or Manhattan) distance between x
and y
.
If the rectilinear distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using the temporary variables tmp0
, tmp1
and tmp2
.
bool euclidean_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir | |||
) | [related] |
Computes the euclidean distance between x
and y
.
If the euclidean distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<To, Extended_Number_Policy>.
If the euclidean distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<Temp, Extended_Number_Policy>.
bool euclidean_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir, | |||
Temp & | tmp0, | |||
Temp & | tmp1, | |||
Temp & | tmp2 | |||
) | [related] |
Computes the euclidean distance between x
and y
.
If the euclidean distance between x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using the temporary variables tmp0
, tmp1
and tmp2
.
bool l_infinity_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir | |||
) | [related] |
Computes the distance between
x
and y
.
If the distance between
x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<To, Extended_Number_Policy>.
If the distance between
x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using variables of type Checked_Number<Temp, Extended_Number_Policy>.
bool l_infinity_distance_assign | ( | Checked_Number< To, Extended_Number_Policy > & | r, | |
const Box< ITV > & | x, | |||
const Box< ITV > & | y, | |||
Rounding_Dir | dir, | |||
Temp & | tmp0, | |||
Temp & | tmp1, | |||
Temp & | tmp2 | |||
) | [related] |
Computes the distance between
x
and y
.
If the distance between
x
and y
is defined, stores an approximation of it into r
and returns true
; returns false
otherwise.
The direction of the approximation is specified by dir
.
All computations are performed using the temporary variables tmp0
, tmp1
and tmp2
.