24 #include "ppl-config.h"
27 #include "assertions.hh"
34 num_rays_null_coord(ph.space_dimension(), 0) {
54 cs_end = cs.
end(); i != cs_end; ++i) {
56 if (i->is_equality()) {
65 gs_end = gs.
end(); i != gs_end; ++i) {
101 PPL_ASSERT(OK() && y.
OK());
151 cs_end = cs.
end(); i != cs_end; ++i) {
152 ++ph_num_constraints;
153 if (i->is_equality()) {
168 if (ph_affine_dim > affine_dim) {
172 PPL_ASSERT(ph_affine_dim == affine_dim);
181 gs_end = gs.
end(); i != gs_end; ++i) {
209 if (ph_lin_space_dim > lin_space_dim) {
214 PPL_ASSERT(ph_lin_space_dim == lin_space_dim);
225 if (ph_num_points != num_points) {
226 return (ph_num_points < num_points) ? 1 : -1;
230 std::vector<dimension_type> ph_num_rays_null_coord(ph.
space_dim, 0);
232 gs_end = gs.
end(); i != gs_end; ++i) {
234 ++ph_num_rays_null_coord[i->expression().num_zeroes(1, space_dim + 1)];
240 if (ph_num_rays_null_coord[i] != num_rays_null_coord[i]) {
241 return (ph_num_rays_null_coord[i] < num_rays_null_coord[i]) ? 1 : -1;
258 if (affine_dim > space_dim) {
260 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
262 <<
"the affine dimension is greater than the space dimension!"
268 if (lin_space_dim > affine_dim) {
270 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
272 <<
"the lineality space dimension is greater than "
273 <<
"the affine dimension!"
281 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
283 <<
"in a vector space of dimension `n',"
284 <<
"any polyhedron of affine dimension `k'" << endl
285 <<
"should have `n-k' non-redundant constraints at least."
287 <<
"Here space_dim = " << space_dim <<
", "
288 <<
"affine_dim = " << affine_dim <<
", "
295 if (num_points == 0) {
297 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
299 <<
"the generator system has no points!"
305 if (lin_space_dim == space_dim) {
309 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
311 <<
"a universe polyhedron has non-redundant constraints!"
317 if (num_points != 1) {
319 cerr <<
"In the BHRZ03 certificate about a non-empty polyhedron:"
321 <<
"a universe polyhedron has more than one non-redundant point!"
dimension_type affine_dim
Affine dimension of the polyhedron.
An iterator over a system of constraints.
bool marked_empty() const
Returns true if the polyhedron is known to be empty.
bool OK() const
Check if gathered information is meaningful.
An iterator over a system of generators.
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type num_points
Number of non-redundant points in a generator system for the polyhedron.
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type num_constraints(const Constraint_System &cs)
Helper returning number of constraints in system.
const_iterator begin() const
Returns the const_iterator pointing to the first constraint, if *this is not empty; otherwise...
int compare(const BHRZ03_Certificate &y) const
The comparison function for certificates.
The base class for convex polyhedra.
std::vector< dimension_type > num_rays_null_coord
A vector containing, for each index `0 <= i < space_dim', the number of non-redundant rays in a gener...
const_iterator end() const
Returns the past-the-end const_iterator.
const Generator_System & minimized_generators() const
Returns the system of generators, with no redundant generator.
BHRZ03_Certificate()
Default constructor.
dimension_type lin_space_dim
Dimension of the lineality space of the polyhedron.
dimension_type num_constraints(const Constraint_System &cs)
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.
The convergence certificate for the BHRZ03 widening operator.
The entire library is confined to this namespace.
dimension_type space_dim
The number of dimensions of the enclosing vector space.
bool is_necessarily_closed() const
Returns true if and only if the polyhedron is necessarily closed.
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...
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.