24 #ifndef PPL_Grid_inlines_hh
25 #define PPL_Grid_inlines_hh 1
114 return std::min(std::numeric_limits<dimension_type>::max() - 1,
129 "n exceeds the maximum "
130 "allowed space dimension")) {
141 "the space dimension of cgs "
142 "exceeds the maximum allowed "
144 gen_sys(cgs.space_dimension()) {
154 "Grid(cgs, recycle)",
155 "the space dimension of cgs "
156 "exceeds the maximum allowed "
158 gen_sys(cgs.space_dimension()) {
168 "the space dimension of ggs "
169 "exceeds the maximum allowed "
171 gen_sys(ggs.space_dimension()) {
181 "Grid(ggs, recycle)",
182 "the space dimension of ggs "
183 "exceeds the maximum allowed "
185 gen_sys(ggs.space_dimension()) {
189 template <
typename U>
196 "the space dimension of bd "
197 "exceeds the maximum allowed "
199 gen_sys(bd.space_dimension()) {
204 template <
typename U>
211 "the space dimension of os "
212 "exceeds the maximum allowed "
214 gen_sys(os.space_dimension()) {
323 return bounds(expr,
"bounds_from_above(e)");
328 return bounds(expr,
"bounds_from_below(e)");
334 return max_min(expr,
"maximize(e, ...)", sup_n, sup_d, maximum);
341 return max_min(expr,
"maximize(e, ...)", sup_n, sup_d, maximum, &point);
347 return max_min(expr,
"minimize(e, ...)", inf_n, inf_d, minimum);
354 return max_min(expr,
"minimize(e, ...)", inf_n, inf_d, minimum, &point);
372 const Grid& x = *
this;
388 #endif // !defined(PPL_Grid_inlines_hh)
Grid_Generator_System gen_sys
The system of generators.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
dimension_type max_space_dimension()
Returns the maximum space dimension this library can handle.
Status status
The status flags to keep track of the grid's internal state.
void clear_congruences_minimized()
Sets status to express that congruences are no longer minimized.
A linear equality or inequality.
void swap(CO_Tree &x, CO_Tree &y)
void clear_generators_up_to_date()
Sets status to express that generators are out of date.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
Grid(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds a grid having the specified properties.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Congruence_System can handle.
void add_constraints(const Constraint_System &cs)
Adds to *this congruences equivalent to the constraints in cs.
size_t dimension_type
An unsigned integral type for representing space dimensions.
Congruence_System congruences() const
Returns a system of (equality) congruences satisfied by *this.
Congruence_System con_sys
The system of congruences.
const Congruence_System & congruences() const
Returns the system of congruences.
A line, ray, point or closure point.
void clear_generators_minimized()
Sets status to express that generators are no longer minimized.
void add_congruence_no_check(const Congruence &cg)
Adds the congruence cg to *this.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
Constraint_System minimized_constraints() const
Returns a minimal system of equality constraints satisfied by *this with the same affine dimension as...
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
bool bounds_from_above(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
static bool can_recycle_constraint_systems()
Returns true indicating that this domain has methods that can recycle constraints.
int32_t hash_code() const
Returns a 32-bit hash code for *this.
void reset_g_up_to_date()
void add_constraint_no_check(const Constraint &c)
Uses the constraint c to refine *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void add_congruences(const Congruence_System &cgs)
Adds a copy of each congruence in cgs to *this.
bool congruences_are_up_to_date() const
Returns true if the system of congruences is up-to-date.
bool strictly_contains(const Grid &y) const
Returns true if and only if *this strictly contains y.
void clear_congruences_up_to_date()
Sets status to express that congruences are out of date.
bool test_c_minimized() const
static void normalize_divisors(Grid_Generator_System &sys, Coefficient &divisor, const Grid_Generator *first_point=NULL)
Normalizes the divisors in sys.
void refine_with_congruence(const Congruence &cg)
Uses a copy of the congruence cg to refine *this.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Grid_Generator_System can handle.
void set_generators_minimized()
Sets status to express that generators are minimized.
bool test_g_up_to_date() const
void throw_dimension_incompatible(const char *method, const char *other_name, dimension_type other_dim) const
Complexity_Class
Complexity pseudo-classes.
bool max_min(const Linear_Expression &expr, const char *method_call, Coefficient &ext_n, Coefficient &ext_d, bool &included, Generator *point=NULL) const
Maximizes or minimizes expr subject to *this.
bool test_g_minimized() const
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool operator!=(const Grid &x, const Grid &y)
bool bounds(const Linear_Expression &expr, const char *method_call) const
Checks if and how expr is bounded in *this.
Degenerate_Element
Kinds of degenerate abstract elements.
static bool can_recycle_congruence_systems()
Returns true indicating that this domain has methods that can recycle congruences.
dimension_type check_space_dimension_overflow(const dimension_type dim, const dimension_type max, const char *domain, const char *method, const char *reason)
const Congruence_System & minimized_congruences() const
Returns the system of congruences in minimal form.
void set_generators_up_to_date()
Sets status to express that generators are up-to-date.
void refine_with_congruences(const Congruence_System &cgs)
Uses a copy of the congruences in cgs to refine *this.
void reset_c_up_to_date()
void swap(Grid &x, Grid &y)
Swaps x with y.
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 contains(const Grid &y) const
Returns true if and only if *this contains y.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool generators_are_up_to_date() const
Returns true if the system of generators is up-to-date.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
Constraint_System constraints() const
Returns a system of equality constraints satisfied by *this with the same affine dimension as *this...
The entire library is confined to this namespace.
bool marked_empty() const
Returns true if the grid is known to be empty.
bool congruences_are_minimized() const
Returns true if the system of congruences is minimized.
A bounded difference shape.
void add_congruence(const Congruence &cg)
Adds a copy of congruence cg to *this.
void clear_empty()
Clears the status flag indicating that the grid is empty.
void add_constraint(const Constraint &c)
Adds to *this a congruence equivalent to constraint c.
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.
Dimension_Kinds dim_kinds
void add_recycled_constraints(Constraint_System &cs)
Adds to *this congruences equivalent to the constraints in cs.
static dimension_type max_space_dimension()
Returns the maximum space dimension all kinds of Grid can handle.
Congruence_System congruences() const
Returns a system of (equality) congruences satisfied by *this.
bool bounds_from_below(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void set_congruences_up_to_date()
Sets status to express that congruences are up-to-date.
void m_swap(Grid &y)
Swaps *this with grid y. (*this and y can be dimension-incompatible.)
bool generators_are_minimized() const
Returns true if the system of generators is minimized.
void add_recycled_congruences(Congruence_System &cgs)
Adds the congruences in cgs to *this.
void construct(dimension_type num_dimensions, Degenerate_Element kind)
Builds a grid universe or empty grid.
void set_congruences_minimized()
Sets status to express that congruences are minimized.
void topological_closure_assign()
Assigns to *this its topological closure.
A system of grid generators.
bool test_c_up_to_date() const
bool minimize() const
Minimizes both the congruences and the generators.