Ask Your Question
1

Checking cone containment

asked 9 years ago

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!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 9 years ago

vdelecroix gravatar image

updated 9 years ago

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
Preview: (hide)
link

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: 9 years ago

Seen: 4,770 times

Last updated: Dec 28 '15