24 #include "ppl-config.h"
38 gs_end = gs.
end(); g != gs_end; ++g) {
40 throw std::invalid_argument(
"Affine_Space::Affine_Space(gs):\n"
43 else if (g->is_point() || g->is_closure_point()) {
45 ggs.
insert(grid_point(point_expr, g->divisor()));
60 gs_end = gs.
end(); g != gs_end; ++g) {
61 if (g->is_point() || g->is_closure_point()) {
86 return gr.affine_dimension();
91 return gr.congruences();
96 return gr.minimized_congruences();
113 return gr.relation_with(cg);
118 return gr.relation_with(g);
123 return gr.relation_with(c);
128 return gr.is_empty();
133 return gr.is_universe();
138 return gr.is_bounded();
143 return gr.is_discrete();
153 return gr.contains_integer_point();
158 return gr.constrains(var);
163 return gr.OK(check_not_empty);
168 gr.add_constraints(cs);
197 gr.refine_with_constraint(c);
202 gr.refine_with_constraints(cs);
212 gr.unconstrain(vars);
217 gr.intersection_assign(y.
gr);
223 gr.upper_bound_assign(y.
gr);
230 return gr.upper_bound_assign_if_exact(y.
gr);
235 gr.difference_assign(y.
gr);
240 return gr.simplify_using_context_assign(y.
gr);
246 Coefficient_traits::const_reference
248 gr.affine_image(var, expr, denominator);
255 Coefficient_traits::const_reference denominator) {
256 gr.affine_preimage(var, expr, denominator);
264 Coefficient_traits::const_reference denominator) {
265 gr.generalized_affine_image(var, relsym, expr, denominator);
273 Coefficient_traits::const_reference denominator) {
274 gr.generalized_affine_preimage(var, relsym, expr, denominator);
282 gr.generalized_affine_image(lhs, relsym, rhs);
290 gr.generalized_affine_preimage(lhs, relsym, rhs);
298 Coefficient_traits::const_reference denominator) {
299 gr.bounded_affine_image(var, lb_expr, ub_expr, denominator);
308 Coefficient_traits::const_reference denominator) {
309 gr.bounded_affine_preimage(var, lb_expr, ub_expr, denominator);
314 gr.time_elapse_assign(y.
gr);
325 return gr.contains(y.
gr);
330 return gr.is_disjoint_from(y.
gr);
342 return gr.ascii_load(s);
347 return gr.external_memory_in_bytes();
352 gr.add_space_dimensions_and_embed(m);
357 gr.add_space_dimensions_and_project(m);
362 gr.concatenate_assign(y.
gr);
367 gr.remove_space_dimensions(vars);
373 gr.remove_higher_space_dimensions(new_dimension);
378 gr.expand_space_dimension(var, m);
384 gr.fold_space_dimensions(to_be_folded, var);
393 throw_dimension_incompatible(
"widening_assign(y)",
"y", y);
396 PPL_EXPECT_HEAVY(copy_contains(x, y));
407 throw_dimension_incompatible(
"widening_assign(y)",
"y", y);
411 PPL_EXPECT_HEAVY(copy_contains(x, y));
424 const char* other_name,
426 std::ostringstream s;
427 s <<
"PPL::Affine_Space::" << method <<
":\n"
428 <<
"this->space_dimension() == " << space_dimension() <<
", "
429 << other_name <<
".space_dimension() == " << other_dim <<
".";
430 throw std::invalid_argument(s.str());
void unconstrain(Variable var)
Computes the cylindrification of *this with respect to space dimension var, assigning the result to *...
The empty element, i.e., the empty set.
void add_constraints(const Constraint_System &cs)
Adds to *this congruences equivalent to the constraints in cs.
void add_recycled_generators(Generator_System &gs)
Adds the generators in gs to the system of generators of this.
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 ...
A linear equality or inequality.
bool OK(bool check_not_empty=false) const
Checks if all the invariants are satisfied.
Generator_System minimized_generators() const
Returns a minimized system of generators defining *this.
bool upper_bound_assign_if_exact(const Affine_Space &y)
If the upper bound of *this and y is exact it is assigned to this and true is returned, otherwise false is returned.
An iterator over a system of generators.
void refine_with_constraint(const Constraint &c)
Uses a copy of the constraint c to refine *this.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void add_recycled_congruences(Congruence_System &cgs)
Adds the congruences in cgs to *this.
An std::set of variables' indexes.
A line, ray, point or closure point.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
bool is_discrete() const
Returns true if and only if *this is discrete.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
bool contains(const Affine_Space &y) const
Returns true if and only if *this contains y.
The standard C++ namespace.
bool is_topologically_closed() const
Returns true if and only if *this is a topologically closed subset of the vector space.
bool is_universe() const
Returns true if and only if *this is a universe affine space.
bool is_bounded() const
Returns true if and only if *this is bounded.
Poly_Con_Relation relation_with(const Congruence &cg) const
Returns the relations holding between *this and cg.
const Congruence_System & minimized_congruences() const
Returns the system of equality congruences satisfied by *this, with no redundant congruences and havi...
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 e...
void difference_assign(const Affine_Space &y)
Assigns to *this the poly-difference of *this and y.
A dimension of the vector space.
void concatenate_assign(const Affine_Space &y)
Assigns to *this the concatenation of *this and y, taken in this order.
void throw_dimension_incompatible(const char *method, const char *other_name, dimension_type other_dim) const
void intersection_assign(const Affine_Space &y)
Assigns to *this the intersection of *this and y.
Relation_Symbol
Relation symbols.
bool is_empty() const
Returns true if and only if *this is an empty affine space.
void fold_space_dimensions(const Variables_Set &to_be_folded, Variable var)
Folds the space dimensions in to_be_folded into var.
bool contains_integer_point() const
Returns true if and only if *this contains at least one integer point.
Grid gr
The rational grid implementing *this.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type ascii_load(std::istream &s, T &t)
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 add_space_dimensions_and_embed(dimension_type m)
Adds m new space dimensions and embeds the old affine space in the new vector space.
bool all_homogeneous_terms_are_zero() const
Returns true if and only if all the homogeneous terms of *this are .
bool simplify_using_context_assign(const Affine_Space &y)
Assigns to *this a meet-preserving simplification of *this with respect to y. If false is returned...
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
void upper_bound_assign(const Affine_Space &y)
Assigns to *this the least upper bound of *this and y.
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 ...
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
dimension_type affine_dimension() const
Returns , if *this is empty; otherwise, returns affine dimension of *this.
Affine_Space(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds an affine space having the specified properties.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void limited_extrapolation_assign(const Affine_Space &y, const Constraint_System &cs, unsigned *tp=NULL)
Does nothing, as the domain of affine spaces has finite height.
#define PPL_OUTPUT_DEFINITIONS(class_name)
The entire library is confined to this namespace.
bool is_disjoint_from(const Affine_Space &y) const
Returns true if and only if *this and y are disjoint.
Affine_Space & operator=(const Affine_Space &y)
The assignment operator. (*this and y can be dimension-incompatible.)
bool constrains(Variable var) const
Returns true if and only if var is constrained in *this.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
const_iterator end() const
Returns the past-the-end const_iterator.
const_iterator begin() const
Returns the const_iterator pointing to the first generator, if *this is not empty; otherwise...
void widening_assign(const Affine_Space &y, unsigned *tp=NULL)
Does nothing, as the domain of affine spaces has finite height.
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 time_elapse_assign(const Affine_Space &y)
Assigns to *this the result of computing the time-elapse between *this and y.
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...
void add_generator(const Generator &g)
Adds a copy of affine space generator g to the system of generators of *this.
void remove_space_dimensions(const Variables_Set &vars)
Removes all the specified dimensions from the vector space.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
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 expr...
void refine_with_constraints(const Constraint_System &cs)
Uses a copy of the constraints in cs to refine *this.
void expand_space_dimension(Variable var, dimension_type m)
Creates m copies of the space dimension corresponding to var.
void linear_combine(const Linear_Expression &y, Variable v)
void add_space_dimensions_and_project(dimension_type m)
Adds m new space dimensions to the affine space and does not embed it in the new vector space...
void add_generators(const Generator_System &gs)
Adds a copy of the generators in gs to the system of generators of *this.
void m_swap(Grid &y)
Swaps *this with grid y. (*this and y can be dimension-incompatible.)
Generator_System generators() const
Returns a system of generators defining *this.
const Congruence_System & congruences() const
Returns the system of equality congruences satisfied by *this.
void insert(const Grid_Generator &g)
Inserts into *this a copy of the generator g, increasing the number of space dimensions if needed...
The relation between a polyhedron and a generator.
A system of grid generators.
The relation between a polyhedron and a constraint.