7 #include <polylib/polylibgmp.h>
9 #include <barvinok/barvinok.h>
12 namespace polymake
{ namespace polytope
{
14 void lattice_points(Poly
& p
)
17 Matrix
<Rational
> F
= p
.give("FACETS | INEQUALITIES");
18 ::Matrix
*M
= polymake_constraints2polylib(F
);
19 Polyhedron
*A
= Constraints2Polyhedron(M
, 0);
22 barvinok_count(A
, &cb
, 0);
26 p
.take("LATTICE_POINTS") << count
;
31 using namespace polymake
;
33 int main(int argc
, const char *argv
[])
39 Poly
p(argv
[1], ios::in
| ios::out
);
40 polytope::lattice_points(p
);
41 } catch (const std::exception
& e
) {
42 cerr
<< e
.what() << endl
;