Ask Your Question
1

Checking cone containment

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

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
3

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

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

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)
True
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

Stats

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

Seen: 3,939 times

Last updated: Dec 28 '15