PPL  1.2
Parma_Polyhedra_Library::NNC_Polyhedron Class Reference

A not necessarily closed convex polyhedron. More...

#include <NNC_Polyhedron_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::NNC_Polyhedron:
Collaboration diagram for Parma_Polyhedra_Library::NNC_Polyhedron:

Public Member Functions

 NNC_Polyhedron (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
 Builds either the universe or the empty NNC polyhedron. More...
 
 NNC_Polyhedron (const Constraint_System &cs)
 Builds an NNC polyhedron from a system of constraints. More...
 
 NNC_Polyhedron (Constraint_System &cs, Recycle_Input dummy)
 Builds an NNC polyhedron recycling a system of constraints. More...
 
 NNC_Polyhedron (const Generator_System &gs)
 Builds an NNC polyhedron from a system of generators. More...
 
 NNC_Polyhedron (Generator_System &gs, Recycle_Input dummy)
 Builds an NNC polyhedron recycling a system of generators. More...
 
 NNC_Polyhedron (const Congruence_System &cgs)
 Builds an NNC polyhedron from a system of congruences. More...
 
 NNC_Polyhedron (Congruence_System &cgs, Recycle_Input dummy)
 Builds an NNC polyhedron recycling a system of congruences. More...
 
 NNC_Polyhedron (const C_Polyhedron &y, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds an NNC polyhedron from the C polyhedron y. More...
 
template<typename Interval >
 NNC_Polyhedron (const Box< Interval > &box, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds an NNC polyhedron out of a box. More...
 
 NNC_Polyhedron (const Grid &grid, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds an NNC polyhedron out of a grid. More...
 
template<typename U >
 NNC_Polyhedron (const BD_Shape< U > &bd, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a NNC polyhedron out of a BD shape. More...
 
template<typename U >
 NNC_Polyhedron (const Octagonal_Shape< U > &os, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a NNC polyhedron out of an octagonal shape. More...
 
 NNC_Polyhedron (const NNC_Polyhedron &y, Complexity_Class complexity=ANY_COMPLEXITY)
 Ordinary copy constructor. More...
 
NNC_Polyhedronoperator= (const NNC_Polyhedron &y)
 The assignment operator. (*this and y can be dimension-incompatible.) More...
 
NNC_Polyhedronoperator= (const C_Polyhedron &y)
 Assigns to *this the C polyhedron y. More...
 
 ~NNC_Polyhedron ()
 Destructor. More...
 
bool poly_hull_assign_if_exact (const NNC_Polyhedron &y)
 If the poly-hull of *this and y is exact it is assigned to *this and true is returned, otherwise false is returned. More...
 
bool upper_bound_assign_if_exact (const NNC_Polyhedron &y)
 Same as poly_hull_assign_if_exact(y). More...
 
void positive_time_elapse_assign (const Polyhedron &y)
 Assigns to *this (the best approximation of) the result of computing the positive time-elapse between *this and y. More...
 
- Public Member Functions inherited from Parma_Polyhedra_Library::Polyhedron
template<typename Input >
Input & check_obj_space_dimension_overflow (Input &input, const Topology topol, const char *method, const char *reason)
 
dimension_type space_dimension () const
 Returns the dimension of the vector space enclosing *this. More...
 
dimension_type affine_dimension () const
 Returns $0$, if *this is empty; otherwise, returns the affine dimension of *this. More...
 
const Constraint_Systemconstraints () const
 Returns the system of constraints. More...
 
const Constraint_Systemminimized_constraints () const
 Returns the system of constraints, with no redundant constraint. More...
 
const Generator_Systemgenerators () const
 Returns the system of generators. More...
 
const Generator_Systemminimized_generators () const
 Returns the system of generators, with no redundant generator. More...
 
Congruence_System congruences () const
 Returns a system of (equality) congruences satisfied by *this. More...
 
Congruence_System minimized_congruences () const
 Returns a system of (equality) congruences satisfied by *this, with no redundant congruences and having the same affine dimension as *this. More...
 
Poly_Con_Relation relation_with (const Constraint &c) const
 Returns the relations holding between the polyhedron *this and the constraint c. More...
 
Poly_Gen_Relation relation_with (const Generator &g) const
 Returns the relations holding between the polyhedron *this and the generator g. More...
 
Poly_Con_Relation relation_with (const Congruence &cg) const
 Returns the relations holding between the polyhedron *this and the congruence c. More...
 
bool is_empty () const
 Returns true if and only if *this is an empty polyhedron. More...
 
bool is_universe () const
 Returns true if and only if *this is a universe polyhedron. More...
 
bool is_topologically_closed () const
 Returns true if and only if *this is a topologically closed subset of the vector space. More...
 
bool is_disjoint_from (const Polyhedron &y) const
 Returns true if and only if *this and y are disjoint. More...
 
bool is_discrete () const
 Returns true if and only if *this is discrete. More...
 
bool is_bounded () const
 Returns true if and only if *this is a bounded polyhedron. More...
 
bool contains_integer_point () const
 Returns true if and only if *this contains at least one integer point. More...
 
bool constrains (Variable var) const
 Returns true if and only if var is constrained in *this. More...
 
bool bounds_from_above (const Linear_Expression &expr) const
 Returns true if and only if expr is bounded from above in *this. More...
 
bool bounds_from_below (const Linear_Expression &expr) const
 Returns true if and only if expr is bounded from below in *this. More...
 
bool maximize (const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const
 Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed. More...
 
bool maximize (const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum, Generator &g) const
 Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value and a point where expr reaches it are computed. More...
 
bool minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const
 Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value is computed. More...
 
bool minimize (const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum, Generator &g) const
 Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value and a point where expr reaches it are computed. More...
 
bool frequency (const Linear_Expression &expr, Coefficient &freq_n, Coefficient &freq_d, Coefficient &val_n, Coefficient &val_d) const
 Returns true if and only if there exist a unique value val such that *this saturates the equality expr = val. More...
 
bool contains (const Polyhedron &y) const
 Returns true if and only if *this contains y. More...
 
bool strictly_contains (const Polyhedron &y) const
 Returns true if and only if *this strictly contains y. More...
 
bool OK (bool check_not_empty=false) const
 Checks if all the invariants are satisfied. More...
 
void add_constraint (const Constraint &c)
 Adds a copy of constraint c to the system of constraints of *this (without minimizing the result). More...
 
void add_generator (const Generator &g)
 Adds a copy of generator g to the system of generators of *this (without minimizing the result). More...
 
void add_congruence (const Congruence &cg)
 Adds a copy of congruence cg to *this, if cg can be exactly represented by a polyhedron. More...
 
void add_constraints (const Constraint_System &cs)
 Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the result). More...
 
void add_recycled_constraints (Constraint_System &cs)
 Adds the constraints in cs to the system of constraints of *this (without minimizing the result). More...
 
void add_generators (const Generator_System &gs)
 Adds a copy of the generators in gs to the system of generators of *this (without minimizing the result). More...
 
void add_recycled_generators (Generator_System &gs)
 Adds the generators in gs to the system of generators of *this (without minimizing the result). More...
 
void add_congruences (const Congruence_System &cgs)
 Adds a copy of the congruences in cgs to *this, if all the congruences can be exactly represented by a polyhedron. More...
 
void add_recycled_congruences (Congruence_System &cgs)
 Adds the congruences in cgs to *this, if all the congruences can be exactly represented by a polyhedron. More...
 
void refine_with_constraint (const Constraint &c)
 Uses a copy of constraint c to refine *this. More...
 
void refine_with_congruence (const Congruence &cg)
 Uses a copy of congruence cg to refine *this. More...
 
void refine_with_constraints (const Constraint_System &cs)
 Uses a copy of the constraints in cs to refine *this. More...
 
void refine_with_congruences (const Congruence_System &cgs)
 Uses a copy of the congruences in cgs to refine *this. More...
 
template<typename FP_Format , typename Interval_Info >
void refine_with_linear_form_inequality (const Linear_Form< Interval< FP_Format, Interval_Info > > &left, const Linear_Form< Interval< FP_Format, Interval_Info > > &right, bool is_strict=false)
 Refines *this with the constraint expressed by left $<$ right if is_strict is set, with the constraint left $\leq$ right otherwise. More...
 
template<typename FP_Format , typename Interval_Info >
void generalized_refine_with_linear_form_inequality (const Linear_Form< Interval< FP_Format, Interval_Info > > &left, const Linear_Form< Interval< FP_Format, Interval_Info > > &right, Relation_Symbol relsym)
 Refines *this with the constraint expressed by left $\relsym$ right, where $\relsym$ is the relation symbol specified by relsym.. More...
 
template<typename FP_Format , typename Interval_Info >
void refine_fp_interval_abstract_store (Box< Interval< FP_Format, Interval_Info > > &store) const
 Refines store with the constraints defining *this. More...
 
void unconstrain (Variable var)
 Computes the cylindrification of *this with respect to space dimension var, assigning the result to *this. More...
 
void unconstrain (const Variables_Set &vars)
 Computes the cylindrification of *this with respect to the set of space dimensions vars, assigning the result to *this. More...
 
void intersection_assign (const Polyhedron &y)
 Assigns to *this the intersection of *this and y. More...
 
void poly_hull_assign (const Polyhedron &y)
 Assigns to *this the poly-hull of *this and y. More...
 
void upper_bound_assign (const Polyhedron &y)
 Same as poly_hull_assign(y). More...
 
void poly_difference_assign (const Polyhedron &y)
 Assigns to *this the poly-difference of *this and y. More...
 
void difference_assign (const Polyhedron &y)
 Same as poly_difference_assign(y). More...
 
bool simplify_using_context_assign (const Polyhedron &y)
 Assigns to *this a meet-preserving simplification of *this with respect to y. If false is returned, then the intersection is empty. More...
 
void affine_image (Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the affine image of *this under the function mapping variable var to the affine expression specified by expr and denominator. More...
 
template<typename FP_Format , typename Interval_Info >
void affine_form_image (Variable var, const Linear_Form< Interval< FP_Format, Interval_Info > > &lf)
 
void affine_preimage (Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the affine preimage of *this under the function mapping variable var to the affine expression specified by expr and denominator. More...
 
void generalized_affine_image (Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. More...
 
void generalized_affine_preimage (Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{var}' \relsym \frac{\mathrm{expr}}{\mathrm{denominator}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. More...
 
void generalized_affine_image (const Linear_Expression &lhs, Relation_Symbol relsym, const Linear_Expression &rhs)
 Assigns to *this the image of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. More...
 
void generalized_affine_preimage (const Linear_Expression &lhs, Relation_Symbol relsym, const Linear_Expression &rhs)
 Assigns to *this the preimage of *this with respect to the generalized affine relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym. More...
 
void bounded_affine_image (Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the image of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$. More...
 
void bounded_affine_preimage (Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())
 Assigns to *this the preimage of *this with respect to the bounded affine relation $\frac{\mathrm{lb\_expr}}{\mathrm{denominator}} \leq \mathrm{var}' \leq \frac{\mathrm{ub\_expr}}{\mathrm{denominator}}$. More...
 
void time_elapse_assign (const Polyhedron &y)
 Assigns to *this the result of computing the time-elapse between *this and y. More...
 
void positive_time_elapse_assign (const Polyhedron &y)
 Assigns to *this (the best approximation of) the result of computing the positive time-elapse between *this and y. More...
 
void wrap_assign (const Variables_Set &vars, Bounded_Integer_Type_Width w, Bounded_Integer_Type_Representation r, Bounded_Integer_Type_Overflow o, const Constraint_System *cs_p=0, unsigned complexity_threshold=16, bool wrap_individually=true)
 Wraps the specified dimensions of the vector space. More...
 
void drop_some_non_integer_points (Complexity_Class complexity=ANY_COMPLEXITY)
 Possibly tightens *this by dropping some points with non-integer coordinates. More...
 
void drop_some_non_integer_points (const Variables_Set &vars, Complexity_Class complexity=ANY_COMPLEXITY)
 Possibly tightens *this by dropping some points with non-integer coordinates for the space dimensions corresponding to vars. More...
 
void topological_closure_assign ()
 Assigns to *this its topological closure. More...
 
void BHRZ03_widening_assign (const Polyhedron &y, unsigned *tp=0)
 Assigns to *this the result of computing the BHRZ03-widening between *this and y. More...
 
void limited_BHRZ03_extrapolation_assign (const Polyhedron &y, const Constraint_System &cs, unsigned *tp=0)
 Assigns to *this the result of computing the limited extrapolation between *this and y using the BHRZ03-widening operator. More...
 
void bounded_BHRZ03_extrapolation_assign (const Polyhedron &y, const Constraint_System &cs, unsigned *tp=0)
 Assigns to *this the result of computing the bounded extrapolation between *this and y using the BHRZ03-widening operator. More...
 
void H79_widening_assign (const Polyhedron &y, unsigned *tp=0)
 Assigns to *this the result of computing the H79_widening between *this and y. More...
 
void widening_assign (const Polyhedron &y, unsigned *tp=0)
 Same as H79_widening_assign(y, tp). More...
 
void limited_H79_extrapolation_assign (const Polyhedron &y, const Constraint_System &cs, unsigned *tp=0)
 Assigns to *this the result of computing the limited extrapolation between *this and y using the H79-widening operator. More...
 
void bounded_H79_extrapolation_assign (const Polyhedron &y, const Constraint_System &cs, unsigned *tp=0)
 Assigns to *this the result of computing the bounded extrapolation between *this and y using the H79-widening operator. More...
 
void add_space_dimensions_and_embed (dimension_type m)
 Adds m new space dimensions and embeds the old polyhedron in the new vector space. More...
 
void add_space_dimensions_and_project (dimension_type m)
 Adds m new space dimensions to the polyhedron and does not embed it in the new vector space. More...
 
void concatenate_assign (const Polyhedron &y)
 Assigns to *this the concatenation of *this and y, taken in this order. More...
 
void remove_space_dimensions (const Variables_Set &vars)
 Removes all the specified dimensions from the vector space. More...
 
void remove_higher_space_dimensions (dimension_type new_dimension)
 Removes the higher dimensions of the vector space so that the resulting space will have dimension new_dimension. More...
 
template<typename Partial_Function >
void map_space_dimensions (const Partial_Function &pfunc)
 Remaps the dimensions of the vector space according to a partial function. More...
 
void expand_space_dimension (Variable var, dimension_type m)
 Creates m copies of the space dimension corresponding to var. More...
 
void fold_space_dimensions (const Variables_Set &vars, Variable dest)
 Folds the space dimensions in vars into dest. More...
 
 ~Polyhedron ()
 Destructor. More...
 
void m_swap (Polyhedron &y)
 Swaps *this with polyhedron y. (*this and y can be dimension-incompatible.) More...
 
void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this. More...
 
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this. More...
 
void print () const
 Prints *this to std::cerr using operator<<. More...
 
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. More...
 
memory_size_type total_memory_in_bytes () const
 Returns the total size in bytes of the memory occupied by *this. More...
 
memory_size_type external_memory_in_bytes () const
 Returns the size in bytes of the memory managed by *this. More...
 
int32_t hash_code () const
 Returns a 32-bit hash code for *this. More...
 

Additional Inherited Members

- Public Types inherited from Parma_Polyhedra_Library::Polyhedron
typedef Coefficient coefficient_type
 The numeric type of coefficients. More...
 
- Static Public Member Functions inherited from Parma_Polyhedra_Library::Polyhedron
static dimension_type max_space_dimension ()
 Returns the maximum space dimension all kinds of Polyhedron can handle. More...
 
static bool can_recycle_constraint_systems ()
 Returns true indicating that this domain has methods that can recycle constraints. More...
 
static void initialize ()
 Initializes the class. More...
 
static void finalize ()
 Finalizes the class. More...
 
static bool can_recycle_congruence_systems ()
 Returns false indicating that this domain cannot recycle congruences. More...
 
- Protected Member Functions inherited from Parma_Polyhedra_Library::Polyhedron
 Polyhedron (Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
 Builds a polyhedron having the specified properties. More...
 
 Polyhedron (const Polyhedron &y, Complexity_Class complexity=ANY_COMPLEXITY)
 Ordinary copy constructor. More...
 
 Polyhedron (Topology topol, const Constraint_System &cs)
 Builds a polyhedron from a system of constraints. More...
 
 Polyhedron (Topology topol, Constraint_System &cs, Recycle_Input dummy)
 Builds a polyhedron recycling a system of constraints. More...
 
 Polyhedron (Topology topol, const Generator_System &gs)
 Builds a polyhedron from a system of generators. More...
 
 Polyhedron (Topology topol, Generator_System &gs, Recycle_Input dummy)
 Builds a polyhedron recycling a system of generators. More...
 
template<typename Interval >
 Polyhedron (Topology topol, const Box< Interval > &box, Complexity_Class complexity=ANY_COMPLEXITY)
 Builds a polyhedron from a box. More...
 
Polyhedronoperator= (const Polyhedron &y)
 The assignment operator. (*this and y can be dimension-incompatible.) More...
 
bool BFT00_poly_hull_assign_if_exact (const Polyhedron &y)
 If the poly-hull of *this and y is exact it is assigned to *this and true is returned, otherwise false is returned. More...
 
bool BHZ09_poly_hull_assign_if_exact (const Polyhedron &y)
 
bool BHZ09_C_poly_hull_assign_if_exact (const Polyhedron &y)
 
bool BHZ09_NNC_poly_hull_assign_if_exact (const Polyhedron &y)
 
void drop_some_non_integer_points (const Variables_Set *vars_p, Complexity_Class complexity)
 Possibly tightens *this by dropping some points with non-integer coordinates for the space dimensions corresponding to *vars_p. More...
 
template<typename FP_Format , typename Interval_Info >
void overapproximate_linear_form (const Linear_Form< Interval< FP_Format, Interval_Info > > &lf, const dimension_type lf_dimension, Linear_Form< Interval< FP_Format, Interval_Info > > &result)
 Helper function that overapproximates an interval linear form. More...
 
void positive_time_elapse_assign_impl (const Polyhedron &y)
 Assuming *this is NNC, assigns to *this the result of the "positive time-elapse" between *this and y. More...
 
void throw_invalid_argument (const char *method, const char *reason) const
 
void throw_topology_incompatible (const char *method, const char *ph_name, const Polyhedron &ph) const
 
void throw_topology_incompatible (const char *method, const char *c_name, const Constraint &c) const
 
void throw_topology_incompatible (const char *method, const char *g_name, const Generator &g) const
 
void throw_topology_incompatible (const char *method, const char *cs_name, const Constraint_System &cs) const
 
void throw_topology_incompatible (const char *method, const char *gs_name, const Generator_System &gs) const
 
void throw_dimension_incompatible (const char *method, const char *other_name, dimension_type other_dim) const
 
void throw_dimension_incompatible (const char *method, const char *ph_name, const Polyhedron &ph) const
 
void throw_dimension_incompatible (const char *method, const char *le_name, const Linear_Expression &le) const
 
void throw_dimension_incompatible (const char *method, const char *c_name, const Constraint &c) const
 
void throw_dimension_incompatible (const char *method, const char *g_name, const Generator &g) const
 
void throw_dimension_incompatible (const char *method, const char *cg_name, const Congruence &cg) const
 
void throw_dimension_incompatible (const char *method, const char *cs_name, const Constraint_System &cs) const
 
void throw_dimension_incompatible (const char *method, const char *gs_name, const Generator_System &gs) const
 
void throw_dimension_incompatible (const char *method, const char *cgs_name, const Congruence_System &cgs) const
 
template<typename C >
void throw_dimension_incompatible (const char *method, const char *lf_name, const Linear_Form< C > &lf) const
 
void throw_dimension_incompatible (const char *method, const char *var_name, Variable var) const
 
void throw_dimension_incompatible (const char *method, dimension_type required_space_dim) const
 
void throw_invalid_generator (const char *method, const char *g_name) const
 
void throw_invalid_generators (const char *method, const char *gs_name) const
 
- Static Protected Member Functions inherited from Parma_Polyhedra_Library::Polyhedron
template<typename FP_Format , typename Interval_Info >
static void convert_to_integer_expression (const Linear_Form< Interval< FP_Format, Interval_Info > > &lf, const dimension_type lf_dimension, Linear_Expression &result)
 Helper function that makes result become a Linear_Expression obtained by normalizing the denominators in lf. More...
 
template<typename FP_Format , typename Interval_Info >
static void convert_to_integer_expressions (const Linear_Form< Interval< FP_Format, Interval_Info > > &lf, const dimension_type lf_dimension, Linear_Expression &res, Coefficient &res_low_coeff, Coefficient &res_hi_coeff, Coefficient &denominator)
 Normalization helper function. More...
 
template<typename Linear_System1 , typename Row2 >
static bool add_to_system_and_check_independence (Linear_System1 &eq_sys, const Row2 &eq)
 
static dimension_type check_space_dimension_overflow (dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
 
static dimension_type check_space_dimension_overflow (dimension_type dim, const Topology topol, const char *method, const char *reason)
 
template<typename Object >
static Object & check_obj_space_dimension_overflow (Object &input, Topology topol, const char *method, const char *reason)
 

Detailed Description

A not necessarily closed convex polyhedron.

An object of the class NNC_Polyhedron represents a not necessarily closed (NNC) convex polyhedron in the vector space $\Rset^n$.

Note
Since NNC polyhedra are a generalization of closed polyhedra, any object of the class C_Polyhedron can be (explicitly) converted into an object of the class NNC_Polyhedron. The reason for defining two different classes is that objects of the class C_Polyhedron are characterized by a more efficient implementation, requiring less time and memory resources.

Definition at line 46 of file NNC_Polyhedron_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( dimension_type  num_dimensions = 0,
Degenerate_Element  kind = UNIVERSE 
)
inlineexplicit

Builds either the universe or the empty NNC polyhedron.

Parameters
num_dimensionsThe number of dimensions of the vector space enclosing the NNC polyhedron;
kindSpecifies whether a universe or an empty NNC polyhedron should be built.
Exceptions
std::length_errorThrown if num_dimensions exceeds the maximum allowed space dimension.

Both parameters are optional: by default, a 0-dimension space universe NNC polyhedron is built.

Definition at line 36 of file NNC_Polyhedron_inlines.hh.

39  check_space_dimension_overflow(num_dimensions,
41  "NNC_Polyhedron(n, k)",
42  "n exceeds the maximum "
43  "allowed space dimension"),
44  kind) {
45 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Constraint_System cs)
inlineexplicit

Builds an NNC polyhedron from a system of constraints.

The polyhedron inherits the space dimension of the constraint system.

Parameters
csThe system of constraints defining the polyhedron.

Definition at line 48 of file NNC_Polyhedron_inlines.hh.

51  "NNC_Polyhedron(cs)",
52  "the space dimension of cs "
53  "exceeds the maximum allowed "
54  "space dimension")) {
55 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static Object & check_obj_space_dimension_overflow(Object &input, Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( Constraint_System cs,
Recycle_Input  dummy 
)
inline

Builds an NNC polyhedron recycling a system of constraints.

The polyhedron inherits the space dimension of the constraint system.

Parameters
csThe system of constraints defining the polyhedron. It is not declared const because its data-structures may be recycled to build the polyhedron.
dummyA dummy tag to syntactically differentiate this one from the other constructors.

Definition at line 58 of file NNC_Polyhedron_inlines.hh.

61  "NNC_Polyhedron(cs, recycle)",
62  "the space dimension of cs "
63  "exceeds the maximum allowed "
64  "space dimension"),
65  Recycle_Input()) {
66 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static Object & check_obj_space_dimension_overflow(Object &input, Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Generator_System gs)
inlineexplicit

Builds an NNC polyhedron from a system of generators.

The polyhedron inherits the space dimension of the generator system.

Parameters
gsThe system of generators defining the polyhedron.
Exceptions
std::invalid_argumentThrown if the system of generators is not empty but has no points.

Definition at line 69 of file NNC_Polyhedron_inlines.hh.

72  "NNC_Polyhedron(gs)",
73  "the space dimension of gs "
74  "exceeds the maximum allowed "
75  "space dimension")) {
76 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static Object & check_obj_space_dimension_overflow(Object &input, Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( Generator_System gs,
Recycle_Input  dummy 
)
inline

Builds an NNC polyhedron recycling a system of generators.

The polyhedron inherits the space dimension of the generator system.

Parameters
gsThe system of generators defining the polyhedron. It is not declared const because its data-structures may be recycled to build the polyhedron.
dummyA dummy tag to syntactically differentiate this one from the other constructors.
Exceptions
std::invalid_argumentThrown if the system of generators is not empty but has no points.

Definition at line 79 of file NNC_Polyhedron_inlines.hh.

82  "NNC_Polyhedron(gs, recycle)",
83  "the space dimension of gs "
84  "exceeds the maximum allowed "
85  "space dimension"),
86  Recycle_Input()) {
87 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static Object & check_obj_space_dimension_overflow(Object &input, Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Congruence_System cgs)
explicit

Builds an NNC polyhedron from a system of congruences.

The polyhedron inherits the space dimension of the congruence system.

Parameters
cgsThe system of congruences defining the polyhedron. It is not declared const because its data-structures may be recycled to build the polyhedron.

Definition at line 38 of file NNC_Polyhedron.cc.

References Parma_Polyhedra_Library::Polyhedron::add_congruences(), and Parma_Polyhedra_Library::Polyhedron::OK().

40  check_space_dimension_overflow(cgs.space_dimension(),
42  "NNC_Polyhedron(cgs)",
43  "the space dimension of cgs "
44  "exceeds the maximum allowed "
45  "space dimension"),
46  UNIVERSE) {
47  add_congruences(cgs);
48  PPL_ASSERT_HEAVY(OK());
49 }
void add_congruences(const Congruence_System &cgs)
Adds a copy of the congruences in cgs to *this, if all the congruences can be exactly represented by ...
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
The universe element, i.e., the whole vector space.
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( Congruence_System cgs,
Recycle_Input  dummy 
)

Builds an NNC polyhedron recycling a system of congruences.

The polyhedron inherits the space dimension of the congruence system.

Parameters
cgsThe system of congruences defining the polyhedron. It is not declared const because its data-structures may be recycled to build the polyhedron.
dummyA dummy tag to syntactically differentiate this one from the other constructors.

Definition at line 51 of file NNC_Polyhedron.cc.

References Parma_Polyhedra_Library::Polyhedron::add_congruences(), and Parma_Polyhedra_Library::Polyhedron::OK().

53  check_space_dimension_overflow(cgs.space_dimension(),
55  "NNC_Polyhedron(cgs, recycle)",
56  "the space dimension of cgs "
57  "exceeds the maximum allowed "
58  "space dimension"),
59  UNIVERSE) {
60  add_congruences(cgs);
61  PPL_ASSERT_HEAVY(OK());
62 }
void add_congruences(const Congruence_System &cgs)
Adds a copy of the congruences in cgs to *this, if all the congruences can be exactly represented by ...
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
The universe element, i.e., the whole vector space.
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const C_Polyhedron y,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
explicit

Builds an NNC polyhedron from the C polyhedron y.

Parameters
yThe C polyhedron to be used;
complexityThis argument is ignored.

Definition at line 32 of file NNC_Polyhedron.cc.

References Parma_Polyhedra_Library::Polyhedron::add_constraints(), Parma_Polyhedra_Library::Polyhedron::constraints(), and Parma_Polyhedra_Library::Polyhedron::OK().

33  : Polyhedron(NOT_NECESSARILY_CLOSED, y.space_dimension(), UNIVERSE) {
34  add_constraints(y.constraints());
35  PPL_ASSERT_HEAVY(OK());
36 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
The universe element, i.e., the whole vector space.
void add_constraints(const Constraint_System &cs)
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
template<typename Interval >
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Box< Interval > &  box,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
inlineexplicit

Builds an NNC polyhedron out of a box.

The polyhedron inherits the space dimension of the box and is the most precise that includes the box.

Parameters
boxThe box representing the polyhedron to be built;
complexityThis argument is ignored as the algorithm used has polynomial complexity.
Exceptions
std::length_errorThrown if the space dimension of box exceeds the maximum allowed space dimension.

Definition at line 91 of file NNC_Polyhedron_inlines.hh.

94  "NNC_Polyhedron(box)",
95  "the space dimension of box "
96  "exceeds the maximum allowed "
97  "space dimension")) {
98 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static Object & check_obj_space_dimension_overflow(Object &input, Topology topol, const char *method, const char *reason)
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Grid grid,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
explicit

Builds an NNC polyhedron out of a grid.

The polyhedron inherits the space dimension of the grid and is the most precise that includes the grid.

Parameters
gridThe grid used to build the polyhedron.
complexityThis argument is ignored as the algorithm used has polynomial complexity.

Definition at line 64 of file NNC_Polyhedron.cc.

References Parma_Polyhedra_Library::Polyhedron::add_constraints(), and Parma_Polyhedra_Library::Grid::constraints().

66  check_space_dimension_overflow(grid.space_dimension(),
68  "NNC_Polyhedron(grid)",
69  "the space dimension of grid "
70  "exceeds the maximum allowed "
71  "space dimension"),
72  UNIVERSE) {
73  add_constraints(grid.constraints());
74 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
The universe element, i.e., the whole vector space.
void add_constraints(const Constraint_System &cs)
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
template<typename U >
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const BD_Shape< U > &  bd,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
inlineexplicit

Builds a NNC polyhedron out of a BD shape.

The polyhedron inherits the space dimension of the BD shape and is the most precise that includes the BD shape.

Parameters
bdThe BD shape used to build the polyhedron.
complexityThis argument is ignored as the algorithm used has polynomial complexity.

Definition at line 102 of file NNC_Polyhedron_inlines.hh.

References Parma_Polyhedra_Library::Polyhedron::add_constraints(), and Parma_Polyhedra_Library::BD_Shape< T >::constraints().

104  check_space_dimension_overflow(bd.space_dimension(),
106  "NNC_Polyhedron(bd)",
107  "the space dimension of bd "
108  "exceeds the maximum allowed "
109  "space dimension"),
110  UNIVERSE) {
111  add_constraints(bd.constraints());
112 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
The universe element, i.e., the whole vector space.
void add_constraints(const Constraint_System &cs)
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
template<typename U >
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const Octagonal_Shape< U > &  os,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
inlineexplicit

Builds a NNC polyhedron out of an octagonal shape.

The polyhedron inherits the space dimension of the octagonal shape and is the most precise that includes the octagonal shape.

Parameters
osThe octagonal shape used to build the polyhedron.
complexityThis argument is ignored as the algorithm used has polynomial complexity.

Definition at line 116 of file NNC_Polyhedron_inlines.hh.

References Parma_Polyhedra_Library::Polyhedron::add_constraints(), and Parma_Polyhedra_Library::Octagonal_Shape< T >::constraints().

118  check_space_dimension_overflow(os.space_dimension(),
120  "NNC_Polyhedron(os)",
121  "the space dimension of os "
122  "exceeds the maximum allowed "
123  "space dimension"),
124  UNIVERSE) {
125  add_constraints(os.constraints());
126 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
static dimension_type check_space_dimension_overflow(dimension_type dim, dimension_type max, const Topology topol, const char *method, const char *reason)
The universe element, i.e., the whole vector space.
void add_constraints(const Constraint_System &cs)
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
Parma_Polyhedra_Library::NNC_Polyhedron::NNC_Polyhedron ( const NNC_Polyhedron y,
Complexity_Class  complexity = ANY_COMPLEXITY 
)
inline

Ordinary copy constructor.

Definition at line 129 of file NNC_Polyhedron_inlines.hh.

130  : Polyhedron(y) {
131 }
Polyhedron(Topology topol, dimension_type num_dimensions, Degenerate_Element kind)
Builds a polyhedron having the specified properties.
Parma_Polyhedra_Library::NNC_Polyhedron::~NNC_Polyhedron ( )
inline

Destructor.

Definition at line 32 of file NNC_Polyhedron_inlines.hh.

32  {
33 }

Member Function Documentation

NNC_Polyhedron & Parma_Polyhedra_Library::NNC_Polyhedron::operator= ( const NNC_Polyhedron y)
inline

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

Definition at line 134 of file NNC_Polyhedron_inlines.hh.

References Parma_Polyhedra_Library::Polyhedron::operator=().

134  {
136  return *this;
137 }
Polyhedron & operator=(const Polyhedron &y)
The assignment operator. (*this and y can be dimension-incompatible.)
NNC_Polyhedron & Parma_Polyhedra_Library::NNC_Polyhedron::operator= ( const C_Polyhedron y)
inline

Assigns to *this the C polyhedron y.

Definition at line 140 of file NNC_Polyhedron_inlines.hh.

References Parma_Polyhedra_Library::Polyhedron::m_swap().

140  {
141  NNC_Polyhedron nnc_y(y);
142  m_swap(nnc_y);
143  return *this;
144 }
NNC_Polyhedron(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds either the universe or the empty NNC polyhedron.
void m_swap(Polyhedron &y)
Swaps *this with polyhedron y. (*this and y can be dimension-incompatible.)
bool Parma_Polyhedra_Library::NNC_Polyhedron::poly_hull_assign_if_exact ( const NNC_Polyhedron y)

If the poly-hull of *this and y is exact it is assigned to *this and true is returned, otherwise false is returned.

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

Definition at line 77 of file NNC_Polyhedron.cc.

References Parma_Polyhedra_Library::Polyhedron::space_dimension().

Referenced by upper_bound_assign_if_exact().

77  {
78 #define USE_BHZ09 1
79 #if USE_BHZ09 // [BagnaraHZ09]
80  // Dimension-compatibility check.
81  if (space_dimension() != y.space_dimension()) {
82  throw_dimension_incompatible("poly_hull_assign_if_exact(y)", "y", y);
83  }
85 #else // Old implementation.
86  return PPL::poly_hull_assign_if_exact(*this, y);
87 #endif
88 #undef USE_BHZ09
89 }
void throw_dimension_incompatible(const char *method, const char *other_name, dimension_type other_dim) const
bool BHZ09_poly_hull_assign_if_exact(const Polyhedron &y)
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void Parma_Polyhedra_Library::NNC_Polyhedron::positive_time_elapse_assign ( const Polyhedron y)
inline

Assigns to *this (the best approximation of) the result of computing the positive time-elapse between *this and y.

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

Definition at line 152 of file NNC_Polyhedron_inlines.hh.

References Parma_Polyhedra_Library::Polyhedron::positive_time_elapse_assign_impl().

Referenced by Parma_Polyhedra_Library::C_Polyhedron::positive_time_elapse_assign().

152  {
154 }
void positive_time_elapse_assign_impl(const Polyhedron &y)
Assuming *this is NNC, assigns to *this the result of the "positive time-elapse" between *this and y...
bool Parma_Polyhedra_Library::NNC_Polyhedron::upper_bound_assign_if_exact ( const NNC_Polyhedron y)
inline

Same as poly_hull_assign_if_exact(y).

Definition at line 147 of file NNC_Polyhedron_inlines.hh.

References poly_hull_assign_if_exact().

147  {
148  return poly_hull_assign_if_exact(y);
149 }
bool poly_hull_assign_if_exact(const NNC_Polyhedron &y)
If the poly-hull of *this and y is exact it is assigned to *this and true is returned, otherwise false is returned.

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