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

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

- Usage:
    `b = contains(C,X)`
    `b = contains(P,X)`
    `b = contains(F,C)`
    `b = contains(L,C)`
    `b = contains(L,P)`
- Inputs:
  - C, a convex rational cone
  - P, a convex polyhedron
  - F, an instance of the type Fan
  - L, a list
  - X, either a Cone, a Polyhedron, or a Matrix with only one column giving a point.
- Outputs:
  - b, a Boolean value, true if the first argument contains the second argument, false otherwise.

## Description

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:

- `contains(Cone,Cone)`
- `contains(Cone,Matrix)`
- `contains(Cone,Polyhedron)`
- `contains(Fan,Cone)`
- `contains(List,Cone)`
- `contains(List,Polyhedron)`
- `contains(Polyhedron,Cone)`
- `contains(Polyhedron,Matrix)`
- `contains(Polyhedron,Polyhedron)`

## For the programmer

The object contains is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Polyhedra/documentation/old_documentation.m2:1164:0.