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 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of polyhedron => 3 number of facets => 6 number of rays => 0 number of vertices => 8 o1 : Polyhedron |
i2 : Q = crossPolytope 3 o2 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of polyhedron => 3 number of facets => 8 number of rays => 0 number of vertices => 6 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 = posHull 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 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of polyhedron => 3 number of facets => 6 number of rays => 0 number of vertices => 8 o7 : Polyhedron |
i8 : contains(C,P) o8 = true |
The object contains is a method function.