Opened 4 years ago
Closed 4 years ago
#22622 closed defect (fixed)
Inconsistency in the .is_lattice_polytope() method
Reported by:  jipilab  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  geometry  Keywords:  lattice polytope 
Cc:  moritz, mkoeppe, vdelecroix, novoselt  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  JeanPhilippe Labbé 
Report Upstream:  N/A  Work issues:  
Branch:  b522220 (Commits, GitHub, GitLab)  Commit:  b5222203da4c440022837626d693f1dadd196e68 
Dependencies:  Stopgaps: 
Description
The .is_lattice_polytope()
method states that it requires the polyhedron object to be compact, but it still returns True
if it is not.
sage: P1 = Polyhedron(vertices = [[1, 0], [0, 1]], rays = [[1, 1]]) sage: P1.is_compact() False sage: P1.is_lattice_polytope?? Signature: P1.is_lattice_polytope() Source: def is_lattice_polytope(self): r""" Return whether the polyhedron is a lattice polytope. OUTPUT: ``True`` if the polyhedron is compact and has only integral vertices, ``False`` otherwise. EXAMPLES:: sage: polytopes.cross_polytope(3).is_lattice_polytope() True sage: polytopes.regular_polygon(5).is_lattice_polytope() False """ return True File: ~SAGE_ROOT/local/lib/python2.7/sitepackages/sage/geometry/polyhedron/base_ZZ.py Type: instancemethod sage: P1.is_lattice_polytope() True
Change History (8)
comment:1 Changed 4 years ago by
 Branch set to u/chapoton/22622
 Commit set to fcff2ad4e0155f56bccb780af38549ff7a096e38
comment:2 Changed 4 years ago by
 Reviewers set to JeanPhilippe Labbé
 Status changed from new to needs_review
Looks good to me. Thanks for the quick fix!
comment:3 Changed 4 years ago by
 Status changed from needs_review to positive_review
comment:5 Changed 4 years ago by
 Commit changed from fcff2ad4e0155f56bccb780af38549ff7a096e38 to b5222203da4c440022837626d693f1dadd196e68
Branch pushed to git repo; I updated commit sha1. New commits:
b522220  Merge branch 'u/chapoton/22622' in 8.0.b0

comment:7 Changed 4 years ago by
 Milestone changed from sage7.6 to sage8.0
comment:8 Changed 4 years ago by
 Branch changed from u/chapoton/22622 to b5222203da4c440022837626d693f1dadd196e68
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
here is a try
New commits:
trac 22622 better check for lattice polytopes