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

Use standard Python operators for intersection of polyhedrons and membership testing #14176

Closed
nthiery opened this issue Feb 24, 2013 · 5 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Feb 24, 2013

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

CC: @sagetrac-sage-combinat

Component: geometry

Author: Nicolas M. Thiéry

Reviewer: Volker Braun

Merged: sage-5.8.beta2

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

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

comment:1

Attachment: trac_14176-polyhedrons-operators-nt.patch.gz

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

comment:2

Sounds good to me

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

Changed reviewer from Volker Braun? to Volker Braun

@nthiery
Copy link
Contributor Author

nthiery commented Feb 25, 2013

comment:3

Thanks Volker!

@jdemeyer
Copy link

Merged: sage-5.8.beta2

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