Opened 5 years ago

Closed 5 years ago

#22622 closed defect (fixed)

Inconsistency in the .is_lattice_polytope() method

Reported by: jipilab Owned by:
Priority: major Milestone: sage-8.0
Component: geometry Keywords: lattice polytope
Cc: moritz, mkoeppe, vdelecroix, novoselt Merged in:
Authors: Frédéric Chapoton Reviewers: Jean-Philippe Labbé
Report Upstream: N/A Work issues:
Branch: b522220 (Commits, GitHub, GitLab) Commit: b5222203da4c440022837626d693f1dadd196e68
Dependencies: Stopgaps:

Status badges


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()
sage: P1.is_lattice_polytope??
Signature: P1.is_lattice_polytope()
    def is_lattice_polytope(self):
        Return whether the polyhedron is a lattice polytope.


        ``True`` if the polyhedron is compact and has only integral
        vertices, ``False`` otherwise.


            sage: polytopes.cross_polytope(3).is_lattice_polytope()
            sage: polytopes.regular_polygon(5).is_lattice_polytope()
        return True
File:      ~SAGE_ROOT/local/lib/python2.7/site-packages/sage/geometry/polyhedron/
Type:      instancemethod
sage: P1.is_lattice_polytope()

Change History (8)

comment:1 Changed 5 years ago by chapoton

  • Branch set to u/chapoton/22622
  • Commit set to fcff2ad4e0155f56bccb780af38549ff7a096e38

here is a try

New commits:

fcff2adtrac 22622 better check for lattice polytopes

comment:2 Changed 5 years ago by jipilab

  • Authors set to Frédéric Chapoton
  • Reviewers set to Jean-Philippe Labbé
  • Status changed from new to needs_review

Looks good to me. Thanks for the quick fix!

comment:3 Changed 5 years ago by jipilab

  • Status changed from needs_review to positive_review

comment:4 Changed 5 years ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict

comment:5 Changed 5 years ago by git

  • Commit changed from fcff2ad4e0155f56bccb780af38549ff7a096e38 to b5222203da4c440022837626d693f1dadd196e68

Branch pushed to git repo; I updated commit sha1. New commits:

b522220Merge branch 'u/chapoton/22622' in 8.0.b0

comment:6 Changed 5 years ago by chapoton

  • Status changed from needs_work to positive_review

trvial rebase

comment:7 Changed 5 years ago by chapoton

  • Milestone changed from sage-7.6 to sage-8.0

comment:8 Changed 5 years ago by vbraun

  • 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.