Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polytopes normaliz backend doesn't handle a polytope with a trivial integral hull #22938

Closed
tscrim opened this issue May 3, 2017 · 6 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented May 3, 2017

Here is an example that is not handled properly:

sage: ieqs = [[1, 2, -1, 0], [0, -1, 2, -1], [0, 0, -1, 2], [0, -1, 0, 0], [0, 0, -1, 0], 
....: [0, 0, 0, -1], [-1, -1, -1, -1], [1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]]
sage: P = Polyhedron(ieqs=ieqs, backend='normaliz')
sage: P.bounding_box()
((-3/4, -1/2, -1/4), (-1/2, -1/4, 0))
sage: P.bounding_box(integral_hull=True)
(None, None)
sage: P.integral_points()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-17-2abbf2adff15> in <module>()
----> 1 P.integral_points()

/home/travis/sage-build/local/lib/python2.7/site-packages/sage/geometry/polyhedron/backend_normaliz.pyc in integral_points(self, threshold)
    568         if threshold > 1:
    569             box_min, box_max = self.bounding_box(integral_hull=True)
--> 570             box_points = prod(max_coord-min_coord+1 for min_coord, max_coord in zip(box_min, box_max))
    571             if  box_points<threshold:
    572                 from sage.geometry.integral_points import rectangular_box_points

TypeError: zip argument #1 must support iteration

CC: @mkoeppe

Component: geometry

Author: Travis Scrimshaw

Branch/Commit: aa9f258

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/22938

@tscrim tscrim added this to the sage-8.0 milestone May 3, 2017
@tscrim
Copy link
Collaborator Author

tscrim commented May 3, 2017

New commits:

aa9f258Fixing integral points for a non-empty polytope with trivial integral hull.

@tscrim
Copy link
Collaborator Author

tscrim commented May 3, 2017

Commit: aa9f258

@tscrim
Copy link
Collaborator Author

tscrim commented May 3, 2017

@mkoeppe
Copy link
Contributor

mkoeppe commented May 3, 2017

comment:2

Thanks for fixing this.

@mkoeppe
Copy link
Contributor

mkoeppe commented May 3, 2017

Reviewer: Matthias Koeppe

@vbraun
Copy link
Member

vbraun commented May 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants