I am using the Parma Polyhedra Library (PPL) to do vertex enumeration of a given polyhedron. This has been discussed here. However, i cannot figure out how to use rational numbers instead of integers in the computation.
The code below generates a line segment [0.3,3.7] (convex polyhedron in 1 dimensions), and PPL returns the two integers {0,3}, but i want the rational numbers {0.3,3.7}. How can I advice PPL to use rational numbers (floating point arithmetic)?
#include <cstddef>
#include <stdio.h>
#include "ppl.hh"
using namespace Parma_Polyhedra_Library;
int main() {
Variable x(0);
C_Polyhedron ph(1);
ph.refine_with_constraint( x <= 3.7);
ph.refine_with_constraint( x >= 0.3);
Generator_System gs = ph.generators();
for(Generator_System::const_iterator it = gs.begin(); it != gs.end(); it++) {
const Generator& g = *it;
std::cout << g.coefficient(x) << std::endl;
}
return 0;
}