24 #ifndef PPL_Polyhedron_inlines_hh
25 #define PPL_Polyhedron_inlines_hh 1
54 return min(std::numeric_limits<dimension_type>::max() - 1,
315 return bounds(expr,
true);
320 return bounds(expr,
false);
326 bool& maximum)
const {
328 return max_min(expr,
true, sup_n, sup_d, maximum, g);
335 return max_min(expr,
true, sup_n, sup_d, maximum, g);
341 bool& minimum)
const {
343 return max_min(expr,
false, inf_n, inf_d, minimum, g);
350 return max_min(expr,
false, inf_n, inf_d, minimum, g);
381 template <
typename FP_Format,
typename Interval_Info>
413 template <
typename FP_Format,
typename Interval_Info>
421 "Polyhedron::refine_fp_interval_abstract_store:"
422 " T not a floating point type.");
454 namespace Interfaces {
465 #endif // !defined(PPL_Polyhedron_inlines_hh)
bool has_pending_constraints() const
Returns true if there are pending constraints.
bool constraints_are_minimized() const
Returns true if the system of constraints is minimized.
void drop_some_non_integer_points(Complexity_Class complexity=ANY_COMPLEXITY)
Possibly tightens *this by dropping some points with non-integer coordinates.
void widening_assign(const Polyhedron &y, unsigned *tp=0)
Same as H79_widening_assign(y, tp).
bool marked_empty() const
Returns true if the polyhedron is known to be empty.
int32_t hash_code() const
Returns a 32-bit hash code for *this.
void set_sat_g_up_to_date()
Sets status to express that sat_g is up-to-date.
bool bounds_from_above(const Linear_Expression &expr) const
Returns true if and only if expr is bounded from above in *this.
void swap(CO_Tree &x, CO_Tree &y)
bool minimize() const
Applies (weak) minimization to both the constraints and generators.
void clear_constraints_up_to_date()
Sets status to express that constraints are no longer up-to-date.
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool max_min(const Linear_Expression &expr, bool maximize, Coefficient &ext_n, Coefficient &ext_d, bool &included, Generator &g) const
Maximizes or minimizes expr subject to *this.
An std::set of variables' indexes.
void poly_difference_assign(const Polyhedron &y)
Assigns to *this the poly-difference of *this and y.
Generator_System gen_sys
The system of generators.
A line, ray, point or closure point.
bool generators_are_minimized() const
Returns true if the system of generators is minimized.
bool is_empty() const
Returns true if and only if *this is an empty polyhedron.
void simplify()
Applies Gaussian elimination and back-substitution so as to provide a partial simplification of the s...
void set_generators_up_to_date()
Sets status to express that generators are up-to-date.
Congruence_System minimized_congruences() const
Returns a system of (equality) congruences satisfied by *this, with no redundant congruences and havi...
void set_constraints_pending()
Sets status to express that constraints are pending.
void clear_pending_generators()
Sets status to express that there are no longer pending generators.
bool is_necessarily_closed() const
Returns true if and only if the system topology is NECESSARILY_CLOSED.
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 ...
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 right, where is the relation symbol specified b...
static bool can_recycle_congruence_systems()
Returns false indicating that this domain cannot recycle congruences.
bool sat_c_is_up_to_date() const
Returns true if the saturation matrix sat_c is up-to-date.
dimension_type num_pending_rows() const
Returns the number of rows that are in the pending part of the system.
void set_constraints_up_to_date()
Sets status to express that constraints are up-to-date.
void swap(Polyhedron &x, Polyhedron &y)
Swaps x with y.
bool sat_g_is_up_to_date() const
Returns true if the saturation matrix sat_g is up-to-date.
bool strictly_contains(const Polyhedron &y) const
Returns true if and only if *this strictly contains y.
Topology topology() const
Returns the system topology.
bool test_sat_g_up_to_date() const
void H79_widening_assign(const Polyhedron &y, unsigned *tp=0)
Assigns to *this the result of computing the H79_widening between *this and y.
bool bounds_from_below(const Linear_Expression &expr) const
Returns true if and only if expr is bounded from below in *this.
void reset_g_up_to_date()
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 l...
bool test_sat_c_up_to_date() const
void add_recycled_congruences(Congruence_System &cgs)
Adds the congruences in cgs to *this, if all the congruences can be exactly represented by a polyhedr...
bool can_have_something_pending() const
Returns true if the polyhedron can have something pending.
bool test_c_minimized() const
Complexity_Class
Complexity pseudo-classes.
bool test_g_pending() const
The base class for convex polyhedra.
void set_sat_c_up_to_date()
Sets status to express that sat_c is up-to-date.
Constraint_System simplified_constraints() const
If constraints are up-to-date, obtain a simplified copy of them.
Topology topology() const
Returns the topological kind of the polyhedron.
bool generators_are_up_to_date() const
Returns true if the system of generators is up-to-date.
Constraint_System con_sys
The system of constraints.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
bool process_pending() const
Processes the pending rows of either description of the polyhedron and obtains a minimized polyhedron...
#define PPL_COMPILE_TIME_CHECK(e, msg)
Produces a compilation error if the compile-time constant e does not evaluate to true ...
void clear_pending_constraints()
Sets status to express that there are no longer pending constraints.
Relation_Symbol
Relation symbols.
void set_sat_c_up_to_date()
bool constraints_are_up_to_date() const
Returns true if the system of constraints is up-to-date.
void throw_topology_incompatible(const char *method, const char *ph_name, const Polyhedron &ph) const
Greater than or equal to.
Bit_Matrix sat_g
The saturation matrix having generators on its columns.
void set_generators_minimized()
Sets status to express that generators are minimized.
static dimension_type max_space_dimension()
Returns the maximum space dimension all kinds of Polyhedron can handle.
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.
void refine_fp_interval_abstract_store(Box< Interval< FP_Format, Interval_Info > > &store) const
Refines store with the constraints defining *this.
void reset_sat_c_up_to_date()
A not necessarily closed, iso-oriented hyperrectangle.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
int32_t hash_code_from_dimension(dimension_type dim)
Returns the hash code for space dimension dim.
bool test_g_up_to_date() const
void process_pending_generators() const
Processes the pending generators and obtains a minimized polyhedron.
void clear_empty()
Clears the status flag indicating that the polyhedron is empty.
Status status
The status flags to keep track of the polyhedron's internal state.
bool operator!=(const Polyhedron &x, const Polyhedron &y)
A generic, not necessarily closed, possibly restricted interval.
bool test_c_pending() const
static dimension_type max_space_dimension()
Returns the maximum space dimension a Constraint_System can handle.
The entire library is confined to this namespace.
void set_sat_g_up_to_date()
dimension_type space_dim
The number of dimensions of the enclosing vector space.
void difference_assign(const Polyhedron &y)
Same as poly_difference_assign(y).
bool bounds(const Linear_Expression &expr, bool from_above) const
Checks if and how expr is bounded in *this.
void upper_bound_assign(const Polyhedron &y)
Same as poly_hull_assign(y).
Congruence_System congruences() const
Returns a system of (equality) congruences satisfied by *this.
bool contains(const Polyhedron &y) const
Returns true if and only if *this contains y.
void poly_hull_assign(const Polyhedron &y)
Assigns to *this the poly-hull of *this and y.
bool is_necessarily_closed() const
Returns true if and only if the polyhedron is necessarily closed.
void clear_sat_g_up_to_date()
Sets status to express that sat_g is no longer up-to-date.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
bool test_g_minimized() const
bool process_pending_constraints() const
Processes the pending constraints and obtains a minimized polyhedron.
void clear_constraints_minimized()
Sets status to express that constraints are no longer minimized.
void reset_sat_g_up_to_date()
void reset_c_up_to_date()
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
bool has_pending_generators() const
Returns true if there are pending generators.
dimension_type affine_dimension() const
Returns , if *this is empty; otherwise, returns the affine dimension of *this.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Generator_System can handle.
void clear_sat_c_up_to_date()
Sets status to express that sat_c is no longer up-to-date.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
Bit_Matrix sat_c
The saturation matrix having constraints on its columns.
void set_constraints_minimized()
Sets status to express that constraints are minimized.
static bool can_recycle_constraint_systems()
Returns true indicating that this domain has methods that can recycle constraints.
void set_generators_pending()
Sets status to express that generators are pending.
const Constraint_System & minimized_constraints() const
Returns the system of constraints, with no redundant constraint.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool test_c_up_to_date() const
bool is_necessarily_closed_for_interfaces(const Polyhedron &ph)
Returns true if and only if ph.topology() == NECESSARILY_CLOSED.
void m_swap(Polyhedron &y)
Swaps *this with polyhedron y. (*this and y can be dimension-incompatible.)
void clear_generators_up_to_date()
Sets status to express that generators are no longer up-to-date.
bool is_discrete() const
Returns true if and only if *this is discrete.
Topology
Kinds of polyhedra domains.
void clear_generators_minimized()
Sets status to express that generators are no longer minimized.
bool has_something_pending() const
Returns true if there are either pending constraints or pending generators.