24 #ifndef PPL_Any_Pointset_defs_hh
25 #define PPL_Any_Pointset_defs_hh 1
37 namespace IO_Operators {
49 operator<<(std::ostream& s,
const Any_Pointset& ph);
55 void swap(Any_Pointset& x, Any_Pointset& y);
65 bool operator==(
const Any_Pointset& x,
const Any_Pointset& y);
75 bool operator!=(
const Any_Pointset& x,
const Any_Pointset& y);
330 virtual bool OK()
const = 0;
357 virtual void add_generator(
const Generator& g) = 0;
360 virtual void add_grid_generator(
const Grid_Generator& g)
const = 0;
370 virtual void add_congruence(
const Congruence& cg) = 0;
567 Coefficient_traits::const_reference denominator
659 Coefficient_traits::const_reference denominator
692 Coefficient_traits::const_reference denominator
725 Coefficient_traits::const_reference denominator
806 Coefficient_traits::const_reference denominator
839 Coefficient_traits::const_reference denominator
856 void widening_assign(
const Any_Pointset& y,
unsigned* tp = 0);
879 void limited_H79_extrapolation_assign(
const Any_Pointset& y,
905 void bounded_H79_extrapolation_assign(
const Any_Pointset& y,
1046 template <
typename Partial_Function>
1146 #define PPL_ANY_POINTSET_WRAPPER_CLASS(TEMPLATE, WRAPPER_NAME, BASE_CLASS) \
1148 class WRAPPER_NAME : public Any_Pointset { \
1152 explicit WRAPPER_NAME(const C_Polyhedron& y) \
1155 explicit WRAPPER_NAME(const NNC_Polyhedron& y) \
1158 template <typename U> \
1159 explicit WRAPPER_NAME(const Box<U>& y) \
1162 template <typename U> \
1163 explicit WRAPPER_NAME(const BD_Shape<U>& y) \
1166 template <typename U> \
1167 explicit WRAPPER_NAME(const Octagonal_Shape<U>& y) \
1171 explicit WRAPPER_NAME(const Constraint_System& y) \
1174 explicit WRAPPER_NAME(const Congruence_System& y) \
1181 dimension_type space_dimension() const { \
1182 return x.space_dimension(); \
1184 dimension_type affine_dimension() const { \
1185 return x.space_dimension(); \
1187 Constraint_System constraints() const { \
1188 return x.constraints(); \
1190 Congruence_System congruences() const { \
1191 return x.congruences(); \
1194 bool is_empty() const { \
1195 return x.is_empty(); \
1197 bool is_universe() const { \
1198 return x.is_universe(); \
1200 bool is_bounded() const { \
1201 return x.is_bounded(); \
1203 bool is_topologically_closed() const { \
1204 return x.is_topologically_closed(); \
1206 bool is_discrete() const { \
1207 return x.is_discrete(); \
1209 bool contains_integer_point() const { \
1210 return x.contains_integer_point(); \
1213 bool contains(const Any_Pointset& y) const { \
1214 return x.contains(dynamic_cast<const BASE_CLASS&>(y)); \
1216 bool strictly_contains(const Any_Pointset& y) const { \
1217 return x.strictly_contains(dynamic_cast<const BASE_CLASS&>(y)); \
1219 bool is_disjoint_from(const Any_Pointset& y) const { \
1220 return x.is_disjoint_from(dynamic_cast<const BASE_CLASS&>(y)); \
1223 void add_space_dimensions_and_embed(dimension_type m) { \
1224 return x.add_space_dimensions_and_embed(m); \
1226 void add_space_dimensions_and_project(dimension_type m) { \
1227 return x.add_space_dimensions_and_project(m); \
1229 void remove_space_dimensions(const Variables_Set& vars) { \
1230 x.remove_space_dimensions(vars); \
1232 void remove_higher_space_dimensions(dimension_type new_dimension) { \
1233 x.remove_higher_space_dimensions(new_dimension); \
1236 void add_constraint(const Constraint& c) { \
1237 x.add_constraint(c); \
1240 void add_constraints(const Constraint_System& cs) { \
1241 x.add_constraints(cs); \
1244 void intersection_assign(const Any_Pointset& y) { \
1245 x.intersection_assign(dynamic_cast<const BASE_CLASS&>(y)); \
1247 void upper_bound_assign(const Any_Pointset& y) { \
1248 x.upper_bound_assign(dynamic_cast<const BASE_CLASS&>(y)); \
1250 void difference_assign(const Any_Pointset& y) { \
1251 x.difference_assign(dynamic_cast<const BASE_CLASS&>(y)); \
1253 void concatenate_assign(const Any_Pointset& y) { \
1254 x.concatenate_assign(dynamic_cast<const BASE_CLASS&>(y)); \
1256 void time_elapse_assign(const Any_Pointset& y) { \
1257 x.time_elapse_assign(dynamic_cast<const BASE_CLASS&>(y)); \
1260 void affine_image(Variable var, \
1261 const Linear_Expression& expr, \
1262 Coefficient_traits::const_reference denominator \
1263 = Coefficient_one()) { \
1264 x.affine_image(var, expr, denominator); \
1266 void affine_preimage(Variable var, \
1267 const Linear_Expression& expr, \
1268 Coefficient_traits::const_reference denominator \
1269 = Coefficient_one()) { \
1270 x.affine_image(var, expr, denominator); \
1272 void generalized_affine_image(Variable var, \
1273 Relation_Symbol relsym, \
1274 const Linear_Expression& expr, \
1275 Coefficient_traits::const_reference \
1276 denominator = Coefficient_one()) { \
1277 x.generalized_affine_image(var, relsym, expr, denominator); \
1280 generalized_affine_preimage(Variable var, \
1281 Relation_Symbol relsym, \
1282 const Linear_Expression& expr, \
1283 Coefficient_traits::const_reference denominator \
1284 = Coefficient_one()) { \
1285 x.generalized_affine_preimage(var, relsym, expr, denominator); \
1287 virtual void generalized_affine_image(const Linear_Expression& lhs, \
1288 Relation_Symbol relsym, \
1289 const Linear_Expression& rhs) { \
1290 x.generalized_affine_image(lhs, relsym, rhs); \
1292 void generalized_affine_preimage(const Linear_Expression& lhs, \
1293 Relation_Symbol relsym, \
1294 const Linear_Expression& rhs) { \
1295 x.generalized_affine_preimage(lhs, relsym, rhs); \
1298 void bounded_affine_image(Variable var, \
1299 const Linear_Expression& lb_expr, \
1300 const Linear_Expression& ub_expr, \
1301 Coefficient_traits::const_reference \
1302 denominator = Coefficient_one()) { \
1303 x.bounded_affine_image(var, lb_expr, ub_expr, denominator); \
1305 void bounded_affine_preimage(Variable var, \
1306 const Linear_Expression& lb_expr, \
1307 const Linear_Expression& ub_expr, \
1308 Coefficient_traits::const_reference \
1309 denominator = Coefficient_one()) { \
1310 x.bounded_affine_preimage(var, lb_expr, ub_expr, denominator); \
1313 bool bounds_from_above(const Linear_Expression& expr) const { \
1314 return x.bounds_from_above(expr); \
1316 bool bounds_from_below(const Linear_Expression& expr) const { \
1317 return x.bounds_from_below(expr); \
1319 bool maximize(const Linear_Expression& expr, \
1320 Coefficient& sup_n, Coefficient& sup_d, \
1321 bool& maximum) const { \
1322 return maximize(expr, sup_n, sup_d, maximum); \
1324 bool maximize(const Linear_Expression& expr, \
1325 Coefficient& sup_n, Coefficient& sup_d, \
1326 bool& maximum, Generator& point) const { \
1327 return maximize(expr, sup_n, sup_d, maximum, point); \
1329 bool minimize(const Linear_Expression& expr, \
1330 Coefficient& inf_n, Coefficient& inf_d, \
1331 bool& minimum) const { \
1332 return minimize(expr, inf_n, inf_d, minimum); \
1334 bool minimize(const Linear_Expression& expr, \
1335 Coefficient& inf_n, Coefficient& inf_d, \
1336 bool& minimum, Generator& point) const { \
1337 return minimize(expr, inf_n, inf_d, minimum, point); \
1340 memory_size_type total_memory_in_bytes() const { \
1341 return x.total_memory_in_bytes(); \
1343 memory_size_type external_memory_in_bytes() const { \
1344 return x.total_memory_in_bytes(); \
1347 int32_t hash_code() const { \
1348 return x.hash_code(); \
1375 #endif // !defined(PPL_Any_Pointset_defs_hh)
virtual void add_constraint(const Constraint &c)=0
Adds a copy of constraint c to the system of constraints of *this (without minimizing the result)...
virtual bool maximize(const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const =0
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.
Any_Pointset()
Default constructor.
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
dimension_type max_space_dimension()
Returns the maximum space dimension this library can handle.
A linear equality or inequality.
void swap(CO_Tree &x, CO_Tree &y)
void m_swap(Any_Pointset &y)
Swaps *this with pointset y. (*this and y can be dimension-incompatible.)
virtual bool is_bounded() const =0
Returns true if and only if *this is a bounded pointset.
virtual void add_space_dimensions_and_project(dimension_type m)=0
Adds m new space dimensions to the pointset and does not embed it in the new vector space...
size_t dimension_type
An unsigned integral type for representing space dimensions.
virtual void generalized_affine_preimage(Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the preimage of *this with respect to the generalized affine relation ...
An std::set of variables' indexes.
void topological_closure_assign()
Assigns to *this its topological closure.
A line, ray, point or closure point.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
virtual void bounded_affine_image(Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the image of *this with respect to the bounded affine relation . ...
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
virtual bool is_discrete() const =0
Returns true if and only if *this is discrete.
virtual bool contains_integer_point() const =0
Returns true if and only if *this contains at least one integer point.
virtual bool is_topologically_closed() const =0
Returns true if and only if *this is a topologically closed subset of the vector space.
A dimension of the vector space.
virtual bool is_disjoint_from(const Any_Pointset &y) const =0
Returns true if and only if *this and y are disjoint.
virtual bool bounds_from_above(const Linear_Expression &expr) const =0
Returns true if and only if expr is bounded from above in *this.
void expand_space_dimension(Variable var, dimension_type m)
Creates m copies of the space dimension corresponding to var.
#define PPL_OUTPUT_DECLARATIONS
virtual void upper_bound_assign(const Any_Pointset &y)=0
Assigns to *this the smallest pointset, in the class of *this and y, that contains both *this and y...
Relation_Symbol
Relation symbols.
Poly_Con_Relation relation_with(const Constraint &c) const
Returns the relations holding between the pointset *this and the constraint c.
virtual void add_constraints(const Constraint_System &cs)=0
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
virtual memory_size_type external_memory_in_bytes() const =0
Returns the size in bytes of the memory managed by *this.
virtual dimension_type space_dimension() const =0
Returns the dimension of the vector space enclosing *this.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
virtual void unconstrain(Variable var)=0
Computes the cylindrification of *this with respect to space dimension var, assigning the result to *...
virtual ~Any_Pointset()
Destructor.
virtual void affine_image(Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the affine image of *this under the function mapping variable var to the affine expr...
virtual Constraint_System constraints() const =0
Returns a system of constraints that *this satisfies.
virtual bool bounds_from_below(const Linear_Expression &expr) const =0
Returns true if and only if expr is bounded from below in *this.
virtual bool is_empty() const =0
Returns true if and only if *this is an empty pointset.
virtual void difference_assign(const Any_Pointset &y)=0
Assigns to *this the smallest pointset, in the class of this and y, that contains the set-theoretic d...
virtual bool minimize(const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const =0
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.
virtual memory_size_type total_memory_in_bytes() const =0
Returns the total size in bytes of the memory occupied by *this.
The entire library is confined to this namespace.
virtual void remove_higher_space_dimensions(dimension_type new_dimension)=0
Removes the higher dimensions of the vector space so that the resulting space will have dimension new...
virtual void time_elapse_assign(const Any_Pointset &y)=0
Assigns to *this the result of computing the time-elapse between *this and y.
virtual void intersection_assign(const Any_Pointset &y)=0
Assigns to *this the intersection of *this and y. The result is not guaranteed to be minimized...
virtual bool strictly_contains(const Any_Pointset &y) const =0
Returns true if and only if *this strictly contains y.
#define PPL_ANY_POINTSET_WRAPPER_CLASS(TEMPLATE, WRAPPER_NAME, BASE_CLASS)
virtual void concatenate_assign(const Any_Pointset &y)=0
Assigns to *this the concatenation of *this and y, taken in this order.
virtual void affine_preimage(Variable var, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the affine preimage of *this under the function mapping variable var to the affine e...
virtual void add_space_dimensions_and_embed(dimension_type m)=0
Adds m new space dimensions and embeds the old pointset in the new vector space.
void fold_space_dimensions(const Variables_Set &vars, Variable dest)
Folds the space dimensions in vars into dest.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
virtual void remove_space_dimensions(const Variables_Set &vars)=0
Removes all the specified dimensions from the vector space.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
virtual bool is_universe() const =0
Returns true if and only if *this is a universe pointset.
virtual bool OK() const =0
Checks if all the invariants are satisfied.
virtual void generalized_affine_image(Variable var, Relation_Symbol relsym, const Linear_Expression &expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the image of *this with respect to the generalized affine relation ...
Coefficient_traits::const_reference Coefficient_one()
Returns a const reference to a Coefficient with value 1.
virtual dimension_type affine_dimension() const =0
Returns , if *this is empty; otherwise, returns the affine dimension of *this.
virtual int32_t hash_code() const =0
Returns a 32-bit hash code for *this.
virtual bool contains(const Any_Pointset &y) const =0
Returns true if and only if *this contains y.
virtual void bounded_affine_preimage(Variable var, const Linear_Expression &lb_expr, const Linear_Expression &ub_expr, Coefficient_traits::const_reference denominator=Coefficient_one())=0
Assigns to *this the preimage of *this with respect to the bounded affine relation ...
The relation between a polyhedron and a generator.
A grid line, parameter or grid point.
The relation between a polyhedron and a constraint.