Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Adding tests from comment:24,25 of #22984.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Mar 15, 2018
1 parent 57d40b0 commit 6ba442d
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/sage/geometry/polyhedron/backend_normaliz.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,72 @@ def integral_points(self, threshold=10000):
(None, None)
sage: P.integral_points() # optional - pynormaliz
()
Check the polytopes from :trac:`22984`::
sage: base = [[0, 2, 0, -1, 0, 0, 0, 0, 0],
....: [0, 0, 2, 0, -1, 0, 0, 0, 0],
....: [1, -1, 0, 2, -1, 0, 0, 0, 0],
....: [0, 0, -1, -1, 2, -1, 0, 0, 0],
....: [0, 0, 0, 0, -1, 2, -1, 0, 0],
....: [0, 0, 0, 0, 0, -1, 2, -1, 0],
....: [1, 0, 0, 0, 0, 0, -1, 2, -1],
....: [0, 0, 0, 0, 0, 0, 0, -1, 2],
....: [0, -1, 0, 0, 0, 0, 0, 0, 0],
....: [0, 0, -1, 0, 0, 0, 0, 0, 0],
....: [0, 0, 0, -1, 0, 0, 0, 0, 0],
....: [0, 0, 0, 0, -1, 0, 0, 0, 0],
....: [0, 0, 0, 0, 0, -1, 0, 0, 0],
....: [0, 0, 0, 0, 0, 0, -1, 0, 0],
....: [0, 0, 0, 0, 0, 0, 0, -1, 0],
....: [0, 0, 0, 0, 0, 0, 0, 0, -1],
....: [-1, -1, -1, -1, -1, -1, -1, -1, -1]]
sage: ieqs = base + [
....: [2, 1, 0, 0, 0, 0, 0, 0, 0],
....: [4, 0, 1, 0, 0, 0, 0, 0, 0],
....: [4, 0, 0, 1, 0, 0, 0, 0, 0],
....: [7, 0, 0, 0, 1, 0, 0, 0, 0],
....: [6, 0, 0, 0, 0, 1, 0, 0, 0],
....: [4, 0, 0, 0, 0, 0, 1, 0, 0],
....: [2, 0, 0, 0, 0, 0, 0, 1, 0],
....: [1, 0, 0, 0, 0, 0, 0, 0, 1]]
sage: P = Polyhedron(ieqs=ieqs, backend='normaliz') # optional - pynormaliz
sage: P.integral_points() # optional - pynormaliz
((-2, -2, -4, -5, -4, -3, -2, -1),
(-2, -2, -4, -5, -4, -3, -2, 0),
(-1, -2, -3, -4, -3, -2, -2, -1),
(-1, -2, -3, -4, -3, -2, -1, 0),
(-1, -1, -2, -2, -2, -2, -2, -1),
(-1, -1, -2, -2, -1, -1, -1, 0),
(-1, -1, -2, -2, -1, 0, 0, 0),
(-1, 0, -2, -2, -2, -2, -2, -1),
(0, -1, -1, -2, -2, -2, -2, -1),
(0, 0, -1, -1, -1, -1, -1, 0))
sage: ieqs = base + [
....: [3, 1, 0, 0, 0, 0, 0, 0, 0],
....: [4, 0, 1, 0, 0, 0, 0, 0, 0],
....: [6, 0, 0, 1, 0, 0, 0, 0, 0],
....: [8, 0, 0, 0, 1, 0, 0, 0, 0],
....: [6, 0, 0, 0, 0, 1, 0, 0, 0],
....: [4, 0, 0, 0, 0, 0, 1, 0, 0],
....: [2, 0, 0, 0, 0, 0, 0, 1, 0],
....: [1, 0, 0, 0, 0, 0, 0, 0, 1]]
sage: P = Polyhedron(ieqs=ieqs, backend='normaliz') # optional - pynormaliz
sage: P.integral_points() # optional - pynormaliz
((-3, -4, -6, -8, -6, -4, -2, -1),
(-3, -4, -6, -8, -6, -4, -2, 0),
(-2, -2, -4, -5, -4, -3, -2, -1),
(-2, -2, -4, -5, -4, -3, -2, 0),
(-1, -2, -3, -4, -3, -2, -2, -1),
(-1, -2, -3, -4, -3, -2, -1, 0),
(-1, -1, -2, -2, -2, -2, -2, -1),
(-1, -1, -2, -2, -1, -1, -1, 0),
(-1, -1, -2, -2, -1, 0, 0, 0),
(-1, 0, -2, -2, -2, -2, -2, -1),
(0, -1, -1, -2, -2, -2, -2, -1),
(0, 0, -1, -1, -1, -1, -1, 0))
"""
import PyNormaliz
if not self.is_compact():
Expand Down

0 comments on commit 6ba442d

Please sign in to comment.