1 | initial version |
Thanks for the pointer from FrédéricC, it appears that Sage expects that the definition of polyhedron over ZZ
is strict with all vertices being integral upfront. The behavior I expected can be achieved by first defining a polyhedron over QQ
, computing its integral hull, and then changing base ring to ZZ
like
P = Polyhedron( ieqs=[(-1, 1, -1, 0, -4), (2, -1, 1, 0, 4), (0, 1, 1, 2, -2), (2, -1, -1, -2, 2), (0, 0, -1, 1, 1), (1, 0, 1, -1, -1), (0, 1, 0, 0, 1), (1, -1, 0, 0, -1)], base_ring=QQ, backend='normaliz' )
Q = P.integral_hull().change_ring(ZZ)
2 | No.2 Revision |
Thanks for to the pointer from FrédéricC, it appears that Sage expects that the definition of polyhedron over ZZ
is strict with all vertices being integral upfront. The behavior I expected can be achieved by first defining a polyhedron over QQ
, computing its integral hull, and then changing base ring to ZZ
like
P = Polyhedron( ieqs=[(-1, 1, -1, 0, -4), (2, -1, 1, 0, 4), (0, 1, 1, 2, -2), (2, -1, -1, -2, 2), (0, 0, -1, 1, 1), (1, 0, 1, -1, -1), (0, 1, 0, 0, 1), (1, -1, 0, 0, -1)], base_ring=QQ, backend='normaliz' )
Q = P.integral_hull().change_ring(ZZ)
The error message in the case of non-integral vertices could have been more informative, nevertheless.