Ask Your Question

Checking cone containment

asked 2015-12-28 13:59:45 -0500

GraduateStudent gravatar image

I would like to check if one cone contains another cone, where the cones are convex rational polyhedral cones. I don't want to compute the intersection of two cones, because when done many times, that becomes prohibitively slow. Checking containment should be much faster. Is this possible in Sage? Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-28 14:31:01 -0500

updated 2015-12-28 14:33:36 -0500

Assuming that your cones only contains the vertex 0, you can use containment as follows

sage: def polyhedron_contains(P, Q):
....:     return all(P.contains(v) for v in Q.rays())
sage: P1 = Polyhedron(rays = [(1,0,0), (0,1,0), (0,0,1)])
sage: P2 = Polyhedron(rays = [(1,2,1), (1,0,0), (1,1,1), (1,1,2)])
sage: polyhedron_contains(P1,P2)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-12-28 13:59:45 -0500

Seen: 3,935 times

Last updated: Dec 28 '15