Macaulay2 » Documentation
Packages » Polyhedra :: contains
next | previous | forward | backward | up | index | toc

contains -- checks if the first argument contains the second argument



contains determines if the first argument contains the second argument. Both arguments have to lie in the same ambient space. When the first argument is a Cone or Polyhedron, it tests if the equations of the first argument are satisfied by the generating points/rays of the second argument.

For example, we can check if the 3 dimensional crosspolytope contains the hypercube or the other way around:
i1 : P = hypercube 3

o1 = P

o1 : Polyhedron
i2 : Q = crossPolytope 3

o2 = Q

o2 : Polyhedron
i3 : contains(Q,P)

o3 = false
i4 : contains(P,Q)

o4 = true

We can also check if the hypercube lies in the positive orthant.
i5 : C = coneFromVData matrix {{1,0,0},{0,1,0},{0,0,1}};
i6 : contains(C,P)

o6 = false
i7 : P = affineImage(P,matrix{{1},{1},{1}})

o7 = P

o7 : Polyhedron
i8 : contains(C,P)

o8 = true

Ways to use contains :

For the programmer

The object contains is a method function.