Opened 6 years ago

Closed 6 years ago

#14176 closed enhancement (fixed)

Use standard Python operators for intersection of polyhedrons and membership testing

Reported by: nthiery Owned by: mhampton
Priority: major Milestone: sage-5.8
Component: geometry Keywords:
Cc: sage-combinat Merged in: sage-5.8.beta2
Authors: Nicolas M. Thiéry Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

The attached patch enables & and in operators for polyhedrons::

            sage: cube = polytopes.n_cube(3)
            sage: oct = polytopes.cross_polytope(3)
            sage: cube.intersection(oct*2)
            A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 12 vertices
            sage: cube & oct*2
            A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 12 vertices
            sage: P = Polyhedron(vertices=[[1,1],[1,-1],[0,0]])
            sage: P.center() in P
            True
            sage: [-1,-1] in P
            False

Attachments (1)

trac_14176-polyhedrons-operators-nt.patch (1.9 KB) - added by nthiery 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by nthiery

comment:1 Changed 6 years ago by vbraun

  • Status changed from new to needs_review

comment:2 Changed 6 years ago by vbraun

  • Reviewers changed from Volker Braun? to Volker Braun
  • Status changed from needs_review to positive_review

Sounds good to me

comment:3 Changed 6 years ago by nthiery

Thanks Volker!

comment:4 Changed 6 years ago by jdemeyer

  • Merged in set to sage-5.8.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.