This is Polyhedra.info, produced by Macaulay2, version 1.25.11

Polyhedra -- for computations with convex polyhedra, cones, and fans
********************************************************************

Description
===========

A rational convex Polyhedron, is the intersection of finitely
many affine half-spaces over QQ (Macaulay2Doc), or equivalently, the
convex hull of a finite set of vertices and rays. A rational convex polyhedral
Cone, is the intersection of finitely many linear half-spaces over
QQ (Macaulay2Doc), or equivalently, the positive hull of a finite set
of rays. A Fan, is a finite collection of cones such that for each
cone all its faces are in the fan and for two cones in the fan the intersection
is a face of each.

Polyhedra uses the
  * FourierMotzkin, package by Gregory G. Smith (see
    http://www.mast.queensu.ca/~ggsmith )
  * FourTiTwo, package by Michael Stillman (see
    http://pi.math.cornell.edu/~mike/ ), Josephine Yu (see
    http://people.math.gatech.edu/~jyu67/ ), and Sonja Petrovic (see
    http://math.iit.edu/~spetrov1/ )
  * Normaliz, package by Gesa Kaempf and Christof Soeger
  * Topcom, package by Michael Stillman (see
    http://pi.math.cornell.edu/~mike/ ).

Here are some examples illustrating the main uses of this package.
  * Working with polyhedra
  * Working with cones
  * Working with fans

Please have a look at V- and H-representation,
on conventions used throughout this package before you start.

For an introduction to polyhedra and cones, we recommend Gunter M. Ziegler's
(see http://www.mi.fu-berlin.de/math/groups/discgeom/ziegler/ ) Lectures on
Polytopes, Graduate Texts in Mathematics 152, Springer-Verlag, New York, 1995.

The authors would like to thank
  * Daniel R. Grayson (see https://faculty.math.illinois.edu/~dan/ )
  * Nathan Ilten (see http://people.cs.uchicago.edu/~nilten/ )
  * Marta Panizzut (see http://page.math.tu-berlin.de/~panizzut/ )
  * Gregory G. Smith (see http://www.mast.queensu.ca/~ggsmith/ )
  * Andrew P. Staal (see http://astaal.be/ )
  * Michael Stillman (see http://pi.math.cornell.edu/~mike/ )
  * Anna-Lena Winz (see http://www.mi.fu-berlin.de/math/groups/ag-algebra/
    members/mitarbeiter/Winz.html )
for code contributions, bug reports, and helpful discussions concerning this
package.

Authors
=======

  * René Birkner (see http://page.mi.fu-berlin.de/rbirkner/index.htm )
    <rbirkner@mi.fu-berlin.de>
  * Lars Kastner (see http://page.mi.fu-berlin.de/lkastner/ )
    <k.l@fu-berlin.de>

Certification a gold star
=========================

Version 1.0.5 of this package was accepted for publication in volume 1 (see
https://msp.org/jsag/2009/1-1/ ) of The Journal of Software for Algebra and
Geometry: Macaulay2 (see https://msp.org/jsag/ ) on 2009-09-07, in the article
Polyhedra: a package for computations with convex polyhedral objects (see
https://msp.org/jsag/2009/1-1/p03.xhtml ) (DOI: 10.2140/jsag.2009.1.11 (see
https://doi.org/10.2140/jsag.2009.1.11 )). That version can be obtained from
the journal (see https://msp.org/jsag/2009/1-1/jsag-v1-n1-x03-code.zip ).

Version
=======

This documentation describes version 1.10 of Polyhedra, released November 12,
2018.

Citation
========

If you have used this package in your research, please cite it as follows:

+-----------------------------------------------------------------------------+
|@misc{PolyhedraSource,                                                       |
|  title = {{Polyhedra: convex polyhedra. Version~1.10}},                     |
|  author = {Ren{\'e} Birkner and Lars Kastner},                              |
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/stable/M2/Macaulay2/packages}} |
|}                                                                            |
|                                                                             |
|@article{PolyhedraArticle,                                                   |
|  title = {{Polyhedra: a package for computations with convex polyhedral obje|
|  author = {Ren{\'e} Birkner and Lars Kastner},                              |
|  journal = {The Journal of Software for Algebra and Geometry: Macaulay2},   |
|  volume = {1},                                                              |
|  year = {2009},                                                             |
|}                                                                            |
|-----------------------------------------------------------------------------|
|cts}},                                                                       |
+-----------------------------------------------------------------------------+

Exports
=======

  * Types
      * Cone -- the class of all rational convex polyhedral cones
      * Fan -- the class of all fans
      * PolyhedralComplex -- the class of all
        polyhedral complexes
      * PolyhedralObject -- the class of all
        polyhedral objects in Polyhedra
      * Polyhedron -- the class of all convex polyhedra
  * Functions and commands
      * addCone -- adds cones to a Fan
      * addPolyhedron -- adds Polyhedra to a
        PolyhedralComplex
      * affineHull -- computes the affine hull of a
        polyhedron
      * affineImage -- computes the affine image of a cone
        or polyhedron
      * affinePreimage -- computes the affine preimage
        of a cone or polyhedron
      * ambDim -- ambient dimension of a Polyhedron, Cone or Fan
      * areCompatible -- checks if the intersection of
        two cones/polyhedra is a face of each
      * barycentricTriangulation -- computes a
        triangulation of a polytope
      * bipyramid -- computes the bipyramid over a polyhedron
      * ccRefinement -- computes the coarsest common
        refinement of a set of rays
      * cellDecompose -- Deprecated variant of {\tt
        regularSubdivision}
      * commonFace -- checks if the intersection is a face
        of both Cones or Polyhedra, or of cones with fans
      * coneFromHData -- Constructing a polyhedral cone
        as intersection of halfspaces.
      * coneFromVData -- computes the positive hull of
        rays, cones, and the cone over a polyhedron
      * cones -- computes all cones of a fan of a certain
        dimension
      * contains -- checks if the first argument contains the
        second argument
      * convexHull -- computing the convex hull of points,
        rays and polyhedra
      * crossPolytope -- computes the d-dimensional
        crosspolytope with diameter 2s
      * cyclicPolytope -- computes the d dimensional
        cyclic polytope with n vertices
      * dualCone --  computes the dual Cone
      * dualFaceRepresentationMap (missing documentation)
      * ehrhart -- calculates the Ehrhart polynomial of a
        polytope
      * emptyPolyhedron -- generates the empty
        polyhedron in n-space
      * faceFan --  computes the fan generated by the cones
        over the faces
      * faces -- computes all faces of a certain codimension of a
        Cone or Polyhedron
      * facesAsCones -- Returns the faces of a cone as
        actual cones.
      * facesAsPolyhedra -- Returns the faces of a
        polyhedron as actual polyhedra.
      * facets -- Giving the facet inequalities of a cone or
        polyhedron.
      * fan -- generates a Fan
      * fanFromGfan -- Construct a fan from output data of
        {\tt Gfan}
      * fVector -- computes the f-vector of a Cone, Polyhedron,
        Fan or PolyhedralComplex
      * halfspaces -- computes the defining half-spaces of a
        Cone or a Polyhedron
      * hilbertBasis -- computes the Hilbert basis of a
        Cone
      * hirzebruch -- computes the fan of the r-th
        Hirzebruch surface
      * hypercube -- Returns the d-dimensional hypercube
      * hyperplanes -- computes the defining hyperplanes of
        a Cone or a Polyhedron
      * imageFan --  computes the fan of the image
      * incompCones -- returns the pairs of incompatible
        cones
      * incompPolyhedra -- returns the pairs of
        incompatible polyhedra
      * inInterior -- checks if a point lies in the relative
        interior of a Cone/Polyhedron
      * interiorLatticePoints -- computes the
        lattice points in the relative interior of a polytope
      * interiorPoint -- computes a point in the relative
        interior of the Polyhedron
      * interiorVector -- computes a vector in the
        relative interior of a Cone
      * isCompact -- checks compactness of a Polyhedron
      * isComplete -- checks completeness of a Fan or
        PolyhedralComplex
      * isFace -- tests if the first argument is a face of the
        second
      * isFullDimensional -- Determine whether a
        polyhedral object is full-dimensional
      * isLatticePolytope -- checks if a polyhedron
        is a lattice polytope
      * isPointed -- checks if a Cone or Fan is pointed
      * isPolytopal -- checks if a Fan is polytopal
      * isPure -- checks if a Fan or PolyhedralComplex is of
        pure dimension
      * isReflexive --  checks if a Polytope is reflexive
      * isSimplicial --  checks if a polyhedral object is
        simplicial
      * latticePoints -- computes the lattice points of a
        polytope
      * latticeVolume -- Returning the lattice volume of
        a polyhedron.
      * linealitySpace -- computes a basis of the
        lineality space
      * linearTransform (missing documentation)
      * linSpace -- Deprecated version of @TO
        "linealitySpace"@
      * maxCones -- displays the generating Cones of a Fan
      * maxFace -- computes the face of a Polyhedron or Cone
        where a weight attains its maximum
      * maxPolyhedra -- displays the generating Polyhedra
        of a PolyhedralComplex
      * minFace -- computes the face of a Polyhedron or Cone
        where a weight attains its minimum
      * minimalNonFaces (missing documentation)
      * minkowskiSum --  computes the Minkowski sum of two
        convex objects
      * minkSummandCone -- computes the Cone of all
        Minkowski summands and the minimal decompositions
      * mixedVolume -- computes the mixed volume of a list
        of polytope
      * newtonPolytope -- computes the Newton polytope
        of a polynomial
      * normalFan -- computes the normalFan of a polyhedron
      * nVertices -- Returns the number of vertices of a
        polyhedron
      * objectiveVector -- computes an objective vector
        of a face of a polyhedron
      * polar --  computes the polar of a polyhedron
      * polarFace --  computes the dual face of the polar
        polyhedron
      * polyhedra -- computes all polyhedra of a polyhedral
        complex of a certain dimension
      * polyhedralComplex -- generates a
        PolyhedralComplex
      * polyhedron -- Turn a cone into a polyhedron
      * polyhedronFromHData -- Constructing a
        polyhedron from its H-representation, i.e. inequalities and equations
      * polytope -- returns a polytope of which the fan is the
        normal fan if it is polytopal
      * posOrthant -- generates the positive orthant in
        n-space
      * proximum -- computes the proximum of the
        Polyhedron/Cone to a point in euclidean metric
      * pyramid -- computes the pyramid over a polyhedron
      * regularSubdivision -- Computes the regular
        cell decomposition
      * regularTriangulation -- Computes a regular
        triangulation of a given polytope.
      * saveSession -- save the actual Polyhedra session to
        a file
      * secondaryPolytope -- computes the secondary
        polytope of a compact polyhedron
      * simplex -- Produces a full-dimensional simplex
      * skeleton -- computes the k-skeleton of a Fan or
        PolyhedralComplex
      * smallestFace -- determines the smallest face of
        the Cone/Polyhedron containing a point
      * smoothSubfan -- computes the subfan of all smooth
        cones
      * stanleyReisnerRing (missing documentation)
      * statePolytope -- computes the state polytope of a
        homogeneous ideal
      * stdSimplex -- generates the d-dimensional standard
        simplex
      * stellarSubdivision -- computes the stellar
        subdivision of the fan by a ray
      * sublatticeBasis -- computes a basis for the
        sublattice generated by integral vectors or lattice points of a
        polytope
      * tailCone -- computes the tail/recession cone of a
        polyhedron
      * toSublattice -- calculates the preimage of a
        polytope in the sublattice generated by its lattice points
      * triangulate -- Deprecated name for {\tt
        barycentricTriangulation}
      * vertexEdgeMatrix -- computes the
        vertex-edge-relations matrix
      * vertexFacetMatrix -- computes the
        vertex-facet-relations matrix
      * vertices -- displays the vertices of a Polyhedron or a
        PolyhedralComplex
      * volume -- computes the volume of a polytope
  * Methods
      * "addCone(Cone,Fan)" -- see addCone, -- adds cones to a
        Fan
      * "addCone(List,Fan)" -- see addCone, -- adds cones to a
        Fan
      * addCone(Fan,Cone) (missing documentation)
      * "addPolyhedron(List,PolyhedralComplex)" -- see addPolyhedron,
        -- adds Polyhedra to a PolyhedralComplex
      * "addPolyhedron(Polyhedron,PolyhedralComplex)" -- see
        addPolyhedron, -- adds Polyhedra to a PolyhedralComplex
      * "affineHull(Polyhedron)" -- see affineHull, --
        computes the affine hull of a polyhedron
      * "affineImage(Cone,Matrix)" -- see
        affineImage(Matrix,Cone,Matrix),
        -- computes the affine image
        of a cone
      * "affineImage(Matrix,Cone)" -- see
        affineImage(Matrix,Cone,Matrix),
        -- computes the affine image
        of a cone
      * affineImage(Matrix,Cone,Matrix)
        -- computes the affine image
        of a cone
      * "affineImage(Matrix,Polyhedron)" -- see
        affineImage(Matrix,Polyhedron,Matrix),
        -- computes the affine
        image of a polyhedron
      * affineImage(Matrix,Polyhedron,Matrix)
        -- computes the affine
        image of a polyhedron
      * "affineImage(Polyhedron,Matrix)" -- see
        affineImage(Matrix,Polyhedron,Matrix),
        -- computes the affine
        image of a polyhedron
      * "affinePreimage(Cone,Matrix)" -- see
        affinePreimage(Matrix,Cone,Matrix),
        -- computes the affine
        preimage of a cone
      * "affinePreimage(Matrix,Cone)" -- see
        affinePreimage(Matrix,Cone,Matrix),
        -- computes the affine
        preimage of a cone
      * affinePreimage(Matrix,Cone,Matrix)
        -- computes the affine
        preimage of a cone
      * "affinePreimage(Matrix,Polyhedron)" -- see
        affinePreimage(Matrix,Polyhedron,Matrix),
        -- computes the
        affine preimage of a polyhedron
      * affinePreimage(Matrix,Polyhedron,Matrix)
        -- computes the
        affine preimage of a polyhedron
      * "affinePreimage(Polyhedron,Matrix)" -- see
        affinePreimage(Matrix,Polyhedron,Matrix),
        -- computes the
        affine preimage of a polyhedron
      * "ambDim(PolyhedralObject)" -- see ambDim, -- ambient
        dimension of a Polyhedron, Cone or Fan
      * "areCompatible(Cone,Cone)" -- see areCompatible,
        -- checks if the intersection of two cones/polyhedra is a face of each
      * "areCompatible(Polyhedron,Polyhedron)" -- see areCompatible,
        -- checks if the intersection of two cones/polyhedra is
        a face of each
      * "barycentricTriangulation(Polyhedron)" -- see
        barycentricTriangulation, -- computes a
        triangulation of a polytope
      * "bipyramid(Polyhedron)" -- see bipyramid, -- computes
        the bipyramid over a polyhedron
      * "ccRefinement(Matrix)" -- see ccRefinement, --
        computes the coarsest common refinement of a set of rays
      * "cellDecompose(Polyhedron,Matrix)" -- see cellDecompose,
        -- Deprecated variant of {\tt regularSubdivision}
      * "commonFace(Cone,Cone)" -- see commonFace, -- checks
        if the intersection is a face of both Cones or Polyhedra, or of cones
        with fans
      * "commonFace(Cone,Fan)" -- see commonFace, -- checks
        if the intersection is a face of both Cones or Polyhedra, or of cones
        with fans
      * "commonFace(Fan,Cone)" -- see commonFace, -- checks
        if the intersection is a face of both Cones or Polyhedra, or of cones
        with fans
      * "commonFace(Fan,Fan)" -- see commonFace, -- checks if
        the intersection is a face of both Cones or Polyhedra, or of cones with
        fans
      * "commonFace(List)" -- see commonFace, -- checks if
        the intersection is a face of both Cones or Polyhedra, or of cones with
        fans
      * "commonFace(Polyhedron,Polyhedron)" -- see commonFace,
        -- checks if the intersection is a face of both Cones or
        Polyhedra, or of cones with fans
      * Cone * Cone -- computes the direct product of two
        cones
      * Cone * Polyhedron -- computes the direct
        product of a cone and a polyhedron
      * Cone + Cone -- computes the Minkowski sum of two
        cones
      * Cone + Polyhedron -- computes the Minkowski
        sum of a cone and a polyhedron
      * Cone == Cone -- equality
      * Cone ? Cone -- compares the Cones
      * cone(Polyhedron) -- Take the cone over a
        polyhedron
      * "coneFromHData(Matrix)" -- see coneFromHData, --
        Constructing a polyhedral cone as intersection of halfspaces.
      * "coneFromHData(Matrix,Matrix)" -- see coneFromHData,
        -- Constructing a polyhedral cone as intersection of
        halfspaces.
      * "coneFromVData(Cone,Cone)" -- see coneFromVData,
        -- computes the positive hull of rays, cones, and the cone over a
        polyhedron
      * "coneFromVData(List)" -- see coneFromVData, --
        computes the positive hull of rays, cones, and the cone over a
        polyhedron
      * "coneFromVData(Matrix)" -- see coneFromVData, --
        computes the positive hull of rays, cones, and the cone over a
        polyhedron
      * "coneFromVData(Matrix,Matrix)" -- see coneFromVData,
        -- computes the positive hull of rays, cones, and the
        cone over a polyhedron
      * "coneFromVData(Polyhedron)" -- see coneFromVData,
        -- computes the positive hull of rays, cones, and the cone over a
        polyhedron
      * "cones(ZZ,Fan)" -- see cones, -- computes all cones of a
        fan of a certain dimension
      * "contains(Cone,Cone)" -- see contains, -- checks if the
        first argument contains the second argument
      * "contains(Cone,Matrix)" -- see contains, -- checks if
        the first argument contains the second argument
      * "contains(Cone,Polyhedron)" -- see contains, -- checks
        if the first argument contains the second argument
      * "contains(Fan,Cone)" -- see contains, -- checks if the
        first argument contains the second argument
      * "contains(List,Cone)" -- see contains, -- checks if the
        first argument contains the second argument
      * "contains(List,Polyhedron)" -- see contains, -- checks
        if the first argument contains the second argument
      * "contains(Polyhedron,Cone)" -- see contains, -- checks
        if the first argument contains the second argument
      * "contains(Polyhedron,Matrix)" -- see contains, --
        checks if the first argument contains the second argument
      * "contains(Polyhedron,Polyhedron)" -- see contains, --
        checks if the first argument contains the second argument
      * "convexHull(List)" -- see convexHull, -- computing
        the convex hull of points, rays and polyhedra
      * "convexHull(Matrix)" -- see convexHull, -- computing
        the convex hull of points, rays and polyhedra
      * "convexHull(Matrix,Matrix)" -- see convexHull, --
        computing the convex hull of points, rays and polyhedra
      * "convexHull(Matrix,Matrix,Matrix)" -- see convexHull,
        -- computing the convex hull of points, rays and polyhedra
      * "convexHull(Polyhedron,Polyhedron)" -- see convexHull,
        -- computing the convex hull of points, rays and polyhedra
      * "crossPolytope(ZZ)" -- see crossPolytope, --
        computes the d-dimensional crosspolytope with diameter 2s
      * "crossPolytope(ZZ,QQ)" -- see crossPolytope, --
        computes the d-dimensional crosspolytope with diameter 2s
      * "crossPolytope(ZZ,ZZ)" -- see crossPolytope, --
        computes the d-dimensional crosspolytope with diameter 2s
      * "cyclicPolytope(ZZ,ZZ)" -- see cyclicPolytope, --
        computes the d dimensional cyclic polytope with n vertices
      * dim(PolyhedralObject) -- computes the
        dimension of a cone, polyhedron, fan or polyhedral complex
      * directProduct(Cone,Cone), --
        computes the direct product of polyhedra and cones
      * "directProduct(Cone,Polyhedron)" -- see directProduct(Cone,Cone),
        -- computes the direct product of
        polyhedra and cones
      * "directProduct(Polyhedron,Cone)" -- see directProduct(Cone,Cone),
        -- computes the direct product of
        polyhedra and cones
      * "directProduct(Polyhedron,Polyhedron)" -- see
        directProduct(Cone,Cone), -- computes
        the direct product of polyhedra and cones
      * directProduct(Fan,Fan) -- computes
        the direct product of two fans
      * "dualCone(Cone)" -- see dualCone, --  computes the dual
        Cone
      * dualFaceRepresentationMap(Cone) (missing documentation)
      * dualFaceRepresentationMap(Polyhedron) (missing documentation)
      * "ehrhart(Polyhedron)" -- see ehrhart, -- calculates the
        Ehrhart polynomial of a polytope
      * "emptyPolyhedron(ZZ)" -- see emptyPolyhedron, --
        generates the empty polyhedron in n-space
      * "faceFan(Polyhedron)" -- see faceFan, --  computes the
        fan generated by the cones over the faces
      * "faces(ZZ,PolyhedralObject)" -- see faces, -- computes all
        faces of a certain codimension of a Cone or Polyhedron
      * faces(PolyhedralObject) -- Giving
        the faces of a polyhedral object.
      * "facesAsCones(ZZ,Cone)" -- see facesAsCones, --
        Returns the faces of a cone as actual cones.
      * "facesAsCones(ZZ,Fan)" -- see facesAsCones, --
        Returns the faces of a cone as actual cones.
      * "facesAsPolyhedra(ZZ,Polyhedron)" -- see facesAsPolyhedra,
        -- Returns the faces of a polyhedron as actual
        polyhedra.
      * "facets(Cone)" -- see facets, -- Giving the facet
        inequalities of a cone or polyhedron.
      * "facets(Polyhedron)" -- see facets, -- Giving the facet
        inequalities of a cone or polyhedron.
      * "fan(Cone)" -- see fan, -- generates a Fan
      * "fan(List)" -- see fan, -- generates a Fan
      * Fan * Fan -- computes the direct product
      * Fan == Fan -- equality
      * "fan(Matrix,List)" -- see fan(Matrix,Matrix,List),
        -- Constructing a fan.
      * fan(Matrix,Matrix,List), --
        Constructing a fan.
      * "fan(Matrix,Matrix,Sequence)" -- see fan(Matrix,Matrix,List),
        -- Constructing a fan.
      * "fan(Matrix,Sequence)" -- see fan(Matrix,Matrix,List),
        -- Constructing a fan.
      * fan(PolyhedralComplex) -- Take the
        fan over a polyhedral complex
      * "fanFromGfan(List)" -- see fanFromGfan, -- Construct
        a fan from output data of {\tt Gfan}
      * "fVector(PolyhedralObject)" -- see fVector, -- computes
        the f-vector of a Cone, Polyhedron, Fan or PolyhedralComplex
      * "halfspaces(Cone)" -- see halfspaces, -- computes the
        defining half-spaces of a Cone or a Polyhedron
      * "halfspaces(Polyhedron)" -- see halfspaces, --
        computes the defining half-spaces of a Cone or a Polyhedron
      * "hilbertBasis(Cone)" -- see hilbertBasis, --
        computes the Hilbert basis of a Cone
      * "hirzebruch(ZZ)" -- see hirzebruch, -- computes the
        fan of the r-th Hirzebruch surface
      * "hypercube(ZZ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,QQ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,QQ,QQ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,QQ,ZZ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,ZZ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,ZZ,QQ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hypercube(ZZ,ZZ,ZZ)" -- see hypercube, -- Returns the
        d-dimensional hypercube
      * "hyperplanes(Cone)" -- see hyperplanes, -- computes
        the defining hyperplanes of a Cone or a Polyhedron
      * "hyperplanes(Polyhedron)" -- see hyperplanes, --
        computes the defining hyperplanes of a Cone or a Polyhedron
      * "imageFan(Matrix,Cone)" -- see imageFan, --  computes
        the fan of the image
      * "incompCones(Cone,Fan)" -- see incompCones, --
        returns the pairs of incompatible cones
      * "incompCones(Fan,Cone)" -- see incompCones, --
        returns the pairs of incompatible cones
      * "incompCones(Fan,Fan)" -- see incompCones, --
        returns the pairs of incompatible cones
      * "incompCones(List)" -- see incompCones, -- returns
        the pairs of incompatible cones
      * "incompPolyhedra(List)" -- see incompPolyhedra,
        -- returns the pairs of incompatible polyhedra
      * "incompPolyhedra(PolyhedralComplex,PolyhedralComplex)" -- see
        incompPolyhedra, -- returns the pairs of incompatible
        polyhedra
      * "incompPolyhedra(PolyhedralComplex,Polyhedron)" -- see
        incompPolyhedra, -- returns the pairs of incompatible
        polyhedra
      * "incompPolyhedra(Polyhedron,PolyhedralComplex)" -- see
        incompPolyhedra, -- returns the pairs of incompatible
        polyhedra
      * "inInterior(Matrix,Cone)" -- see inInterior, --
        checks if a point lies in the relative interior of a Cone/Polyhedron
      * "inInterior(Matrix,Polyhedron)" -- see inInterior, --
        checks if a point lies in the relative interior of a Cone/Polyhedron
      * "interiorLatticePoints(Polyhedron)" -- see interiorLatticePoints,
        -- computes the lattice points in the relative
        interior of a polytope
      * "interiorPoint(Polyhedron)" -- see interiorPoint,
        -- computes a point in the relative interior of the Polyhedron
      * "interiorVector(Cone)" -- see interiorVector, --
        computes a vector in the relative interior of a Cone
      * "intersect(Cone,Cone)" -- see intersect, -- computes
        the intersection of cones, and polyhedra
      * "intersect(Cone,Polyhedron)" -- see intersect, --
        computes the intersection of cones, and polyhedra
      * "intersect(Polyhedron,Cone)" -- see intersect, --
        computes the intersection of cones, and polyhedra
      * "intersect(Polyhedron,Polyhedron)" -- see intersect,
        -- computes the intersection of cones, and polyhedra
      * intersect(Matrix) -- Deprecated variant
        of {\tt coneFromHData}
      * intersect(Matrix,Matrix), --
        Deprecated variants of {\tt polyhedronFromHData} and {\tt
        coneFromHData}
      * "intersect(Matrix,Matrix,Matrix,Matrix)" -- see
        intersect(Matrix,Matrix), -- Deprecated
        variants of {\tt polyhedronFromHData} and {\tt coneFromHData}
      * "isCompact(Polyhedron)" -- see isCompact, -- checks
        compactness of a Polyhedron
      * "isComplete(Fan)" -- see isComplete, -- checks
        completeness of a Fan or PolyhedralComplex
      * "isComplete(PolyhedralComplex)" -- see isComplete, --
        checks completeness of a Fan or PolyhedralComplex
      * "isEmpty(Polyhedron)" -- see isEmpty, -- checks if a
        Polyhedron is empty
      * "isFace(Cone,Cone)" -- see isFace, -- tests if the first
        argument is a face of the second
      * "isFace(Polyhedron,Polyhedron)" -- see isFace, -- tests
        if the first argument is a face of the second
      * "isFullDimensional(PolyhedralObject)" -- see isFullDimensional,
        -- Determine whether a polyhedral object is
        full-dimensional
      * "isLatticePolytope(Polyhedron)" -- see isLatticePolytope,
        -- checks if a polyhedron is a lattice polytope
      * isNormal(Polyhedron) -- checks if a
        polytope is normal in the ambient lattice
      * "isPointed(Cone)" -- see isPointed, -- checks if a
        Cone or Fan is pointed
      * "isPointed(Fan)" -- see isPointed, -- checks if a Cone
        or Fan is pointed
      * "isPolytopal(Fan)" -- see isPolytopal, -- checks if
        a Fan is polytopal
      * "isPure(Fan)" -- see isPure, -- checks if a Fan or
        PolyhedralComplex is of pure dimension
      * "isPure(PolyhedralComplex)" -- see isPure, -- checks if a
        Fan or PolyhedralComplex is of pure dimension
      * "isReflexive(Polyhedron)" -- see isReflexive, --
        checks if a Polytope is reflexive
      * "isSimplicial(PolyhedralObject)" -- see isSimplicial,
        --  checks if a polyhedral object is simplicial
      * isSmooth(Cone) -- checks if a Cone or Fan is
        smooth
      * "isSmooth(Fan)" -- see isSmooth(Cone), --
        checks if a Cone or Fan is smooth
      * isVeryAmple(Polyhedron) -- checks
        if the Polyhedron is very ample
      * isWellDefined(Cone) -- Checks whether a
        polyhedral object is well-defined.
      * "isWellDefined(Fan)" -- see isWellDefined(Cone),
        -- Checks whether a polyhedral object is
        well-defined.
      * "isWellDefined(PolyhedralComplex)" -- see isWellDefined(Cone),
        -- Checks whether a polyhedral object is
        well-defined.
      * "isWellDefined(PolyhedralObject)" -- see isWellDefined(Cone),
        -- Checks whether a polyhedral object is
        well-defined.
      * "isWellDefined(Polyhedron)" -- see isWellDefined(Cone),
        -- Checks whether a polyhedral object is
        well-defined.
      * "latticePoints(Polyhedron)" -- see latticePoints,
        -- computes the lattice points of a polytope
      * "latticeVolume(Polyhedron)" -- see latticeVolume,
        -- Returning the lattice volume of a polyhedron.
      * "linealitySpace(PolyhedralObject)" -- see linealitySpace,
        -- computes a basis of the lineality space
      * linearTransform(Fan,Matrix) (missing documentation)
      * "linSpace(Cone)" -- see linSpace, -- Deprecated version
        of @TO "linealitySpace"@
      * "linSpace(Fan)" -- see linSpace, -- Deprecated version
        of @TO "linealitySpace"@
      * "linSpace(Polyhedron)" -- see linSpace, -- Deprecated
        version of @TO "linealitySpace"@
      * "maxCones(Fan)" -- see maxCones, -- displays the
        generating Cones of a Fan
      * "maxFace(Matrix,Cone)" -- see maxFace, -- computes the
        face of a Polyhedron or Cone where a weight attains its maximum
      * "maxFace(Matrix,Polyhedron)" -- see maxFace, -- computes
        the face of a Polyhedron or Cone where a weight attains its maximum
      * "maxPolyhedra(PolyhedralComplex)" -- see maxPolyhedra,
        -- displays the generating Polyhedra of a
        PolyhedralComplex
      * "minFace(Matrix,Cone)" -- see minFace, -- computes the
        face of a Polyhedron or Cone where a weight attains its minimum
      * "minFace(Matrix,Polyhedron)" -- see minFace, -- computes
        the face of a Polyhedron or Cone where a weight attains its minimum
      * minimalNonFaces(Fan) -- Giving the
        minimal non-faces of a fan..
      * "minkowskiSum(Cone,Cone)" -- see minkowskiSum, --
        computes the Minkowski sum of two convex objects
      * "minkowskiSum(Cone,Polyhedron)" -- see minkowskiSum,
        --  computes the Minkowski sum of two convex objects
      * "minkowskiSum(Polyhedron,Cone)" -- see minkowskiSum,
        --  computes the Minkowski sum of two convex objects
      * "minkowskiSum(Polyhedron,Polyhedron)" -- see minkowskiSum,
        --  computes the Minkowski sum of two convex objects
      * "minkSummandCone(Polyhedron)" -- see minkSummandCone,
        -- computes the Cone of all Minkowski summands and the
        minimal decompositions
      * "mixedVolume(List)" -- see mixedVolume, -- computes
        the mixed volume of a list of polytope
      * "newtonPolytope(RingElement)" -- see newtonPolytope,
        -- computes the Newton polytope of a polynomial
      * normalCone(Polyhedron,Polyhedron)
        -- computes the normal cone of
        a face of a polyhedron
      * "normalFan(Polyhedron)" -- see normalFan, -- computes
        the normalFan of a polyhedron
      * "nVertices(Polyhedron)" -- see nVertices, -- Returns
        the number of vertices of a polyhedron
      * "objectiveVector(Polyhedron,Polyhedron)" -- see objectiveVector,
        -- computes an objective vector of a face of a
        polyhedron
      * "polar(Polyhedron)" -- see polar, --  computes the polar
        of a polyhedron
      * "polarFace(Polyhedron,Polyhedron)" -- see polarFace,
        --  computes the dual face of the polar polyhedron
      * "polyhedra(ZZ,PolyhedralComplex)" -- see polyhedra, --
        computes all polyhedra of a polyhedral complex of a certain dimension
      * "polyhedralComplex(List)" -- see polyhedralComplex,
        -- generates a PolyhedralComplex
      * "polyhedralComplex(Polyhedron)" -- see polyhedralComplex,
        -- generates a PolyhedralComplex
      * polyhedralComplex(Fan) -- Turn a fan
        into a polyhedral complex
      * "polyhedralComplex(Matrix,List)" -- see
        polyhedralComplex(Matrix,Matrix,Matrix,List),
        -- Constructing
        a polyhedral complex.
      * "polyhedralComplex(Matrix,Matrix,List)" -- see
        polyhedralComplex(Matrix,Matrix,Matrix,List),
        -- Constructing
        a polyhedral complex.
      * polyhedralComplex(Matrix,Matrix,Matrix,List)
        -- Constructing
        a polyhedral complex.
      * "polyhedron(Cone)" -- see polyhedron, -- Turn a cone
        into a polyhedron
      * Polyhedron * Cone -- computes the direct
        product of a polyhedron and a cone
      * Polyhedron * Polyhedron -- computes
        the direct product of two polyhedra
      * Polyhedron + Cone -- computes the Minkowski
        sum of a polyhedron and a cone
      * Polyhedron + Polyhedron -- computes the
        Minkowski sum of two polyhedra
      * Polyhedron == Polyhedron -- equality
      * "polyhedronFromHData(Matrix,Matrix)" -- see polyhedronFromHData,
        -- Constructing a polyhedron from its
        H-representation, i.e. inequalities and equations
      * "polyhedronFromHData(Matrix,Matrix,Matrix,Matrix)" -- see
        polyhedronFromHData, -- Constructing a polyhedron
        from its H-representation, i.e. inequalities and equations
      * "polytope(Fan)" -- see polytope, -- returns a polytope
        of which the fan is the normal fan if it is polytopal
      * "posOrthant(ZZ)" -- see posOrthant, -- generates the
        positive orthant in n-space
      * "proximum(Matrix,Cone)" -- see proximum, -- computes
        the proximum of the Polyhedron/Cone to a point in euclidean metric
      * "proximum(Matrix,Polyhedron)" -- see proximum, --
        computes the proximum of the Polyhedron/Cone to a point in euclidean
        metric
      * "pyramid(Polyhedron)" -- see pyramid, -- computes the
        pyramid over a polyhedron
      * QQ * Polyhedron -- rescales a polyhedron by a
        given positive factor
      * "ZZ * Polyhedron" -- see QQ * Polyhedron, --
        rescales a polyhedron by a given positive factor
      * rays(PolyhedralObject) -- displays
        all rays of a Cone, a Fan, or a Polyhedron
      * "regularSubdivision(Matrix,Matrix)" -- see regularSubdivision,
        -- Computes the regular cell decomposition
      * "regularSubdivision(Polyhedron,Matrix)" -- see
        regularSubdivision, -- Computes the regular cell
        decomposition
      * "regularTriangulation(Polyhedron)" -- see regularTriangulation,
        -- Computes a regular triangulation of a given
        polytope.
      * "saveSession(String)" -- see saveSession, -- save
        the actual Polyhedra session to a file
      * "secondaryPolytope(Polyhedron)" -- see secondaryPolytope,
        -- computes the secondary polytope of a compact
        polyhedron
      * "simplex(ZZ)" -- see simplex, -- Produces a
        full-dimensional simplex
      * "simplex(ZZ,QQ)" -- see simplex, -- Produces a
        full-dimensional simplex
      * "simplex(ZZ,ZZ)" -- see simplex, -- Produces a
        full-dimensional simplex
      * "skeleton(ZZ,Fan)" -- see skeleton, -- computes the
        k-skeleton of a Fan or PolyhedralComplex
      * "skeleton(ZZ,PolyhedralComplex)" -- see skeleton, --
        computes the k-skeleton of a Fan or PolyhedralComplex
      * "smallestFace(Matrix,Cone)" -- see smallestFace, --
        determines the smallest face of the Cone/Polyhedron containing a point
      * "smallestFace(Matrix,Polyhedron)" -- see smallestFace,
        -- determines the smallest face of the Cone/Polyhedron
        containing a point
      * "smoothSubfan(Fan)" -- see smoothSubfan, --
        computes the subfan of all smooth cones
      * stanleyReisnerRing(Fan) -- Give the
        Stanley–Reisner ring of a fan.
      * "statePolytope(Ideal)" -- see statePolytope, --
        computes the state polytope of a homogeneous ideal
      * "stdSimplex(ZZ)" -- see stdSimplex, -- generates the
        d-dimensional standard simplex
      * "stellarSubdivision(Fan,Matrix)" -- see stellarSubdivision,
        -- computes the stellar subdivision of the fan by a
        ray
      * "sublatticeBasis(Matrix)" -- see sublatticeBasis,
        -- computes a basis for the sublattice generated by
        integral vectors or lattice points of a polytope
      * "sublatticeBasis(Polyhedron)" -- see sublatticeBasis,
        -- computes a basis for the sublattice generated by
        integral vectors or lattice points of a polytope
      * "tailCone(Polyhedron)" -- see tailCone, -- computes the
        tail/recession cone of a polyhedron
      * "toSublattice(Polyhedron)" -- see toSublattice, --
        calculates the preimage of a polytope in the sublattice generated by
        its lattice points
      * "triangulate(Polyhedron)" -- see triangulate, --
        Deprecated name for {\tt barycentricTriangulation}
      * "vertexEdgeMatrix(Polyhedron)" -- see vertexEdgeMatrix,
        -- computes the vertex-edge-relations matrix
      * "vertexFacetMatrix(Polyhedron)" -- see vertexFacetMatrix,
        -- computes the vertex-facet-relations matrix
      * "vertices(PolyhedralComplex)" -- see vertices, --
        displays the vertices of a Polyhedron or a PolyhedralComplex
      * "vertices(Polyhedron)" -- see vertices, -- displays the
        vertices of a Polyhedron or a PolyhedralComplex
      * "volume(Polyhedron)" -- see volume, -- computes the
        volume of a polytope

For the programmer
==================

The object Polyhedra, is a package (Macaulay2Doc),
defined in Polyhedra.m2, with auxiliary files in Polyhedra/.

-------------------------------------------------------------------------------

The source of this document is in Polyhedra/documentation/intro.m2:53:0.

addCone -- adds cones to a Fan
******************************

  * Usage:
        F1 = addCone(C,F)
        F1 = addCone(L,F)
  * Inputs:
      * C, a convex rational cone,
      * L, a list (Macaulay2Doc), with elements of class
        Cone, or Fan,
      * F, an instance of the type Fan,
  * Outputs:
      * F1, an instance of the type Fan,

Description
===========

If addCone is applied to a Cone, and a Fan, it adds the
Cone to the Fan if they are in the same ambient space, if the Cone is
compatible with every generating Cone of F, but is not a face of one of them.
If one of the first two conditions fails, there will be an error and no fan
will be returned. The pairs of incompatible cones can be accessed with the
function incompCones. If the last condition fails, then the
cone is already in the fan as a face of one of the cones, so it does not have
to be added. The conditions are checked in this order.

If addCone is applied to a List (Macaulay2Doc), and a Fan,
then the function adds the list cone by cone and stops if one of the
three conditions fails for one of the cones. There is again an error for the
first two conditions. The pairs of incompatible cones can again be retrieved
using incompCones.

If applied to a pair of fans it adds the generating cones of the first fan to
the second fan, again checking for the same conditions as above.

 As an example, we make a fan consisting of the following cone and try to add
an adjacent orthant.
+---------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,0,0},{0,1,1},{0,0,1}}; |
+---------------------------------------------------------+
|i2 : F = fan C                                           |
|                                                         |
|o2 = F                                                   |
|                                                         |
|o2 : Fan                                                 |
+---------------------------------------------------------+
|i3 : C = coneFromVData matrix {{-1,0,0},{0,1,0},{0,0,1}};|
+---------------------------------------------------------+
|i4 : incompCones(C,F)                                    |
|                                                         |
|o4 = {(C, Cone{...1...})}                                |
|                                                         |
|o4 : List                                                |
+---------------------------------------------------------+

This shows that the two cones do not intersect in a common face, but if we
divide C into two parts, we get a fan.
+-------------------------------------------------------------+
|i5 : C1 = intersection {C, coneFromHData(matrix {{0,1,-1}})};|
+-------------------------------------------------------------+
|i6 : C2 = intersection {C, coneFromHData(matrix {{0,-1,1}})};|
+-------------------------------------------------------------+
|i7 : F = addCone({C1,C2},F)                                  |
|                                                             |
|o7 = F                                                       |
|                                                             |
|o7 : Fan                                                     |
+-------------------------------------------------------------+

Ways to use addCone:
====================

  * "addCone(Cone,Fan)"
  * "addCone(List,Fan)"
  * addCone(Fan,Cone) (missing documentation)

For the programmer
==================

The object addCone, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:681:0.

addPolyhedron -- adds Polyhedra to a PolyhedralComplex
******************************************************

  * Usage:
        PC1 = addPolyhedron(P,PC)
        PC1 = addPolyhedron(L,PC)
  * Inputs:
      * P, a convex polyhedron,
      * L, a list (Macaulay2Doc), with elements of class
        Polyhedron, or PolyhedralComplex,
      * PC, an instance of the type PolyhedralComplex,
  * Outputs:
      * PC1, an instance of the type PolyhedralComplex,

Description
===========

If addPolyhedron is applied to a Polyhedron, and a
PolyhedralComplex, it adds the Polyhedron to the
PolyhedralComplex if they are in the same ambient space, if the Polyhedron is
compatible with every generating Polyhedron of PC, but is not a face of one of
them. If one of the first two conditions fails, there will be an error and no
PolyhedralComplex will be returned. The pairs of incompatible polyhedra can be
accessed with the function incompPolyhedra. If the last
condition fails, then the Polyhedron is already in the PolyhedralComplex as a
face of one of the polyhedra, so it does not have to be added. The conditions
are checked in this order.

If addPolyhedron is applied to a List (Macaulay2Doc), and a
PolyhedralComplex, then the function adds the list
Polyhedron by Polyhedron and stops if one of the three conditions fails for one
of the polyhedra. There is again an error for the first two conditions. The
pairs of incompatible polyhedra can again be retrieved using
incompPolyhedra. Note that the may also contain
PolyhedralComplexes. Then the function replaces it by its list of generating
polyhedra.

If applied to a pair of PolyhedralComplexes it adds the generating polyhedra of
the first PolyhedralComplex to the second PolyhedralComplex, again checking for
the same conditions as above.

 As an example, we make a PolyhedralComplex consisting of the following
Polyhedron and try to add an adjacent cube.
+-----------------------------------------------------------------------------+
|i1 : P = convexHull matrix                                                   |
|-----------------------------------------------------------------------------|
|{{1,1,1,1,2,2,2,2},{0,0,1,1,0,0,1,1},{0,1,0,1,0,1,0,1}};                     |
+-----------------------------------------------------------------------------+
|i2 : PC = polyhedralComplex P                                                |
|                                                                             |
|o2 = PC                                                                      |
|                                                                             |
|o2 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+
|i3 : P = hypercube 3;                                                        |
+-----------------------------------------------------------------------------+
|i4 : incompPolyhedra(P,PC)                                                   |
|                                                                             |
|o4 = {(P, Polyhedron{...1...})}                                              |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

This shows that the two polyhedra do not intersect in a common face, but if we
divide P into three parts, we get a PolyhedralComplex.
+-----------------------------------------------------------------------------+
|i5 : P1 = convexHull matrix                                                  |
|-----------------------------------------------------------------------------|
|{{1,1,1,1,-1,-1,-1,-1},{0,0,1,1,0,0,1,1},{0,1,0,1,0,1,0,1}};                 |
+-----------------------------------------------------------------------------+
|i6 : P2 = convexHull matrix                                                  |
|-----------------------------------------------------------------------------|
|{{1,1,1,1,-1,-1,-1,-1},{0,1,1,-1,0,1,1,-1},{0,0,-1,-1,0,0,-1,-1}};           |
+-----------------------------------------------------------------------------+
|i7 : P3 = convexHull matrix                                                  |
|-----------------------------------------------------------------------------|
|{{1,1,1,1,-1,-1,-1,-1},{0,0,-1,-1,0,0,-1,-1},{0,1,1,-1,0,1,1,-1}};           |
+-----------------------------------------------------------------------------+
|i8 : P == convexHull {P1,P2,P3}                                              |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+
|i9 : PC = addPolyhedron({P1,P2,P3},PC)                                       |
|                                                                             |
|o9 = PC                                                                      |
|                                                                             |
|o9 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+

Ways to use addPolyhedron:
==========================

  * "addPolyhedron(List,PolyhedralComplex)"
  * "addPolyhedron(Polyhedron,PolyhedralComplex)"

For the programmer
==================

The object addPolyhedron, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:735:0.

affineHull -- computes the affine hull of a polyhedron
******************************************************

  * Usage:
        Q = affineHull P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the affine hull of a polyhedron. This is the affine subspace with the
same dimension as the polyhedron, containing the polyhedron.
+-----------------------+
|i1 : P = stdSimplex 3  |
|                       |
|o1 = P                 |
|                       |
|o1 : Polyhedron        |
+-----------------------+
|i2 : Q = affineHull P  |
|                       |
|o2 = Q                 |
|                       |
|o2 : Polyhedron        |
+-----------------------+
|i3 : linealitySpace Q  |
|                       |
|o3 = | -1 -1 -1 |      |
|     | 1  0  0  |      |
|     | 0  1  0  |      |
|     | 0  0  1  |      |
|                       |
|              4       3|
|o3 : Matrix QQ  <-- QQ |
+-----------------------+

Ways to use affineHull:
=======================

  * "affineHull(Polyhedron)"

For the programmer
==================

The object affineHull, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2310:0.

affineImage -- computes the affine image of a cone or polyhedron
****************************************************************

Ways to use affineImage:
========================

  * "affineImage(Cone,Matrix)" -- see affineImage(Matrix,Cone,Matrix),
    -- computes the affine image of a
    cone
  * "affineImage(Matrix,Cone)" -- see affineImage(Matrix,Cone,Matrix),
    -- computes the affine image of a
    cone
  * affineImage(Matrix,Cone,Matrix)
    -- computes the affine image of a
    cone
  * "affineImage(Matrix,Polyhedron)" -- see
    affineImage(Matrix,Polyhedron,Matrix),
    -- computes the affine image
    of a polyhedron
  * affineImage(Matrix,Polyhedron,Matrix)
    -- computes the affine image
    of a polyhedron
  * "affineImage(Polyhedron,Matrix)" -- see
    affineImage(Matrix,Polyhedron,Matrix),
    -- computes the affine image
    of a polyhedron

For the programmer
==================

The object affineImage, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2315:0.

affineImage(Matrix,Cone,Matrix) -- computes the affine image of a cone
**********************************************************************

  * Function: affineImage,
  * Usage:
        C1 = affineImage(A,C,b)
        C1 = affineImage(A,C)
        C1 = affineImage(C,b)
  * Inputs:
      * A, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * C, a convex rational cone,
      * b, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), and only one column
        representing a vector
  * Outputs:
      * C1, a convex polyhedron,  of class Cone,
        or Polyhedron,

Description
===========

A must be a matrix from the ambient space of the cone C to some other target
space and b must be a vector in that target space, i.e. the number of columns
of A must equal the ambient dimension of C and A and b must have the same
number of rows. Then affineImage computes the polyhedron {(A*c)+b | c in C} and
the cone {A*c | c in C} if b is 0 or omitted. If A is omitted then it is set to
identity.

For example, consider the following three dimensional cone.
+-------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2,3},{3,1,2},{2,3,1}}|
|                                                       |
|o1 = C                                                 |
|                                                       |
|o1 : Cone                                              |
+-------------------------------------------------------+

This Cone can be mapped to the positive orthant:
+---------------------------------------------+
|i2 : A = matrix  {{-5,7,1},{1,-5,7},{7,1,-5}}|
|                                             |
|o2 = | -5 7  1  |                            |
|     | 1  -5 7  |                            |
|     | 7  1  -5 |                            |
|                                             |
|              3       3                      |
|o2 : Matrix ZZ  <-- ZZ                       |
+---------------------------------------------+
|i3 : C1 = affineImage(A,C)                   |
|                                             |
|o3 = C1                                      |
|                                             |
|o3 : Cone                                    |
+---------------------------------------------+
|i4 : rays C1                                 |
|                                             |
|o4 = | 1 0 0 |                               |
|     | 0 1 0 |                               |
|     | 0 0 1 |                               |
|                                             |
|              3       3                      |
|o4 : Matrix ZZ  <-- ZZ                       |
+---------------------------------------------+

Ways to use this method:
========================

  * "affineImage(Cone,Matrix)"
  * "affineImage(Matrix,Cone)"
  * affineImage(Matrix,Cone,Matrix)
    -- computes the affine image of a
    cone
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2352:0.

affineImage(Matrix,Polyhedron,Matrix) -- computes the affine image of a polyhedron
**********************************************************************************

  * Function: affineImage,
  * Usage:
        P1 = affineImage(A,P,v)
        P1 = affineImage(A,P)
        P1 = affineImage(P,v)
  * Inputs:
      * A, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * P, a convex polyhedron,
      * v, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), and only one column
        representing a vector
  * Outputs:
      * P1, a convex polyhedron,

Description
===========

A must be a matrix from the ambient space of the polyhedron P to some other
target space and v must be a vector in that target space, i.e. the number of
columns of A must equal the ambient dimension of P and A and v must have the
same number of rows. Then affineImage computes the polyhedron {(A*p)+v | p in
P} where v is set to 0 if omitted and A is the identity if omitted.

For example, consider the following two dimensional polytope:
+---------------------------------------------------+
|i1 : P = convexHull matrix {{-2,0,2,4},{-8,-2,2,8}}|
|                                                   |
|o1 = P                                             |
|                                                   |
|o1 : Polyhedron                                    |
+---------------------------------------------------+

This polytope is the affine image of the square:
+-------------------------------+
|i2 : A = matrix {{-5,2},{3,-1}}|
|                               |
|o2 = | -5 2  |                 |
|     | 3  -1 |                 |
|                               |
|              2       2        |
|o2 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i3 : v = matrix {{5},{-3}}     |
|                               |
|o3 = | 5  |                    |
|     | -3 |                    |
|                               |
|              2       1        |
|o3 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i4 : Q = affineImage(A,P,v)    |
|                               |
|o4 = Q                         |
|                               |
|o4 : Polyhedron                |
+-------------------------------+
|i5 : vertices Q                |
|                               |
|o5 = | -1 1  -1 1 |            |
|     | -1 -1 1  1 |            |
|                               |
|              2       4        |
|o5 : Matrix QQ  <-- QQ         |
+-------------------------------+

Ways to use this method:
========================

  * "affineImage(Matrix,Polyhedron)"
  * affineImage(Matrix,Polyhedron,Matrix)
    -- computes the affine image
    of a polyhedron
  * "affineImage(Polyhedron,Matrix)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2390:0.

affinePreimage -- computes the affine preimage of a cone or polyhedron
**********************************************************************

Ways to use affinePreimage:
===========================

  * "affinePreimage(Cone,Matrix)" -- see
    affinePreimage(Matrix,Cone,Matrix),
    -- computes the affine preimage
    of a cone
  * "affinePreimage(Matrix,Cone)" -- see
    affinePreimage(Matrix,Cone,Matrix),
    -- computes the affine preimage
    of a cone
  * affinePreimage(Matrix,Cone,Matrix)
    -- computes the affine preimage
    of a cone
  * "affinePreimage(Matrix,Polyhedron)" -- see
    affinePreimage(Matrix,Polyhedron,Matrix),
    -- computes the affine
    preimage of a polyhedron
  * affinePreimage(Matrix,Polyhedron,Matrix)
    -- computes the affine
    preimage of a polyhedron
  * "affinePreimage(Polyhedron,Matrix)" -- see
    affinePreimage(Matrix,Polyhedron,Matrix),
    -- computes the affine
    preimage of a polyhedron

For the programmer
==================

The object affinePreimage, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2395:0.

affinePreimage(Matrix,Cone,Matrix) -- computes the affine preimage of a cone
****************************************************************************

  * Function: affinePreimage,
  * Usage:
        C1 = affinePreimage(A,C,b)
        C1 = affinePreimage(A,C)
        C1 = affinePreimage(C,b)
  * Inputs:
      * A, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * C, a convex rational cone,
      * b, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), and only one column
        representing a vector
  * Outputs:
      * C1, a convex polyhedron,  of class Cone,
        or Polyhedron,

Description
===========

A must be a matrix from some source space to the ambient space of C and b must
be a vector in that ambient space, i.e. the number of rows of A must equal the
ambient dimension of C and the number of rows of b. affinePreimage then
computes the polyhedron {q | (A*q)+b in C} or the cone {q | (A*q) in C} if b is
0 or omitted. If A is omitted then it is set to identity.

For example, consider the following three dimensional cone:
+-------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2,3},{3,1,2},{2,3,1}}|
|                                                       |
|o1 = C                                                 |
|                                                       |
|o1 : Cone                                              |
+-------------------------------------------------------+

We can look at its preimage under the following map:
+---------------------------------------------+
|i2 : A = matrix  {{-5,7,1},{1,-5,7},{7,1,-5}}|
|                                             |
|o2 = | -5 7  1  |                            |
|     | 1  -5 7  |                            |
|     | 7  1  -5 |                            |
|                                             |
|              3       3                      |
|o2 : Matrix ZZ  <-- ZZ                       |
+---------------------------------------------+
|i3 : C1 = affinePreimage(A,C)                |
|                                             |
|o3 = C1                                      |
|                                             |
|o3 : Cone                                    |
+---------------------------------------------+
|i4 : rays C1                                 |
|                                             |
|o4 = | 13 13 10 |                            |
|     | 13 10 13 |                            |
|     | 10 13 13 |                            |
|                                             |
|              3       3                      |
|o4 : Matrix ZZ  <-- ZZ                       |
+---------------------------------------------+

Ways to use this method:
========================

  * "affinePreimage(Cone,Matrix)"
  * "affinePreimage(Matrix,Cone)"
  * affinePreimage(Matrix,Cone,Matrix)
    -- computes the affine preimage
    of a cone
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2431:0.

affinePreimage(Matrix,Polyhedron,Matrix) -- computes the affine preimage of a polyhedron
****************************************************************************************

  * Function: affinePreimage,
  * Usage:
        P1 = affinePreimage(A,P,v)
        P1 = affinePreimage(A,P)
        P1 = affinePreimage(P,v)
  * Inputs:
      * A, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * P, a convex polyhedron,
      * v, a matrix (Macaulay2Doc),  with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), and only one column
        representing a vector
  * Outputs:
      * P1, a convex polyhedron,

Description
===========

A must be a matrix from some source space to the ambient space of the
polyhedron P and v must be a vector in that ambient space, i.e. the number of
rows of A must equal the ambient dimension of P and the number of rows of v.
affinePreimage then computes the polyhedron {q | (A*q)+v in P} where v is set
to 0 if omitted and A is the identity if omitted.

For example, consider the following two dimensional polytope
+---------------------------------------------------+
|i1 : P = convexHull matrix {{-2,0,2,4},{-8,-2,2,8}}|
|                                                   |
|o1 = P                                             |
|                                                   |
|o1 : Polyhedron                                    |
+---------------------------------------------------+

and its affine preimage under the following map:
+-------------------------------+
|i2 : A = matrix {{-5,2},{3,-1}}|
|                               |
|o2 = | -5 2  |                 |
|     | 3  -1 |                 |
|                               |
|              2       2        |
|o2 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i3 : v = matrix {{5},{-3}}     |
|                               |
|o3 = | 5  |                    |
|     | -3 |                    |
|                               |
|              2       1        |
|o3 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i4 : Q = affinePreimage(A,P,v) |
|                               |
|o4 = Q                         |
|                               |
|o4 : Polyhedron                |
+-------------------------------+
|i5 : vertices Q                |
|                               |
|o5 = | -17 -3  7  21 |         |
|     | -46 -10 16 52 |         |
|                               |
|              2       4        |
|o5 : Matrix QQ  <-- QQ         |
+-------------------------------+

Ways to use this method:
========================

  * "affinePreimage(Matrix,Polyhedron)"
  * affinePreimage(Matrix,Polyhedron,Matrix)
    -- computes the affine
    preimage of a polyhedron
  * "affinePreimage(Polyhedron,Matrix)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2468:0.

ambDim -- ambient dimension of a Polyhedron, Cone or Fan
********************************************************

  * Usage:
        d = ambDim P
        d = ambDim C
        d = ambDim F
  * Inputs:
      * P, a convex polyhedron,
      * C, a convex rational cone,
      * F, an instance of the type Fan,
  * Outputs:
      * d, an integer (Macaulay2Doc), , the dimension of the ambient
        space

Description
===========

ambDim returns the dimension of the ambient space either of the
Polyhedron, P, of the Cone, C or the Fan, F.
+---------------------------------------+
|i1 : P = convexHull matrix{{1,0},{0,1}}|
|                                       |
|o1 = P                                 |
|                                       |
|o1 : Polyhedron                        |
+---------------------------------------+
|i2 : ambDim P                          |
|                                       |
|o2 = 2                                 |
+---------------------------------------+

Ways to use ambDim:
===================

  * "ambDim(PolyhedralObject)"

For the programmer
==================

The object ambDim, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:758:0.

areCompatible -- checks if the intersection of two cones/polyhedra is a face of each
************************************************************************************

  * Usage:
        (b,X) = areCompatible(X1,X2)
  * Inputs:
      * X1, a convex rational cone, or a convex polyhedron,
      * X2, a convex rational cone, or a convex polyhedron,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the intersection is a face of each cone, and
        false (Macaulay2Doc), otherwise.
      * C, a convex rational cone, or a convex polyhedron,
        the intersection of both if they are of the same type and
        compatible, otherwise the empty polyhedron.

Description
===========

areCompatible is an extension of commonFace, for two Cones
and for two Polyhedra. It also checks if the intersection X of X1 and X2 is a
face of each and the answer is given by b. Furthermore, the intersection is
given for further calculations if the two cones/polyhedra lie in the same
ambient space. Otherwise, the empty polyhedron in the ambient space of X1 is
given. Note that the input arguments must either both be polyhedra or both be
cones.

For example, consider the following three cones
+-----------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,0},{0,1}};  |
+-----------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,-1},{0,-1}};|
+-----------------------------------------------+
|i3 : C3 = coneFromVData matrix {{1,-1},{2,-1}};|
+-----------------------------------------------+

These might form a fan, but if we check if they are compatible, we see they are
not:
+---------------------------+
|i4 : areCompatible(C1,C2)  |
|                           |
|o4 = (true, Cone{...1...}) |
|                           |
|o4 : Sequence              |
+---------------------------+
|i5 : areCompatible(C2,C3)  |
|                           |
|o5 = (true, Cone{...1...}) |
|                           |
|o5 : Sequence              |
+---------------------------+
|i6 : areCompatible(C3,C1)  |
|                           |
|o6 = (false, Cone{...1...})|
|                           |
|o6 : Sequence              |
+---------------------------+

Ways to use areCompatible:
==========================

  * "areCompatible(Cone,Cone)"
  * "areCompatible(Polyhedron,Polyhedron)"

For the programmer
==================

The object areCompatible, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1074:0.

barycentricTriangulation -- computes a triangulation of a polytope
******************************************************************

  * Usage:
        L = barycentricTriangulation P
  * Inputs:
      * P, a convex polyhedron, , which must be compact
  * Outputs:
      * L, a list (Macaulay2Doc),  containing the simplices of the
        triangulation

Description
===========

barycentricTriangulation  computes the triangulation of the polyhedron P, if it
is compact, i.e. a polytope, recursively. For this, it takes all facets and
checks if they are simplices. If so, then it takes the convex hull of these
with the weighted centre of the polytope (the sum of the vertices divided by
the number of vertices). For those that are not simplices it takes all their
facets and does the same for these.
+-----------------------------------------------------------------------------+
|i1 : P = hypercube 2                                                         |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
+-----------------------------------------------------------------------------+
|i2 : barycentricTriangulation P                                              |
|                                                                             |
|o2 = {{| -1 |, | -1 |, 0}, {| 1  |, | 1 |, 0}, {| -1 |, | 1  |, 0}, {| -1 |, |
|       | -1 |  | 1  |       | -1 |  | 1 |       | -1 |  | -1 |       | 1  |  |
|     ------------------------------------------------------------------------|
|     | 1 |, 0}}                                                              |
|     | 1 |                                                                   |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use barycentricTriangulation:
=====================================

  * "barycentricTriangulation(Polyhedron)"

For the programmer
==================

The object barycentricTriangulation, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2223:0.

bipyramid -- computes the bipyramid over a polyhedron
*****************************************************

  * Usage:
        Q = bipyramid P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

The bipyramid over a Polyhedron, in n-space is constructed by
embedding the Polyhedron into (n+1)-space, computing the barycentre of the
vertices, which is a point in the relative interior, and taking the convex hull
of the embedded Polyhedron and the barycentre x {+/- 1}.

As an example, we construct the octahedron as the bipyramid over the square
(see hypercube).
+------------------------+
|i1 : P = hypercube 2    |
|                        |
|o1 = P                  |
|                        |
|o1 : Polyhedron         |
+------------------------+
|i2 : Q = bipyramid P    |
|Compute barycenter.     |
|Compute barycenter done.|
|                        |
|o2 = Q                  |
|                        |
|o2 : Polyhedron         |
+------------------------+
|i3 : vertices Q         |
|                        |
|o3 = | -1 1  -1 1 0  0 ||
|     | -1 -1 1  1 0  0 ||
|     | 0  0  0  0 -1 1 ||
|                        |
|              3       6 |
|o3 : Matrix QQ  <-- QQ  |
+------------------------+

Ways to use bipyramid:
======================

  * "bipyramid(Polyhedron)"

For the programmer
==================

The object bipyramid, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2495:0.

ccRefinement -- computes the coarsest common refinement of a set of rays
************************************************************************

  * Usage:
        F = ccRefinement R
  * Inputs:
      * R, a matrix (Macaulay2Doc),
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

The coarsest common refinement of a set of rays R is the common refinement of
all possible triangulations  of the rays.

For example, consider a three dimensional cone with four rays:
+---------------------------------------------------+
|i1 : R = matrix {{1,1,-1,-1},{1,-1,1,-1},{1,1,1,1}}|
|                                                   |
|o1 = | 1 1  -1 -1 |                                |
|     | 1 -1 1  -1 |                                |
|     | 1 1  1  1  |                                |
|                                                   |
|              3       4                            |
|o1 : Matrix ZZ  <-- ZZ                             |
+---------------------------------------------------+

The coarsest common refinement has a fifth ray and consists of four cones.
+-----------------------+
|i2 : F = ccRefinement R|
|                       |
|o2 = F                 |
|                       |
|o2 : Fan               |
+-----------------------+
|i3 : rays F            |
|                       |
|o3 = | 0 -1 1  -1 1 |  |
|     | 0 -1 -1 1  1 |  |
|     | 1 1  1  1  1 |  |
|                       |
|              3       5|
|o3 : Matrix ZZ  <-- ZZ |
+-----------------------+

Ways to use ccRefinement:
=========================

  * "ccRefinement(Matrix)"

For the programmer
==================

The object ccRefinement, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2524:0.

cellDecompose -- Deprecated variant of {\tt regularSubdivision}
***************************************************************

Ways to use cellDecompose:
==========================

  * "cellDecompose(Polyhedron,Matrix)"

For the programmer
==================

The object cellDecompose, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/deprecated_documentation.m2:8:0.

commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
****************************************************************************************************

  * Usage:
        b = commonFace(C1,C2)
        b = commonFace(P1,P2)
        b = commonFace(X,F)
        b = commonFace(F,X)
        b = commonFace L
  * Inputs:
      * C1, a convex rational cone,
      * C2, a convex rational cone,
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,
      * F, an instance of the type Fan,
      * X, see Cone, or Fan,
      * L, a list (Macaulay2Doc),
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the intersection is a face both, and
        false (Macaulay2Doc), otherwise.

Description
===========

commonFace checks if the intersection of C1 and C2 or the intersection of P1
and P2 is a face of both. If it is applied to a pair of a cone C and a fan F
then it checks if the intersection of C with every generating cone of F is a
face of each. For two fans it checks this condition for every pair of
generating cones. If applied to a list then the list must contain Fans and
Cones and it checks pairwise for a common face.

For example, consider the following three cones:
+-----------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,0},{0,1}};  |
+-----------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,-1},{0,-1}};|
+-----------------------------------------------+
|i3 : C3 = coneFromVData matrix {{1,-1},{2,-1}};|
+-----------------------------------------------+

for each pair of two of them we can check if their intersection is a common
face:
+----------------------+
|i4 : commonFace(C1,C2)|
|                      |
|o4 = true             |
+----------------------+
|i5 : commonFace(C2,C3)|
|                      |
|o5 = true             |
+----------------------+
|i6 : commonFace(C3,C1)|
|                      |
|o6 = false            |
+----------------------+

Ways to use commonFace:
=======================

  * "commonFace(Cone,Cone)"
  * "commonFace(Cone,Fan)"
  * "commonFace(Fan,Cone)"
  * "commonFace(Fan,Fan)"
  * "commonFace(List)"
  * "commonFace(Polyhedron,Polyhedron)"

For the programmer
==================

The object commonFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1119:0.

Cone -- the class of all rational convex polyhedral cones
*********************************************************

Description
===========

A Cone represents a rational convex polyhedral cone. It need not be full
dimensional or may contain a proper linear subspace. It can be zero
dimensional, i.e. the origin. It is saved as a hash table which contains the
generating rays and the basis of the lineality space of the cone as well as the
defining half-spaces and hyperplanes. The output of a Cone looks like this:
+-------------------------------------------------------------------+
|i1 : coneFromVData matrix {{0,0,-1,-1,1},{2,-2,1,-1,0},{1,1,1,1,0}}|
|                                                                   |
|o1 = Cone{...1...}                                                 |
|                                                                   |
|o1 : Cone                                                          |
+-------------------------------------------------------------------+

This table displays a short summary of the properties of the Cone. The number
of rays is modulo the lineality space. However, one can not access the above
information directly, because this is just a virtual hash table generated for
the output. The data describing a Cone is extracted by the functions included
in this package. A Cone can be constructed as the positive hull (see
coneFromVData)of a set of rays or as the intersection (see
coneFromHData) of a set of linear half-spaces and linear
hyperplanes.

As examples for the positive hull consider the following cones:
+----------------------------------------------+
|i2 : R = matrix{{1,2,3,1},{2,3,1,1},{3,1,2,1}}|
|                                              |
|o2 = | 1 2 3 1 |                              |
|     | 2 3 1 1 |                              |
|     | 3 1 2 1 |                              |
|                                              |
|              3       4                       |
|o2 : Matrix ZZ  <-- ZZ                        |
+----------------------------------------------+
|i3 : C = coneFromVData R                      |
|                                              |
|o3 = C                                        |
|                                              |
|o3 : Cone                                     |
+----------------------------------------------+
|i4 : rays C                                   |
|                                              |
|o4 = | 2 3 1 |                                |
|     | 3 1 2 |                                |
|     | 1 2 3 |                                |
|                                              |
|              3       3                       |
|o4 : Matrix ZZ  <-- ZZ                        |
+----------------------------------------------+
|i5 : LS = matrix{{1},{1},{-2}}                |
|                                              |
|o5 = | 1  |                                   |
|     | 1  |                                   |
|     | -2 |                                   |
|                                              |
|              3       1                       |
|o5 : Matrix ZZ  <-- ZZ                        |
+----------------------------------------------+
|i6 : C = coneFromVData(R,LS)                  |
|                                              |
|o6 = C                                        |
|                                              |
|o6 : Cone                                     |
+----------------------------------------------+
|i7 : rays C                                   |
|                                              |
|o7 = | 0  0 |                                 |
|     | -1 1 |                                 |
|     | 4  5 |                                 |
|                                              |
|              3       2                       |
|o7 : Matrix ZZ  <-- ZZ                        |
+----------------------------------------------+

On the other hand, we can use these matrices as defining half-spaces and
hyperplanes for the intersection:
+------------------------------------------+
|i8 : HS = transpose R                     |
|                                          |
|o8 = | 1 2 3 |                            |
|     | 2 3 1 |                            |
|     | 3 1 2 |                            |
|     | 1 1 1 |                            |
|                                          |
|              4       3                   |
|o8 : Matrix ZZ  <-- ZZ                    |
+------------------------------------------+
|i9 : C = coneFromHData HS                 |
|                                          |
|o9 = C                                    |
|                                          |
|o9 : Cone                                 |
+------------------------------------------+
|i10 : rays C                              |
|                                          |
|o10 = | 1  7  -5 |                        |
|      | 7  -5 1  |                        |
|      | -5 1  7  |                        |
|                                          |
|               3       3                  |
|o10 : Matrix ZZ  <-- ZZ                   |
+------------------------------------------+
|i11 : hyperplanesTmp = transpose LS       |
|                                          |
|o11 = | 1 1 -2 |                          |
|                                          |
|               1       3                  |
|o11 : Matrix ZZ  <-- ZZ                   |
+------------------------------------------+
|i12 : C = coneFromHData(HS,hyperplanesTmp)|
|                                          |
|o12 = C                                   |
|                                          |
|o12 : Cone                                |
+------------------------------------------+
|i13 : rays C                              |
|                                          |
|o13 = | 7  -2 |                           |
|      | -5 4  |                           |
|      | 1  1  |                           |
|                                          |
|               3       2                  |
|o13 : Matrix ZZ  <-- ZZ                   |
+------------------------------------------+

See alsoWorking with cones.

Functions and methods returning a convex rational cone:
=======================================================

  * coneFromHData -- Constructing a polyhedral cone as
    intersection of halfspaces.
  * coneFromVData -- computes the positive hull of rays,
    cones, and the cone over a polyhedron
  * dualCone --  computes the dual Cone
  * normalCone(Polyhedron,Polyhedron)
    -- computes the normal cone of a
    face of a polyhedron
  * posOrthant -- generates the positive orthant in n-space
  * tailCone -- computes the tail/recession cone of a
    polyhedron

Methods that use a convex rational cone:
========================================

  * "addCone(Cone,Fan)" -- see addCone, -- adds cones to a Fan
  * addCone(Fan,Cone) (missing documentation)
  * "affineImage(Cone,Matrix)" -- see affineImage(Matrix,Cone,Matrix),
    -- computes the affine image of a
    cone
  * "affineImage(Matrix,Cone)" -- see affineImage(Matrix,Cone,Matrix),
    -- computes the affine image of a
    cone
  * affineImage(Matrix,Cone,Matrix)
    -- computes the affine image of a
    cone
  * "affinePreimage(Cone,Matrix)" -- see
    affinePreimage(Matrix,Cone,Matrix),
    -- computes the affine preimage
    of a cone
  * "affinePreimage(Matrix,Cone)" -- see
    affinePreimage(Matrix,Cone,Matrix),
    -- computes the affine preimage
    of a cone
  * affinePreimage(Matrix,Cone,Matrix)
    -- computes the affine preimage
    of a cone
  * "areCompatible(Cone,Cone)" -- see areCompatible, --
    checks if the intersection of two cones/polyhedra is a face of each
  * "commonFace(Cone,Cone)" -- see commonFace, -- checks if
    the intersection is a face of both Cones or Polyhedra, or of cones with
    fans
  * "commonFace(Cone,Fan)" -- see commonFace, -- checks if
    the intersection is a face of both Cones or Polyhedra, or of cones with
    fans
  * "commonFace(Fan,Cone)" -- see commonFace, -- checks if
    the intersection is a face of both Cones or Polyhedra, or of cones with
    fans
  * Cone * Cone -- computes the direct product of two
    cones
  * Cone * Polyhedron -- computes the direct
    product of a cone and a polyhedron
  * Cone + Cone -- computes the Minkowski sum of two cones
  * Cone + Polyhedron -- computes the Minkowski sum
    of a cone and a polyhedron
  * Cone == Cone -- equality
  * Cone ? Cone -- compares the Cones
  * "coneFromVData(Cone,Cone)" -- see coneFromVData, --
    computes the positive hull of rays, cones, and the cone over a polyhedron
  * "contains(Cone,Cone)" -- see contains, -- checks if the
    first argument contains the second argument
  * "contains(Cone,Matrix)" -- see contains, -- checks if the
    first argument contains the second argument
  * "contains(Cone,Polyhedron)" -- see contains, -- checks if
    the first argument contains the second argument
  * "contains(Fan,Cone)" -- see contains, -- checks if the
    first argument contains the second argument
  * "contains(List,Cone)" -- see contains, -- checks if the
    first argument contains the second argument
  * "contains(Polyhedron,Cone)" -- see contains, -- checks if
    the first argument contains the second argument
  * directProduct(Cone,Cone) -- computes
    the direct product of polyhedra and cones
  * "directProduct(Cone,Polyhedron)" -- see directProduct(Cone,Cone),
    -- computes the direct product of polyhedra
    and cones
  * "directProduct(Polyhedron,Cone)" -- see directProduct(Cone,Cone),
    -- computes the direct product of polyhedra
    and cones
  * "dualCone(Cone)" -- see dualCone, --  computes the dual
    Cone
  * dualFaceRepresentationMap(Cone) (missing documentation)
  * "facesAsCones(ZZ,Cone)" -- see facesAsCones, -- Returns
    the faces of a cone as actual cones.
  * "facets(Cone)" -- see facets, -- Giving the facet
    inequalities of a cone or polyhedron.
  * "fan(Cone)" -- see fan, -- generates a Fan
  * "halfspaces(Cone)" -- see halfspaces, -- computes the
    defining half-spaces of a Cone or a Polyhedron
  * "hilbertBasis(Cone)" -- see hilbertBasis, -- computes
    the Hilbert basis of a Cone
  * "hyperplanes(Cone)" -- see hyperplanes, -- computes the
    defining hyperplanes of a Cone or a Polyhedron
  * "imageFan(Matrix,Cone)" -- see imageFan, --  computes the
    fan of the image
  * "incompCones(Cone,Fan)" -- see incompCones, -- returns
    the pairs of incompatible cones
  * "incompCones(Fan,Cone)" -- see incompCones, -- returns
    the pairs of incompatible cones
  * "inInterior(Matrix,Cone)" -- see inInterior, -- checks if
    a point lies in the relative interior of a Cone/Polyhedron
  * "interiorVector(Cone)" -- see interiorVector, --
    computes a vector in the relative interior of a Cone
  * "intersect(Cone,Cone)" -- see intersect, -- computes the
    intersection of cones, and polyhedra
  * "intersect(Cone,Polyhedron)" -- see intersect, -- computes
    the intersection of cones, and polyhedra
  * "intersect(Polyhedron,Cone)" -- see intersect, -- computes
    the intersection of cones, and polyhedra
  * "isFace(Cone,Cone)" -- see isFace, -- tests if the first
    argument is a face of the second
  * "isPointed(Cone)" -- see isPointed, -- checks if a Cone or
    Fan is pointed
  * isSmooth(Cone) -- checks if a Cone or Fan is
    smooth
  * isWellDefined(Cone) -- Checks whether a
    polyhedral object is well-defined.
  * "linSpace(Cone)" -- see linSpace, -- Deprecated version of
    @TO "linealitySpace"@
  * "maxFace(Matrix,Cone)" -- see maxFace, -- computes the face
    of a Polyhedron or Cone where a weight attains its maximum
  * "minFace(Matrix,Cone)" -- see minFace, -- computes the face
    of a Polyhedron or Cone where a weight attains its minimum
  * "minkowskiSum(Cone,Cone)" -- see minkowskiSum, --
    computes the Minkowski sum of two convex objects
  * "minkowskiSum(Cone,Polyhedron)" -- see minkowskiSum, --
    computes the Minkowski sum of two convex objects
  * "minkowskiSum(Polyhedron,Cone)" -- see minkowskiSum, --
    computes the Minkowski sum of two convex objects
  * "polyhedron(Cone)" -- see polyhedron, -- Turn a cone into
    a polyhedron
  * Polyhedron * Cone -- computes the direct
    product of a polyhedron and a cone
  * Polyhedron + Cone -- computes the Minkowski sum
    of a polyhedron and a cone
  * "proximum(Matrix,Cone)" -- see proximum, -- computes the
    proximum of the Polyhedron/Cone to a point in euclidean metric
  * "smallestFace(Matrix,Cone)" -- see smallestFace, --
    determines the smallest face of the Cone/Polyhedron containing a point

For the programmer
==================

The object Cone, is a type (Macaulay2Doc), with
ancestor classes PolyhedralObject, <
MutableHashTable (Macaulay2Doc) < HashTable (Macaulay2Doc)
< Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:273:0.

Cone * Cone -- computes the direct product of two cones
*******************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        C = C1 * C2
  * Inputs:
      * C1, a convex rational cone,
      * C2, a convex rational cone,
  * Outputs:
      * C, a convex rational cone,

Description
===========

Computes the direct product of C1 and C2. This is the cone {(x,y) | x in C1, y
in C2}, in the direct product of the ambient spaces.

See also directProduct(Cone,Cone).
+--------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,2},{2,1}}|
|                                            |
|o1 = C1                                     |
|                                            |
|o1 : Cone                                   |
+--------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1}}        |
|                                            |
|o2 = C2                                     |
|                                            |
|o2 : Cone                                   |
+--------------------------------------------+
|i3 : C = C1 * C2                            |
|                                            |
|o3 = C                                      |
|                                            |
|o3 : Cone                                   |
+--------------------------------------------+
|i4 : rays C                                 |
|                                            |
|o4 = | 2 1 0 |                              |
|     | 1 2 0 |                              |
|     | 0 0 1 |                              |
|                                            |
|              3       3                     |
|o4 : Matrix ZZ  <-- ZZ                      |
+--------------------------------------------+

Ways to use this method:
========================

  * Cone * Cone -- computes the direct product of two
    cones
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3151:0.

Cone * Polyhedron -- computes the direct product of a cone and a polyhedron
***************************************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        Q = C * P
  * Inputs:
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the direct product of C and P. This is the polyhedron {(c,p) | c in C,
p in P}, in the direct product of the ambient spaces.

See also directProduct(Cone,Cone).
+-------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2},{2,1}}|
|                                           |
|o1 = C                                     |
|                                           |
|o1 : Cone                                  |
+-------------------------------------------+
|i2 : P =convexHull matrix {{1},{-1}}       |
|                                           |
|o2 = P                                     |
|                                           |
|o2 : Polyhedron                            |
+-------------------------------------------+
|i3 : Q = C * P                             |
|                                           |
|o3 = Q                                     |
|                                           |
|o3 : Polyhedron                            |
+-------------------------------------------+
|i4 : (vertices Q,rays Q)                   |
|                                           |
|o4 = (| 0  |, | 2 1 |)                     |
|      | 0  |  | 1 2 |                      |
|      | 1  |  | 0 0 |                      |
|      | -1 |  | 0 0 |                      |
|                                           |
|o4 : Sequence                              |
+-------------------------------------------+

Ways to use this method:
========================

  * Cone * Polyhedron -- computes the direct
    product of a cone and a polyhedron
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3177:0.

Cone + Cone -- computes the Minkowski sum of two cones
******************************************************

  * Operator: + (Macaulay2Doc),
  * Usage:
        C = C1 + C2
  * Inputs:
      * C1, a convex rational cone,
      * C2, a convex rational cone,
  * Outputs:
      * C, a convex rational cone,

Description
===========

Computes the Minkowski sum of C1 and C2. This is the cone C1 + C2 = {x + y | x
in C1, y in C2}. Note that C1 and C2 have to lie in the same ambient space.

See also minkowskiSum.
+--------------------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,2,3},{2,3,1},{3,1,2}}|
|                                                        |
|o1 = C1                                                 |
|                                                        |
|o1 : Cone                                               |
+--------------------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1},{0},{0}}            |
|                                                        |
|o2 = C2                                                 |
|                                                        |
|o2 : Cone                                               |
+--------------------------------------------------------+
|i3 : C = C1 + C2                                        |
|                                                        |
|o3 = C                                                  |
|                                                        |
|o3 : Cone                                               |
+--------------------------------------------------------+
|i4 : rays C                                             |
|                                                        |
|o4 = | 1 2 3 1 |                                        |
|     | 0 3 1 2 |                                        |
|     | 0 1 2 3 |                                        |
|                                                        |
|              3       4                                 |
|o4 : Matrix ZZ  <-- ZZ                                  |
+--------------------------------------------------------+

Ways to use this method:
========================

  * Cone + Cone -- computes the Minkowski sum of two cones
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3306:0.

Cone + Polyhedron -- computes the Minkowski sum of a cone and a polyhedron
**************************************************************************

  * Operator: + (Macaulay2Doc),
  * Usage:
        Q = C + P
  * Inputs:
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the Minkowski sum of C and P.This is the polyhedron C + P = {c + p | c
in C, p in P}. Note that C and P have to lie in the same ambient space.

See also minkowskiSum.
+-------------------------------------------+
|i1 : C = coneFromVData matrix {{1},{2},{0}}|
|                                           |
|o1 = C                                     |
|                                           |
|o1 : Cone                                  |
+-------------------------------------------+
|i2 : P = hypercube 3                       |
|                                           |
|o2 = P                                     |
|                                           |
|o2 : Polyhedron                            |
+-------------------------------------------+
|i3 : Q = C + P                             |
|                                           |
|o3 = Q                                     |
|                                           |
|o3 : Polyhedron                            |
+-------------------------------------------+
|i4 : (vertices Q,rays Q)                   |
|                                           |
|o4 = (| -1 1  -1 -1 1  -1 |, | 1 |)        |
|      | -1 -1 1  -1 -1 1  |  | 2 |         |
|      | -1 -1 -1 1  1  1  |  | 0 |         |
|                                           |
|o4 : Sequence                              |
+-------------------------------------------+

Ways to use this method:
========================

  * Cone + Polyhedron -- computes the Minkowski sum
    of a cone and a polyhedron
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3333:0.

Cone == Cone -- equality
************************

  * Operator: == (Macaulay2Doc),
  * Usage:
        C1 == C2
  * Inputs:
      * C1, a convex rational cone,
      * C2, a convex rational cone,

Ways to use this method:
========================

  * Cone == Cone -- equality
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3398:0.

Cone ? Cone -- compares the Cones
*********************************

  * Operator: ? (Macaulay2Doc),
  * Usage:
        b = C1 ? C2
  * Inputs:
      * C1, a convex rational cone,
      * C2, a convex rational cone,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), > or < or =

Description
===========

This induces an order on Cones. C1 is greater then C2 if its ambient dimension
is greater, if this is equal then if its dimension is higher and if this is
equal if it has the higher ordered rays and lineality space.
+--------------------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,0},{0,1},{1,1}}      |
|                                                        |
|o1 = C1                                                 |
|                                                        |
|o1 : Cone                                               |
+--------------------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,0,1},{0,1,0},{1,1,0}}|
|                                                        |
|o2 = C2                                                 |
|                                                        |
|o2 : Cone                                               |
+--------------------------------------------------------+
|i3 : C1 ? C2                                            |
|                                                        |
|o3 = <                                                  |
|                                                        |
|o3 : Keyword                                            |
+--------------------------------------------------------+

Ways to use this method:
========================

  * Cone ? Cone -- compares the Cones
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3125:0.

cone(Polyhedron) -- Take the cone over a polyhedron
***************************************************

  * Function: cone (Macaulay2Doc),
  * Usage:
        C = cone P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * C, a convex rational cone,

Description
===========

The polyhedron is embedded at height one, then the cone is taken over it.

+-----------------------+
|i1 : P = hypercube 2   |
|                       |
|o1 = P                 |
|                       |
|o1 : Polyhedron        |
+-----------------------+
|i2 : vertices P        |
|                       |
|o2 = | -1 1  -1 1 |    |
|     | -1 -1 1  1 |    |
|                       |
|              2       4|
|o2 : Matrix QQ  <-- QQ |
+-----------------------+
|i3 : C = cone P        |
|                       |
|o3 = C                 |
|                       |
|o3 : Cone              |
+-----------------------+
|i4 : rays C            |
|                       |
|o4 = | 1  1  1  1 |    |
|     | -1 1  -1 1 |    |
|     | -1 -1 1  1 |    |
|                       |
|              3       4|
|o4 : Matrix ZZ  <-- ZZ |
+-----------------------+

Ways to use this method:
========================

  * cone(Polyhedron) -- Take the cone over a
    polyhedron
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:552:0.

coneFromHData -- Constructing a polyhedral cone as intersection of halfspaces.
******************************************************************************

  * Usage:
        C = coneFromHData H
        C = coneFromHData(H, E)
  * Inputs:
      * H, a matrix (Macaulay2Doc), Matrix containing the
        halfspaces as rows.
      * E, a matrix (Macaulay2Doc), Matrix containing equations
        as rows.
  * Outputs:
      * C, a convex rational cone,

Description
===========

Basic constructor for a cone that takes one or two matrices. The cone consists
of all points that evaluate positive with the rows of the first matrix and zero
with the rows of the second matrix.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.

Ways to use coneFromHData:
==========================

  * "coneFromHData(Matrix)"
  * "coneFromHData(Matrix,Matrix)"

For the programmer
==================

The object coneFromHData, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:328:0.

coneFromVData -- computes the positive hull of rays, cones, and the cone over a polyhedron
******************************************************************************************

  * Usage:
        C = coneFromVData M
        C = coneFromVData(M,N)
        C = coneFromVData(C1,C2)
        C = coneFromVData P
        C = coneFromVData L
  * Inputs:
      * M, a matrix (Macaulay2Doc), with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * N, a matrix (Macaulay2Doc), with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * C1, a convex rational cone,
      * C2, a convex rational cone,
      * P, a convex polyhedron,
      * L, a list (Macaulay2Doc),
  * Outputs:
      * C, a convex rational cone,

Description
===========

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.

coneFromVData computes the positive hull of the input. In the first two cases
it considers the columns of M as a set of rays and the columns of N (if given)
as generators of the lineality space and computes the cone that is the positive
hull of the rays plus the lineality space. The two matrices must have the same
number of rows, i.e. the columns must lie in the same ambient space. If N is
not given or equal to 0 then the resulting cone is pointed. The rays need not
be a minimal generating set of the cone. If two cones are inserted it computes
their positive hull if they lie in the same ambient space. In the case of a
polyhedron it computes the cone given by all positive multiples of points of
the polyhedron. If applied to a list, it may contain a combination of the
following in any order.
  * Rays, given by a matrix R over ZZ (Macaulay2Doc), or QQ (Macaulay2Doc),
  * Rays and a lineality space, given by a sequence (R,LS) of two matrices over
    ZZ (Macaulay2Doc), or QQ (Macaulay2Doc),
  * Cone
  * Polyhedron

Then coneFromVData computes the positive hull of all inserted objects, if they
are in the same ambient space, i.e. all matrices must have the same number of
rows, which must equal the ambient dimension of all cones and polyhedra.

As a first example consider the following 2 dimensional cone in 3 space:
+-----------------------------------+
|i1 : R = matrix {{1,2},{2,1},{0,0}}|
|                                   |
|o1 = | 1 2 |                       |
|     | 2 1 |                       |
|     | 0 0 |                       |
|                                   |
|              3       2            |
|o1 : Matrix ZZ  <-- ZZ             |
+-----------------------------------+
|i2 : C = coneFromVData R           |
|                                   |
|o2 = C                             |
|                                   |
|o2 : Cone                          |
+-----------------------------------+

We can construct a full dimensional cone out of this one by adding a lineality
space for example:
+------------------------------+
|i3 : LS = matrix {{0},{0},{1}}|
|                              |
|o3 = | 0 |                    |
|     | 0 |                    |
|     | 1 |                    |
|                              |
|              3       1       |
|o3 : Matrix ZZ  <-- ZZ        |
+------------------------------+
|i4 : C1 = coneFromVData (R,LS)|
|                              |
|o4 = C1                       |
|                              |
|o4 : Cone                     |
+------------------------------+

The resulting cone is not pointed anymore, because it contains the subspace
spanned by (0,0,1). To get a full dimensional pointed cone we have to add
another ray to C. For this we can apply coneFromVData to a list containing C
and the new ray:
+-----------------------------+
|i5 : r = matrix {{0},{1},{2}}|
|                             |
|o5 = | 0 |                   |
|     | 1 |                   |
|     | 2 |                   |
|                             |
|              3       1      |
|o5 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i6 : C2 = coneFromVData {C,r}|
|                             |
|o6 = C2                      |
|                             |
|o6 : Cone                    |
+-----------------------------+

Another way would be, if we would have r not as a ray but already as a cone:
+------------------------+
|i7 : r = coneFromVData r|
|                        |
|o7 = r                  |
|                        |
|o7 : Cone               |
+------------------------+

In this case we can just take the positive hull of the two cones:
+----------------------------+
|i8 : C3 = coneFromVData(C,r)|
|                            |
|o8 = C3                     |
|                            |
|o8 : Cone                   |
+----------------------------+
|i9 : C3 == C2               |
|                            |
|o9 = true                   |
+----------------------------+

Ways to use coneFromVData:
==========================

  * "coneFromVData(Cone,Cone)"
  * "coneFromVData(List)"
  * "coneFromVData(Matrix)"
  * "coneFromVData(Matrix,Matrix)"
  * "coneFromVData(Polyhedron)"

For the programmer
==================

The object coneFromVData, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:518:0.

cones -- computes all cones of a fan of a certain dimension
***********************************************************

  * Usage:
        L = cones(d,F)
  * Inputs:
      * d, an integer (Macaulay2Doc),  between 0 and the dimension of
        the fan
      * F, an instance of the type Fan,
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

cones computes the List (Macaulay2Doc), of all Cones in F of
dimension d.
+-----------------------------------------------------------------------------+
|i1 : F = normalFan hypercube 3                                               |
|                                                                             |
|o1 = F                                                                       |
|                                                                             |
|o1 : Fan                                                                     |
+-----------------------------------------------------------------------------+
|i2 : L = cones(2,F)                                                          |
|                                                                             |
|o2 = {{0, 2}, {0, 3}, {0, 4}, {0, 5}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 4},|
|     ------------------------------------------------------------------------|
|     {2, 5}, {3, 4}, {3, 5}}                                                 |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

To actually see the cones of the fan we can look at their rays, for example:
+-----------------------------------------------------------------------------+
|i3 : raysF = rays F                                                          |
|                                                                             |
|o3 = | -1 1 0  0 0  0 |                                                      |
|     | 0  0 -1 1 0  0 |                                                      |
|     | 0  0 0  0 -1 1 |                                                      |
|                                                                             |
|              3       6                                                      |
|o3 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i4 : apply(L, c -> raysF_c)                                                  |
|                                                                             |
|o4 = {| -1 0  |, | -1 0 |, | -1 0  |, | -1 0 |, | 1 0  |, | 1 0 |, | 1 0  |, |
|      | 0  -1 |  | 0  1 |  | 0  0  |  | 0  0 |  | 0 -1 |  | 0 1 |  | 0 0  |  |
|      | 0  0  |  | 0  0 |  | 0  -1 |  | 0  1 |  | 0 0  |  | 0 0 |  | 0 -1 |  |
|     ------------------------------------------------------------------------|
|     | 1 0 |, | 0  0  |, | 0  0 |, | 0 0  |, | 0 0 |}                        |
|     | 0 0 |  | -1 0  |  | -1 0 |  | 1 0  |  | 1 0 |                         |
|     | 0 1 |  | 0  -1 |  | 0  1 |  | 0 -1 |  | 0 1 |                         |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use cones:
==================

  * "cones(ZZ,Fan)"

For the programmer
==================

The object cones, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:788:0.

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 (Macaulay2Doc),
      * X, either a Cone, a Polyhedron, or a
        Matrix (Macaulay2Doc), with only one column giving a
        point.
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the first argument contains the second argument,
        see false (Macaulay2Doc), 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 (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1164:0.

convexHull -- computing the convex hull of points, rays and polyhedra
*********************************************************************

  * Usage:
        P = convexHull M
        P = convexHull(M,N)
        P = convexHull(P1,P2)
        P = convexHull L
        P = convexHull(M,N,W)
  * Inputs:
      * M, a matrix (Macaulay2Doc), with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * N, a matrix (Macaulay2Doc), with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * W, a matrix (Macaulay2Doc), with entries in ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc),
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,
      * L, a list (Macaulay2Doc),
  * Outputs:
      * P, a convex polyhedron,

Description
===========

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.

convexHull computes the convex hull of the input. In the first two cases it
considers the columns of M as a set of points and the columns of N (if given)
as a set of rays and computes the polyhedron that is the convex hull of the
points plus the rays. The two matrices must have the same number of rows, i.e.
the columns must lie in the same ambient space. If N is not given or equal to
0, then the resulting polyhedron is compact and hence a polytope. The points
need not be the vertices of the polyhedron. In the third case it computes the
convex hull of P1 and P2 if they lie in the same ambient space. Finally, it
computes the convex hull of a list L where the list may contain a combination
of the following in any order.
  * Points, given by a matrix M over ZZ (Macaulay2Doc), or QQ (Macaulay2Doc),
  * Points and ray generators, given by a sequence (V,R)of two matrices over
    ZZ (Macaulay2Doc), or QQ (Macaulay2Doc),
  * Points, ray generators and lineality generators, given by a sequence
    (M,N,W)of three matrices over ZZ (Macaulay2Doc), or QQ (Macaulay2Doc),
  * Cone
  * Polyhedron

Then convexHull computes the convex hull of all inserted objects, if they are
in the same ambient space, i.e. all matrices must have the same number of rows,
which must equal the ambient dimension of all cones and polyhedra.

For example, consider the square in QQ (Macaulay2Doc),^2:
+-----------------------------------------+
|i1 : M = matrix {{1,1,-1,-1},{1,-1,1,-1}}|
|                                         |
|o1 = | 1 1  -1 -1 |                      |
|     | 1 -1 1  -1 |                      |
|                                         |
|              2       4                  |
|o1 : Matrix ZZ  <-- ZZ                   |
+-----------------------------------------+
|i2 : P = convexHull M                    |
|                                         |
|o2 = P                                   |
|                                         |
|o2 : Polyhedron                          |
+-----------------------------------------+

If we add a ray, then it is not compact anymore:
+-------------------------+
|i3 : r = matrix {{1},{2}}|
|                         |
|o3 = | 1 |               |
|     | 2 |               |
|                         |
|              2       1  |
|o3 : Matrix ZZ  <-- ZZ   |
+-------------------------+
|i4 : P =convexHull(M,r)  |
|                         |
|o4 = P                   |
|                         |
|o4 : Polyhedron          |
+-------------------------+

If we add some more vertices to M then we get a hexagon:
+-------------------------------------+
|i5 : N = matrix {{-2,-2,0},{0,-2,-2}}|
|                                     |
|o5 = | -2 -2 0  |                    |
|     | 0  -2 -2 |                    |
|                                     |
|              2       3              |
|o5 : Matrix ZZ  <-- ZZ               |
+-------------------------------------+
|i6 : Q = convexHull(M|N)             |
|                                     |
|o6 = Q                               |
|                                     |
|o6 : Polyhedron                      |
+-------------------------------------+

Again if we add the ray r then the polyhedron is not compact:
+---------------------------+
|i7 : Q1 = convexHull(M|N,r)|
|                           |
|o7 = Q1                    |
|                           |
|o7 : Polyhedron            |
+---------------------------+

To get this polyhedron we could also have used the application of convexHull to
lists or pairs of polyhedra:
+--------------------------+
|i8 : P1 = convexHull {P,N}|
|                          |
|o8 = P1                   |
|                          |
|o8 : Polyhedron           |
+--------------------------+
|i9 : P1 == Q1             |
|                          |
|o9 = true                 |
+--------------------------+
|i10 : P1 = convexHull(P,Q)|
|                          |
|o10 = P1                  |
|                          |
|o10 : Polyhedron          |
+--------------------------+
|i11 : P1 == Q1            |
|                          |
|o11 = true                |
+--------------------------+

Ways to use convexHull:
=======================

  * "convexHull(List)"
  * "convexHull(Matrix)"
  * "convexHull(Matrix,Matrix)"
  * "convexHull(Matrix,Matrix,Matrix)"
  * "convexHull(Polyhedron,Polyhedron)"

For the programmer
==================

The object convexHull, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:431:0.

crossPolytope -- computes the d-dimensional crosspolytope with diameter 2s
**************************************************************************

  * Usage:
        P = crossPolytope(d,s)
  * Inputs:
      * d, an integer (Macaulay2Doc),  strictly positive
      * s, see ZZ (Macaulay2Doc), or QQ (Macaulay2Doc), positive
        (optional)
  * Outputs:
      * P, a convex polyhedron,

Description
===========

The d-dimensional crossPolytope with diameter s is the convex hull of +/- s
times the standard basis in QQ (Macaulay2Doc),^d. If s is omitted it
is set to 1.
+-----------------------------------+
|i1 : P = crossPolytope(3,3/2)      |
|                                   |
|o1 = P                             |
|                                   |
|o1 : Polyhedron                    |
+-----------------------------------+
|i2 : vertices P                    |
|                                   |
|o2 = | -3/2 3/2 0    0   0    0   ||
|     | 0    0   -3/2 3/2 0    0   ||
|     | 0    0   0    0   -3/2 3/2 ||
|                                   |
|              3       6            |
|o2 : Matrix QQ  <-- QQ             |
+-----------------------------------+

Ways to use crossPolytope:
==========================

  * "crossPolytope(ZZ)"
  * "crossPolytope(ZZ,QQ)"
  * "crossPolytope(ZZ,ZZ)"

For the programmer
==================

The object crossPolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2888:0.

cyclicPolytope -- computes the d dimensional cyclic polytope with n vertices
****************************************************************************

  * Usage:
        P = cyclicPolytope(d,n)
  * Inputs:
      * d, an integer (Macaulay2Doc), strictly positive
      * n, an integer (Macaulay2Doc), strictly positive
  * Outputs:
      * P, a convex polyhedron,

Description
===========

The d-dimensional cyclicPolytope with n vertices is the convex hull of n points
on the moment curve in QQ (Macaulay2Doc),^d. The moment curve is
defined by t -> (t,t^2,...,t^d) and the function takes the points {0,...,n-1}.
+----------------------------+
|i1 : P = cyclicPolytope(3,5)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : vertices P             |
|                            |
|o2 = | 0 1 2 3  4  |        |
|     | 0 1 4 9  16 |        |
|     | 0 1 8 27 64 |        |
|                            |
|              3       5     |
|o2 : Matrix QQ  <-- QQ      |
+----------------------------+

Ways to use cyclicPolytope:
===========================

  * "cyclicPolytope(ZZ,ZZ)"

For the programmer
==================

The object cyclicPolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2912:0.

dim(PolyhedralObject) -- computes the dimension of a cone, polyhedron, fan or polyhedral complex
************************************************************************************************

  * Function: dim (Macaulay2Doc),
  * Usage:
        d = dim PO
  * Inputs:
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * d, an integer (Macaulay2Doc),

Description
===========

+-------------------------------------------+
|i1 : C = coneFromVData matrix {{2,3},{3,2}}|
|                                           |
|o1 = C                                     |
|                                           |
|o1 : Cone                                  |
+-------------------------------------------+
|i2 : dim C                                 |
|                                           |
|o2 = 2                                     |
+-------------------------------------------+

Returns the dimension of a cone.
+---------------------+
|i3 : F = hirzebruch 3|
|                     |
|o3 = F               |
|                     |
|o3 : Fan             |
+---------------------+
|i4 : dim F           |
|                     |
|o4 = 2               |
+---------------------+

Returns the dimension of a fan. This is the maximal dimension of all cones of
the fan.
+--------------------------------------------------+
|i5 : P = convexHull matrix {{1,-1,0,0},{0,0,1,-1}}|
|                                                  |
|o5 = P                                            |
|                                                  |
|o5 : Polyhedron                                   |
+--------------------------------------------------+
|i6 : dim P                                        |
|                                                  |
|o6 = 2                                            |
+--------------------------------------------------+

Returns the dimension of a polyhedron.
+-------------------------------------------+
|i7 : PC = polyhedralComplex crossPolytope 3|
|                                           |
|o7 = PC                                    |
|                                           |
|o7 : PolyhedralComplex                     |
+-------------------------------------------+
|i8 : dim PC                                |
|                                           |
|o8 = 3                                     |
+-------------------------------------------+

Returns the dimension of a polyhedral complex. This is the maximal dimension of
all polyhedra of the complex.

Ways to use this method:
========================

  * dim(PolyhedralObject) -- computes the
    dimension of a cone, polyhedron, fan or polyhedral complex
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3465:0.

directProduct(Cone,Cone) -- computes the direct product of polyhedra and cones
******************************************************************************

  * Function: directProduct (Macaulay2Doc),
  * Usage:
        P = directProduct(X,Y)
  * Inputs:
      * X, a convex rational cone, Cone, or
        Polyhedron,
      * Y, a convex rational cone, Cone, or
        Polyhedron,
  * Outputs:
      * P, see Cone, or Polyhedron,

Description
===========

The directProduct of X and Y is the polyhedron {(x,y) | x in X, y in Y} in the
direct product of the ambient spaces. If X and Y are both cones, then the
direct product is again a cone and the output is then also given as a
Cone, otherwise as a Polyhedron.
+--------------------------------------+
|i1 : P = hypercube 1                  |
|                                      |
|o1 = P                                |
|                                      |
|o1 : Polyhedron                       |
+--------------------------------------+
|i2 : Q = hypercube 2                  |
|                                      |
|o2 = Q                                |
|                                      |
|o2 : Polyhedron                       |
+--------------------------------------+
|i3 : directProduct(P,Q) == hypercube 3|
|                                      |
|o3 = true                             |
+--------------------------------------+

See also Cone * Cone, Cone * Polyhedron,
see Polyhedron * Cone, and
Polyhedron * Polyhedron.

Ways to use this method:
========================

  * directProduct(Cone,Cone) -- computes
    the direct product of polyhedra and cones
  * "directProduct(Cone,Polyhedron)"
  * "directProduct(Polyhedron,Cone)"
  * "directProduct(Polyhedron,Polyhedron)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2588:0.

directProduct(Fan,Fan) -- computes the direct product of two fans
*****************************************************************

  * Function: directProduct (Macaulay2Doc),
  * Usage:
        F = directProduct(F1,F2)
  * Inputs:
      * F1, an instance of the type Fan,
      * F2, an instance of the type Fan,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

The directProduct of two fans is the fan given by C = C1 x C2 for all cones C1
in F1 and C2 in F2 in the direct product of the ambient spaces.
+-------------------------------+
|i1 : F1 = normalFan hypercube 1|
|                               |
|o1 = F1                        |
|                               |
|o1 : Fan                       |
+-------------------------------+
|i2 : F2 = normalFan hypercube 2|
|                               |
|o2 = F2                        |
|                               |
|o2 : Fan                       |
+-------------------------------+
|i3 : F = directProduct(F1,F2)  |
|                               |
|o3 = F                         |
|                               |
|o3 : Fan                       |
+-------------------------------+
|i4 : F == normalFan hypercube 3|
|                               |
|o4 = true                      |
+-------------------------------+

See also Fan * Fan.

Ways to use this method:
========================

  * directProduct(Fan,Fan) -- computes the
    direct product of two fans
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2615:0.

dualCone --  computes the dual Cone
***********************************

  * Usage:
        Cv = dualCone C
  * Inputs:
      * C, a convex rational cone,
  * Outputs:
      * Cv, a convex rational cone,

Description
===========

The dual cone of C in QQ (Macaulay2Doc),^n is the cone in the dual
ambient space (see QQ (Macaulay2Doc),^n)^*, given by {p in (see QQ (Macaulay2Doc),
^n)^* | p*c >= 0 for all c in C}.
+-------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2},{2,1}}|
|                                           |
|o1 = C                                     |
|                                           |
|o1 : Cone                                  |
+-------------------------------------------+
|i2 : Cv = dualCone C                       |
|                                           |
|o2 = Cv                                    |
|                                           |
|o2 : Cone                                  |
+-------------------------------------------+
|i3 : rays Cv                               |
|                                           |
|o3 = | 2  -1 |                             |
|     | -1 2  |                             |
|                                           |
|              2       2                    |
|o3 : Matrix ZZ  <-- ZZ                     |
+-------------------------------------------+

Ways to use dualCone:
=====================

  * "dualCone(Cone)"

For the programmer
==================

The object dualCone, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2638:0.

dualFaceRepresentationMap
*************************

Ways to use dualFaceRepresentationMap:
======================================

  * dualFaceRepresentationMap(Cone) (missing documentation)
  * dualFaceRepresentationMap(Polyhedron) (missing documentation)

For the programmer
==================

The object dualFaceRepresentationMap (missing documentation) is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in currentString:1:387.

ehrhart -- calculates the Ehrhart polynomial of a polytope
**********************************************************

  * Usage:
        f = ehrhart P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * f, a ring element (Macaulay2Doc), Ehrhart polynomial
        as element of QQ[x]

Description
===========

ehrhart can only be applied to polytopes, i.e. compact polyhedra. To calculate
the Ehrhart polynomial, the number of lattice points in the first n dilations
of the polytope are calculated, where n is the dimension of the polytope. A
system of linear equations is then solved to find the polynomial.
+----------------------------------------------------------------------+
|i1 : P = convexHull transpose matrix {{0,0,0},{1,0,0},{0,1,0},{1,1,3}}|
|                                                                      |
|o1 = P                                                                |
|                                                                      |
|o1 : Polyhedron                                                       |
+----------------------------------------------------------------------+
|i2 : ehrhart P                                                        |
|                                                                      |
|     1 3    2   3                                                     |
|o2 = -x  + x  + -x + 1                                                |
|     2          2                                                     |
|                                                                      |
|o2 : QQ[x]                                                            |
+----------------------------------------------------------------------+

Ways to use ehrhart:
====================

  * "ehrhart(Polyhedron)"

For the programmer
==================

The object ehrhart, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2935:0.

emptyPolyhedron -- generates the empty polyhedron in n-space
************************************************************

  * Usage:
        P = emptyPolyhedron n
  * Inputs:
      * n, an integer (Macaulay2Doc), strictly positive
  * Outputs:
      * P, a convex polyhedron,

Description
===========

Generates the empty polyhedron in n-space.
+--------------------------+
|i1 : P = emptyPolyhedron 3|
|                          |
|o1 = P                    |
|                          |
|o1 : Polyhedron           |
+--------------------------+

Ways to use emptyPolyhedron:
============================

  * "emptyPolyhedron(ZZ)"

For the programmer
==================

The object emptyPolyhedron, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2954:0.

faceFan --  computes the fan generated by the cones over the faces
******************************************************************

  * Usage:
        F = faceFan P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

For a polyhedron with the origin in its relative interior, the face fan is the
fan generated by the cones over the faces of the polytope. Hence the origin
must be in the relative interior.
+-----------------------------------------------+
|i1 : P = hypercube 2                           |
|                                               |
|o1 = P                                         |
|                                               |
|o1 : Polyhedron                                |
+-----------------------------------------------+
|i2 : F = faceFan P                             |
|                                               |
|o2 = F                                         |
|                                               |
|o2 : Fan                                       |
+-----------------------------------------------+
|i3 : raysF = rays F                            |
|                                               |
|o3 = | -1 1  -1 1 |                            |
|     | -1 -1 1  1 |                            |
|                                               |
|              2       4                        |
|o3 : Matrix ZZ  <-- ZZ                         |
+-----------------------------------------------+
|i4 : apply(maxCones F, mc -> raysF_mc)         |
|                                               |
|o4 = {| -1 -1 |, | 1  1 |, | -1 1  |, | -1 1 |}|
|      | -1 1  |  | -1 1 |  | -1 -1 |  | 1  1 | |
|                                               |
|o4 : List                                      |
+-----------------------------------------------+

Ways to use faceFan:
====================

  * "faceFan(Polyhedron)"

For the programmer
==================

The object faceFan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2660:0.

faces -- computes all faces of a certain codimension of a Cone or Polyhedron
****************************************************************************

  * Usage:
        L = faces(k,C)
        L = faces(k,P)
        L = faces(F)
  * Inputs:
      * k, an integer (Macaulay2Doc),
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * L, a hash table (Macaulay2Doc), containing the indices
        of the vertices/rays used in the codim  kfaces of P

Description
===========

faces computes the faces of codimension k of the given Cone, or
Polyhedron, where k must be between 0 and the dimension of
the second argument. The faces will be of the same class as the original convex
object. If the parameterkis omitted,faces will return a HashTable containing
the faces with the codimensions as keys.

For example, we can look at the edges of the cyclicPolytope with 5 vertices in
3 space
+-----------------------------------------------------------------------------+
|i1 : P = cyclicPolytope(3,5)                                                 |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
+-----------------------------------------------------------------------------+
|i2 : L = faces(2,P)                                                          |
|                                                                             |
|o2 = {({0, 2}, {}), ({1, 2}, {}), ({0, 1}, {}), ({0, 3}, {}), ({2, 3}, {}),  |
|     ------------------------------------------------------------------------|
|     ({3, 4}, {}), ({0, 4}, {}), ({2, 4}, {}), ({1, 4}, {})}                 |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Since this is only a list of polyhedra we look at their vertices:
+-----------------------------------------------------------------------------+
|i3 : vertP = vertices P                                                      |
|                                                                             |
|o3 = | 0 1 2 3  4  |                                                         |
|     | 0 1 4 9  16 |                                                         |
|     | 0 1 8 27 64 |                                                         |
|                                                                             |
|              3       5                                                      |
|o3 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+
|i4 : apply(L, f -> vertP_(f#0))                                              |
|                                                                             |
|o4 = {| 0 2 |, | 1 2 |, | 0 1 |, | 0 3  |, | 2 3  |, | 3  4  |, | 0 4  |, | 2|
|      | 0 4 |  | 1 4 |  | 0 1 |  | 0 9  |  | 4 9  |  | 9  16 |  | 0 16 |  | 4|
|      | 0 8 |  | 1 8 |  | 0 1 |  | 0 27 |  | 8 27 |  | 27 64 |  | 0 64 |  | 8|
|     ------------------------------------------------------------------------|
|     4  |, | 1 4  |}                                                         |
|     16 |  | 1 16 |                                                          |
|     64 |  | 1 64 |                                                          |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use faces:
==================

  * "faces(ZZ,PolyhedralObject)"
  * faces(PolyhedralObject) -- Giving the
    faces of a polyhedral object.

For the programmer
==================

The object faces, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1571:0.

faces(PolyhedralObject) -- Giving the faces of a polyhedral object.
*******************************************************************

  * Function: faces,
  * Usage:
        fk = faces PO
  * Inputs:
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * M, a hash table (Macaulay2Doc),

Description
===========

Returns a HashTable with the faces of a polyhedral object sorted by
codimension. The faces are given as lists containing the indices of the
rays/vertices of the original object contained in the face.

+-----------------------------------------------------------------------------+
|i1 : fC = faces hypercube 2                                                  |
|                                                                             |
|o1 = HashTable{0 => {({0, 1, 2, 3}, {})}                                    }|
|               1 => {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})} |
|               2 => {({0}, {}), ({2}, {}), ({1}, {}), ({3}, {})}             |
|               3 => {}                                                       |
|                                                                             |
|o1 : HashTable                                                               |
+-----------------------------------------------------------------------------+
|i2 : fC#1                                                                    |
|                                                                             |
|o2 = {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})}                |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * faces(PolyhedralObject) -- Giving the
    faces of a polyhedral object.
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:95:0.

facesAsCones -- Returns the faces of a cone as actual cones.
************************************************************

  * Usage:
        fC = facesAsCones(n,C)
  * Inputs:
      * C, a convex rational cone,
      * n, an integer (Macaulay2Doc), codimension of the faces
  * Outputs:
      * fC, a list (Macaulay2Doc),

Description
===========

While faces, returns a list of lists of indices for the rays that
make up the codimension n faces, this gives a list of actual cones. It is just
a small wrapper around faces. Whenever possible, use faces,
instead.

+--------------------------------------+
|i1 : L = facesAsCones(1, posOrthant 2)|
|                                      |
|o1 = {Cone{...1...}, Cone{...1...}}   |
|                                      |
|o1 : List                             |
+--------------------------------------+
|i2 : rays L#0                         |
|                                      |
|o2 = | 0 |                            |
|     | 1 |                            |
|                                      |
|              2       1               |
|o2 : Matrix ZZ  <-- ZZ                |
+--------------------------------------+
|i3 : rays L#1                         |
|                                      |
|o3 = | 1 |                            |
|     | 0 |                            |
|                                      |
|              2       1               |
|o3 : Matrix ZZ  <-- ZZ                |
+--------------------------------------+
+-----------------------------------------------------------------+
|i4 : F = normalFan hypercube 2                                   |
|                                                                 |
|o4 = F                                                           |
|                                                                 |
|o4 : Fan                                                         |
+-----------------------------------------------------------------+
|i5 : L = facesAsCones(1, F)                                      |
|                                                                 |
|o5 = {Cone{...1...}, Cone{...1...}, Cone{...1...}, Cone{...1...}}|
|                                                                 |
|o5 : List                                                        |
+-----------------------------------------------------------------+
|i6 : rays L#0                                                    |
|                                                                 |
|o6 = | -1 |                                                      |
|     | 0  |                                                      |
|                                                                 |
|              2       1                                          |
|o6 : Matrix ZZ  <-- ZZ                                           |
+-----------------------------------------------------------------+

Ways to use facesAsCones:
=========================

  * "facesAsCones(ZZ,Cone)"
  * "facesAsCones(ZZ,Fan)"

For the programmer
==================

The object facesAsCones, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:186:0.

facesAsPolyhedra -- Returns the faces of a polyhedron as actual polyhedra.
**************************************************************************

  * Usage:
        fP = facesAsPolyhedra(n,P)
  * Inputs:
      * P, a convex polyhedron,
      * n, an integer (Macaulay2Doc), codimension of the faces
  * Outputs:
      * fP, a list (Macaulay2Doc),

Description
===========

While faces, returns a list of lists of indices for the vertices
that make up the codimension n faces, this gives a list of actual polyhedra. It
is just a small wrapper around faces. Whenever possible, use
faces, instead.

+-----------------------------------------------------------------------------+
|i1 : facesAsPolyhedra(1, hypercube 2)                                        |
|                                                                             |
|o1 = {Polyhedron{...1...}, Polyhedron{...1...}, Polyhedron{...1...},         |
|     ------------------------------------------------------------------------|
|     Polyhedron{...1...}}                                                    |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use facesAsPolyhedra:
=============================

  * "facesAsPolyhedra(ZZ,Polyhedron)"

For the programmer
==================

The object facesAsPolyhedra, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:152:0.

facets -- Giving the facet inequalities of a cone or polyhedron.
****************************************************************

  * Usage:
        fC = facets C
        fP = facets P
  * Inputs:
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * M, a matrix (Macaulay2Doc),
      * L, a list (Macaulay2Doc),

Description
===========

For a cone one matrix is returned.

For a polyhedron the affine inequalities are returned as a pair of two
matrices, where the second matrix consists of a single row.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.

+-----------------------------+
|i1 : fC = facets posOrthant 2|
|                             |
|o1 = | 1 0 |                 |
|     | 0 1 |                 |
|                             |
|              2       2      |
|o1 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i2 : fP = facets hypercube 2 |
|                             |
|o2 = (| -1 0  |, | 1 |)      |
|      | 1  0  |  | 1 |       |
|      | 0  -1 |  | 1 |       |
|      | 0  1  |  | 1 |       |
|                             |
|o2 : Sequence                |
+-----------------------------+

Ways to use facets:
===================

  * "facets(Cone)"
  * "facets(Polyhedron)"

For the programmer
==================

The object facets, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:34:0.

Fan -- the class of all fans
****************************

Description
===========

A Fan represents a fan of rational convex polyhedral cones, i.e. a collection
of cones, such that for every cone in the fan all faces are in the fan and for
every two cones in the fan their intersection is a face of each (intersection
condition). It need not be full dimensional or pure, and the cones need not be
pointed. It is saved as a hash table which contains a list of the generating
cones of the fan starting with those of maximal dimension. So for every cone in
this list all faces are considered to be in the fan. The output of a Fan looks
like this:
+------------------------------+
|i1 : normalFan crossPolytope 3|
|                              |
|o1 = Fan{...1...}             |
|                              |
|o1 : Fan                      |
+------------------------------+

This table displays a short summary of the properties of the Fan. However, one
can not access the above information directly, because this is just a virtual
hash table generated for the output. The data defining a Fan is extracted by
the functions included in this package. A Fan can be constructed by collecting
Cones that satisfy the intersection condition. Every cone that is added to a
Fan is always considered as the collection of the Cone and all of its faces.
+------------------------------------------------+
|i2 : C1 = coneFromVData matrix {{2,2},{1,-1}};  |
+------------------------------------------------+
|i3 : C2 = coneFromVData matrix {{2,-2},{1,1}};  |
+------------------------------------------------+
|i4 : C3 = coneFromVData matrix {{-2,-2},{1,-1}};|
+------------------------------------------------+
|i5 : C4 = coneFromVData matrix {{-2,2},{-1,-1}};|
+------------------------------------------------+
|i6 : F = fan {C1,C2,C3,C4}                      |
|                                                |
|o6 = F                                          |
|                                                |
|o6 : Fan                                        |
+------------------------------------------------+

This fan is for example the normal fan of a ''flattened'' crosspolytope in
2-space.

 See also Working with fans.

Functions and methods returning an object of class Fan:
=======================================================

  * ccRefinement -- computes the coarsest common
    refinement of a set of rays
  * faceFan --  computes the fan generated by the cones over
    the faces
  * fan -- generates a Fan
  * hirzebruch -- computes the fan of the r-th Hirzebruch
    surface
  * imageFan --  computes the fan of the image
  * normalFan -- computes the normalFan of a polyhedron
  * skeleton -- computes the k-skeleton of a Fan or
    PolyhedralComplex
  * smoothSubfan -- computes the subfan of all smooth
    cones
  * "stellarSubdivision(Fan,Matrix)" -- see stellarSubdivision,
    -- computes the stellar subdivision of the fan by a ray

Methods that use an object of class Fan:
========================================

  * "addCone(Cone,Fan)" -- see addCone, -- adds cones to a Fan
  * "addCone(List,Fan)" -- see addCone, -- adds cones to a Fan
  * addCone(Fan,Cone) (missing documentation)
  * "commonFace(Cone,Fan)" -- see commonFace, -- checks if
    the intersection is a face of both Cones or Polyhedra, or of cones with
    fans
  * "commonFace(Fan,Cone)" -- see commonFace, -- checks if
    the intersection is a face of both Cones or Polyhedra, or of cones with
    fans
  * "commonFace(Fan,Fan)" -- see commonFace, -- checks if the
    intersection is a face of both Cones or Polyhedra, or of cones with fans
  * "cones(ZZ,Fan)" -- see cones, -- computes all cones of a fan
    of a certain dimension
  * "contains(Fan,Cone)" -- see contains, -- checks if the
    first argument contains the second argument
  * directProduct(Fan,Fan) -- computes the
    direct product of two fans
  * "facesAsCones(ZZ,Fan)" -- see facesAsCones, -- Returns
    the faces of a cone as actual cones.
  * Fan * Fan -- computes the direct product
  * Fan == Fan -- equality
  * "incompCones(Cone,Fan)" -- see incompCones, -- returns
    the pairs of incompatible cones
  * "incompCones(Fan,Cone)" -- see incompCones, -- returns
    the pairs of incompatible cones
  * "incompCones(Fan,Fan)" -- see incompCones, -- returns
    the pairs of incompatible cones
  * "isComplete(Fan)" -- see isComplete, -- checks
    completeness of a Fan or PolyhedralComplex
  * "isPointed(Fan)" -- see isPointed, -- checks if a Cone or
    Fan is pointed
  * "isPolytopal(Fan)" -- see isPolytopal, -- checks if a
    Fan is polytopal
  * "isPure(Fan)" -- see isPure, -- checks if a Fan or
    PolyhedralComplex is of pure dimension
  * "isSmooth(Fan)" -- see isSmooth(Cone), -- checks
    if a Cone or Fan is smooth
  * "isWellDefined(Fan)" -- see isWellDefined(Cone),
    -- Checks whether a polyhedral object is
    well-defined.
  * linearTransform(Fan,Matrix) (missing documentation)
  * "linSpace(Fan)" -- see linSpace, -- Deprecated version of
    @TO "linealitySpace"@
  * "maxCones(Fan)" -- see maxCones, -- displays the generating
    Cones of a Fan
  * minimalNonFaces(Fan) -- Giving the minimal
    non-faces of a fan..
  * polyhedralComplex(Fan) -- Turn a fan
    into a polyhedral complex
  * "polytope(Fan)" -- see polytope, -- returns a polytope of
    which the fan is the normal fan if it is polytopal
  * "skeleton(ZZ,Fan)" -- see skeleton, -- computes the
    k-skeleton of a Fan or PolyhedralComplex
  * "smoothSubfan(Fan)" -- see smoothSubfan, -- computes
    the subfan of all smooth cones
  * stanleyReisnerRing(Fan) -- Give the
    Stanley–Reisner ring of a fan.

For the programmer
==================

The object Fan, is a type (Macaulay2Doc), with ancestor
classes PolyhedralObject, < MutableHashTable (Macaulay2Doc)
< HashTable (Macaulay2Doc) <
Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:310:0.

fan -- generates a Fan
**********************

  * Usage:
        F = fan C
        F = fan L
  * Inputs:
      * C, a convex rational cone,
      * L, a list (Macaulay2Doc), with elements of class
        Cone, or Fan,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

 If fan is applied to a Cone, it generates the Fan,
given by the Cone and all of its faces. If applied to a List (Macaulay2Doc),
the list must only contain Cones and Fans in the same
ambient space. Then it adds the Cones in the List and the generating Cones of
the Fans in the List one by one to the Fan, checking each time if the new Cone
is compatible with the cones that have already been added, i.e. that the
intersection with each of them is a face of both Cones (intersection
condition).

If one of the cones is in the wrong ambient space, there will be an error and
no fan will be returned. If the intersection condition fails, there will also
be an error. The pairs of incompatible cones can be accessed with the function
incompCones.
+-----------------------------------------------+
|i1 : C = coneFromVData matrix {{1,-1},{0,-1}}  |
|                                               |
|o1 = C                                         |
|                                               |
|o1 : Cone                                      |
+-----------------------------------------------+
|i2 : F = fan C                                 |
|                                               |
|o2 = F                                         |
|                                               |
|o2 : Fan                                       |
+-----------------------------------------------+
|i3 : C1 = coneFromVData matrix {{1,0},{0,1}};  |
+-----------------------------------------------+
|i4 : C2 = coneFromVData matrix {{0,-1},{1,-1}};|
+-----------------------------------------------+
|i5 : F = fan {C,C1,C2}                         |
|                                               |
|o5 = F                                         |
|                                               |
|o5 : Fan                                       |
+-----------------------------------------------+

Ways to use fan:
================

  * "fan(Cone)"
  * "fan(List)"
  * "fan(Matrix,List)" -- see fan(Matrix,Matrix,List),
    -- Constructing a fan.
  * fan(Matrix,Matrix,List), --
    Constructing a fan.
  * "fan(Matrix,Matrix,Sequence)" -- see fan(Matrix,Matrix,List),
    -- Constructing a fan.
  * "fan(Matrix,Sequence)" -- see fan(Matrix,Matrix,List),
    -- Constructing a fan.
  * fan(PolyhedralComplex) -- Take the fan
    over a polyhedral complex

For the programmer
==================

The object fan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:594:0.

Fan * Fan -- computes the direct product
****************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        F = F1 * F2
  * Inputs:
      * F1, an instance of the type Fan,
      * F2, an instance of the type Fan,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

Computes the direct product of two fans. This is the fan given by C=C1 x C2 for
all cones C1 in F1 and C2 in F2, in the direct product of the ambient spaces.

See also directProduct(Fan,Fan).
+-------------------------------+
|i1 : F1 = normalFan hypercube 1|
|                               |
|o1 = F1                        |
|                               |
|o1 : Fan                       |
+-------------------------------+
|i2 : F2 = normalFan hypercube 2|
|                               |
|o2 = F2                        |
|                               |
|o2 : Fan                       |
+-------------------------------+
|i3 : F = F1 * F2               |
|                               |
|o3 = F                         |
|                               |
|o3 : Fan                       |
+-------------------------------+
|i4 : F == normalFan hypercube 3|
|                               |
|o4 = true                      |
+-------------------------------+

Ways to use this method:
========================

  * Fan * Fan -- computes the direct product
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3256:0.

Fan == Fan -- equality
**********************

  * Operator: == (Macaulay2Doc),
  * Usage:
        F1 == F2
  * Inputs:
      * F1, an instance of the type Fan,
      * F2, an instance of the type Fan,

Ways to use this method:
========================

  * Fan == Fan -- equality
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3409:0.

fan(Matrix,Matrix,List) -- Constructing a fan.
**********************************************

  * Function: fan,
  * Usage:
        F = fan(M,N,L)
  * Inputs:
      * M, a matrix (Macaulay2Doc), Matrix containing the rays as
        columns.
      * N, a matrix (Macaulay2Doc), Matrix containing generators
        of the lineality space as columns.
      * L, a list (Macaulay2Doc), List containing lists with
        indices of the rays of the maximal cones.
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

Basic constructor for fans that takes a matrix containing the rays of the fan
and a list of lists with the indices of the rays in the maximal cones.
Optionally one may provide a lineality space.

This constructor does not check well-definedness, see isWellDefined (Macaulay2Doc).

+----------------------------+
|i1 : M = matrix{{1,0},{0,1}}|
|                            |
|o1 = | 1 0 |                |
|     | 0 1 |                |
|                            |
|              2       2     |
|o1 : Matrix ZZ  <-- ZZ      |
+----------------------------+
|i2 : L = {{0,1}}            |
|                            |
|o2 = {{0, 1}}               |
|                            |
|o2 : List                   |
+----------------------------+
|i3 : F = fan(M,L)           |
|                            |
|o3 = F                      |
|                            |
|o3 : Fan                    |
+----------------------------+
|i4 : N = matrix{{1},{1}}    |
|                            |
|o4 = | 1 |                  |
|     | 1 |                  |
|                            |
|              2       1     |
|o4 : Matrix ZZ  <-- ZZ      |
+----------------------------+
|i5 : F1 = fan(M,N,L)        |
|                            |
|o5 = F1                     |
|                            |
|o5 : Fan                    |
+----------------------------+

Ways to use this method:
========================

  * "fan(Matrix,List)"
  * fan(Matrix,Matrix,List), --
    Constructing a fan.
  * "fan(Matrix,Matrix,Sequence)"
  * "fan(Matrix,Sequence)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:253:0.

fan(PolyhedralComplex) -- Take the fan over a polyhedral complex
****************************************************************

  * Function: fan,
  * Usage:
        F = fan PC
  * Inputs:
      * PC, an instance of the type PolyhedralComplex,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

The polyhedral complex is embedded at height one and the fan is taken over it.

+-------------------------------------------------------------+
|i1 : C = hypercube 2                                         |
|                                                             |
|o1 = C                                                       |
|                                                             |
|o1 : Polyhedron                                              |
+-------------------------------------------------------------+
|i2 : F = faces(1,C)                                          |
|                                                             |
|o2 = {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})}|
|                                                             |
|o2 : List                                                    |
+-------------------------------------------------------------+
|i3 : V = vertices C                                          |
|                                                             |
|o3 = | -1 1  -1 1 |                                          |
|     | -1 -1 1  1 |                                          |
|                                                             |
|              2       4                                      |
|o3 : Matrix QQ  <-- QQ                                       |
+-------------------------------------------------------------+
|i4 : L = linealitySpace C                                    |
|                                                             |
|o4 = 0                                                       |
|                                                             |
|              2                                              |
|o4 : Matrix QQ  <-- 0                                        |
+-------------------------------------------------------------+
|i5 : PC = polyhedralComplex(V,L,F)                           |
|                                                             |
|o5 = PC                                                      |
|                                                             |
|o5 : PolyhedralComplex                                       |
+-------------------------------------------------------------+
|i6 : vertices PC                                             |
|                                                             |
|o6 = | -1 1  -1 1 |                                          |
|     | -1 -1 1  1 |                                          |
|                                                             |
|              2       4                                      |
|o6 : Matrix QQ  <-- QQ                                       |
+-------------------------------------------------------------+
|i7 : maxPolyhedra PC                                         |
|                                                             |
|o7 = {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})}|
|                                                             |
|o7 : List                                                    |
+-------------------------------------------------------------+
|i8 : dim PC                                                  |
|                                                             |
|o8 = 1                                                       |
+-------------------------------------------------------------+

Ways to use this method:
========================

  * fan(PolyhedralComplex) -- Take the fan
    over a polyhedral complex
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:658:0.

fanFromGfan -- Construct a fan from output data of {\tt Gfan}
*************************************************************

  * Usage:
        F = fanFromGfan L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

Method used by the package Tropical (missing documentation) to construct a fan
from Gfan output. Gfan produces more data than just rays and maximal cones and
this constructor will save that data to avoid recomputation.

Ways to use fanFromGfan:
========================

  * "fanFromGfan(List)"

For the programmer
==================

The object fanFromGfan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:487:0.

fVector -- computes the f-vector of a Cone, Polyhedron, Fan or PolyhedralComplex
********************************************************************************

  * Usage:
        f = fVector C
        f = fVector P
  * Inputs:
      * P, an instance of the type PolyhedralObject,
  * Outputs:
      * L, a list (Macaulay2Doc), containing the number of faces
        for each codimension

Description
===========

The i-th entry of the f-vector of P is the number of dimension i-1 faces of P,
so it starts with the number vertices, has dim(P)+1 entries, and the last entry
is 1 for P itself. It is the same for a Cone C.
+----------------------------+
|i1 : P = cyclicPolytope(3,5)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : fVector P              |
|                            |
|o2 = {5, 9, 6, 1}           |
|                            |
|o2 : List                   |
+----------------------------+

Ways to use fVector:
====================

  * "fVector(PolyhedralObject)"

For the programmer
==================

The object fVector, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1594:0.

halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron
*************************************************************************

  * Usage:
        M = halfspaces C
        (M,v) = halfspaces P
  * Inputs:
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * M, a matrix (Macaulay2Doc), with entries over QQ (Macaulay2Doc),
      * v, a matrix (Macaulay2Doc), with entries over QQ (Macaulay2Doc),
        and only one column

Description
===========

halfspaces returns the defining affine half-spaces. For a polyhedron P the
output is (M,v), where the source of M has the dimension of the ambient space
of P and v is a one column matrix in the target space of M such that P = {p in
H | M*p =< v} where H is the intersection of the defining affine hyperplanes.

 For a cone C the output is the matrixM that is the same matrix as before but v
is omitted since it is 0, so C = {c in H | M*c => 0} and H is the intersection
of the defining linear hyperplanes.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.
+------------------------------------------------+
|i1 : R = matrix {{1,1,2,2},{2,3,1,3},{3,2,3,1}};|
|                                                |
|              3       4                         |
|o1 : Matrix ZZ  <-- ZZ                          |
+------------------------------------------------+
|i2 : V = matrix {{1,-1},{0,0},{0,0}};           |
|                                                |
|              3       2                         |
|o2 : Matrix ZZ  <-- ZZ                          |
+------------------------------------------------+
|i3 : C = coneFromVData R                        |
|                                                |
|o3 = C                                          |
|                                                |
|o3 : Cone                                       |
+------------------------------------------------+
|i4 : halfspaces C                               |
|                                                |
|o4 = | -2 1  1  |                               |
|     | 1  -1 1  |                               |
|     | 1  1  -1 |                               |
|     | 5  -1 -1 |                               |
|                                                |
|              4       3                         |
|o4 : Matrix ZZ  <-- ZZ                          |
+------------------------------------------------+

Now we take this cone over a line and get a polyhedron.
+--------------------------+
|i5 : P = convexHull(V,R)  |
|                          |
|o5 = P                    |
|                          |
|o5 : Polyhedron           |
+--------------------------+
|i6 : halfspaces P         |
|                          |
|o6 = (| 0  1  -3 |, | 0 |)|
|      | 2  -1 -1 |  | 2 | |
|      | -1 1  -1 |  | 1 | |
|      | 0  -3 1  |  | 0 | |
|      | -1 -1 1  |  | 1 | |
|      | -5 1  1  |  | 5 | |
|                          |
|o6 : Sequence             |
+--------------------------+

Ways to use halfspaces:
=======================

  * "halfspaces(Cone)"
  * "halfspaces(Polyhedron)"

For the programmer
==================

The object halfspaces, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:912:0.

hilbertBasis -- computes the Hilbert basis of a Cone
****************************************************

  * Usage:
        HB = hilbertBasis C
  * Inputs:
      * C, a convex rational cone,
  * Outputs:
      * L, a list (Macaulay2Doc), containing the elements of the
        Hilbert basis

Description
===========

The Hilbert basis of the cone C is computed by the Project-and-Lift-algorithm
by Raymond Hemmecke (see below). It computes a Hilbert basis of the cone modulo
the lineality space, so it returns the list of one column matrices that give
the Hilbert basis of the Cone if one adds the basis of the lineality space and
its negative. For the Project-and-Lift-algorithm see:

Raymond Hemmecke's (see http://www.hemmecke.de/raymond/ ) On the computation of
Hilbert bases of cones, in A. M. Cohen, X.-S. Gao, and N. Takayama, editors,
Mathematical Software, ICMS 2002, pages 307317. World Scientific, 2002.
+-------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2},{2,1}}|
|                                           |
|o1 = C                                     |
|                                           |
|o1 : Cone                                  |
+-------------------------------------------+
|i2 : hilbertBasis C                        |
|                                           |
|o2 = {| 1 |, | 1 |, | 2 |}                 |
|      | 1 |  | 2 |  | 1 |                  |
|                                           |
|o2 : List                                  |
+-------------------------------------------+

Beginning with Macaulay2 version 1.24.11, this method calls the internal
function rawHilbertBasis which calls the C++ library libnormaliz (Macaulay2Doc).

See also
========

  * hilbertBasis(Matrix) (FourTiTwo), --
    calculates the Hilbert basis of the cone; invokes "hilbert" from 4ti2

Ways to use hilbertBasis:
=========================

  * "hilbertBasis(Cone)"

For the programmer
==================

The object hilbertBasis, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1626:0.

hirzebruch -- computes the fan of the r-th Hirzebruch surface
*************************************************************

  * Usage:
        F = hirzebruch r
  * Inputs:
      * r, an integer (Macaulay2Doc), positive
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

The r-th Hirzebruch surface is the Fan, in QQ (Macaulay2Doc),
^2 generated by the cones <e_1,e_2>, <e_1,-e_2>,
<-e_1+r*e_2,-e_2> and <-e_1+r*e_2,e_2>.
+---------------------------------------------+
|i1 : F = hirzebruch 3                        |
|                                             |
|o1 = F                                       |
|                                             |
|o1 : Fan                                     |
+---------------------------------------------+
|i2 : raysF = rays F                          |
|                                             |
|o2 = | 1 0  0 -1 |                           |
|     | 0 -1 1 3  |                           |
|                                             |
|              2       4                      |
|o2 : Matrix ZZ  <-- ZZ                       |
+---------------------------------------------+
|i3 : apply(maxCones F, mc -> raysF_mc)       |
|                                             |
|o3 = {| 1 0 |, | 0 -1 |, | 1 0  |, | 0  -1 |}|
|      | 0 1 |  | 1 3  |  | 0 -1 |  | -1 3  | |
|                                             |
|o3 : List                                    |
+---------------------------------------------+

Ways to use hirzebruch:
=======================

  * "hirzebruch(ZZ)"

For the programmer
==================

The object hirzebruch, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2976:0.

hypercube -- Returns the d-dimensional hypercube
************************************************

  * Usage:
        P = hypercube d
        P = hypercube(d, s)
        P = hypercube(d, a, b)
  * Inputs:
      * d, an integer (Macaulay2Doc), the dimension, a strictly
        positive integer
      * s, a rational number (Macaulay2Doc), a positive rational
        scaling factor
      * a, a rational number (Macaulay2Doc),
      * b, a rational number (Macaulay2Doc),
  * Outputs:
      * P, a convex polyhedron,

Description
===========

Produces the d-dimensional hypercube $[-1,1]^d$. If provided with a scaling
factor $s$, the hypercube $[-s,s]^d$ is returned. Alternatively one can specify
the edge directly as $[a,b]$, then the hypercube $[a,b]^d$ is returned

+-------------------------------+
|i1 : P = hypercube 3           |
|                               |
|o1 = P                         |
|                               |
|o1 : Polyhedron                |
+-------------------------------+
|i2 : vertices P                |
|                               |
|o2 = | -1 1  -1 1  -1 1  -1 1 ||
|     | -1 -1 1  1  -1 -1 1  1 ||
|     | -1 -1 -1 -1 1  1  1  1 ||
|                               |
|              3       8        |
|o2 : Matrix QQ  <-- QQ         |
+-------------------------------+
+-------------------------------+
|i3 : P = hypercube(3,2)        |
|                               |
|o3 = P                         |
|                               |
|o3 : Polyhedron                |
+-------------------------------+
|i4 : vertices P                |
|                               |
|o4 = | -2 2  -2 2  -2 2  -2 2 ||
|     | -2 -2 2  2  -2 -2 2  2 ||
|     | -2 -2 -2 -2 2  2  2  2 ||
|                               |
|              3       8        |
|o4 : Matrix QQ  <-- QQ         |
+-------------------------------+
+-------------------------+
|i5 : P = hypercube(3,0,1)|
|                         |
|o5 = P                   |
|                         |
|o5 : Polyhedron          |
+-------------------------+
|i6 : vertices P          |
|                         |
|o6 = | 0 1 0 1 0 1 0 1 | |
|     | 0 0 1 1 0 0 1 1 | |
|     | 0 0 0 0 1 1 1 1 | |
|                         |
|              3       8  |
|o6 : Matrix QQ  <-- QQ   |
+-------------------------+

Ways to use hypercube:
======================

  * "hypercube(ZZ)"
  * "hypercube(ZZ,QQ)"
  * "hypercube(ZZ,QQ,QQ)"
  * "hypercube(ZZ,QQ,ZZ)"
  * "hypercube(ZZ,ZZ)"
  * "hypercube(ZZ,ZZ,QQ)"
  * "hypercube(ZZ,ZZ,ZZ)"

For the programmer
==================

The object hypercube, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:530:0.

hyperplanes -- computes the defining hyperplanes of a Cone or a Polyhedron
**************************************************************************

  * Usage:
        N = hyperplanes C
        (N,w) = hyperplanes P
  * Inputs:
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * N, a matrix (Macaulay2Doc), with entries over QQ (Macaulay2Doc),
      * w, a matrix (Macaulay2Doc), with entries over QQ (Macaulay2Doc),
        and only one column

Description
===========

hyperplanes returns the defining affine hyperplanes for a polyhedron P. The
output is (N,w), where the source of N has the dimension of the ambient space
of P and w is a one column matrix in the target space of N such that P = {p in
H | N*p = w} where H is the intersection of the defining affine half-spaces.

 For a cone C the output is the matrix N, that is the same matrix as before but
w is omitted since it is 0, so C = {c in H | N*c = 0} and H is the intersection
of the defining linear half-spaces.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.
+-------------------------------------------------------+
|i1 : P = stdSimplex 2                                  |
|                                                       |
|o1 = P                                                 |
|                                                       |
|o1 : Polyhedron                                        |
+-------------------------------------------------------+
|i2 : hyperplanes P                                     |
|                                                       |
|o2 = (| 1 1 1 |, | 1 |)                                |
|                                                       |
|o2 : Sequence                                          |
+-------------------------------------------------------+
|i3 : C = coneFromVData matrix {{1,2,4},{2,3,5},{3,4,6}}|
|                                                       |
|o3 = C                                                 |
|                                                       |
|o3 : Cone                                              |
+-------------------------------------------------------+
|i4 : hyperplanes C                                     |
|                                                       |
|o4 = | -1 2 -1 |                                       |
|                                                       |
|              1       3                                |
|o4 : Matrix ZZ  <-- ZZ                                 |
+-------------------------------------------------------+

Ways to use hyperplanes:
========================

  * "hyperplanes(Cone)"
  * "hyperplanes(Polyhedron)"

For the programmer
==================

The object hyperplanes, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:949:0.

imageFan --  computes the fan of the image
******************************************

  * Usage:
        F = imageFan(M,C)
  * Inputs:
      * M, a matrix (Macaulay2Doc),
      * C, a convex rational cone,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

M must be a matrix from the ambient space of the Cone, C to some
target space. The imageFan is the common refinement of the images of all faces
of C.
+----------------------------------------------------------------+
|i1 : C = coneFromVData matrix {{2,1,-1,-3},{1,1,1,1},{0,1,-1,0}}|
|                                                                |
|o1 = C                                                          |
|                                                                |
|o1 : Cone                                                       |
+----------------------------------------------------------------+
|i2 : M = matrix {{1,0,0},{0,1,0}}                               |
|                                                                |
|o2 = | 1 0 0 |                                                  |
|     | 0 1 0 |                                                  |
|                                                                |
|              2       3                                         |
|o2 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i3 : F = imageFan(M,C)                                          |
|                                                                |
|o3 = F                                                          |
|                                                                |
|o3 : Fan                                                        |
+----------------------------------------------------------------+
|i4 : rays F                                                     |
|                                                                |
|o4 = | -3 -1 1 2 |                                              |
|     | 1  1  1 1 |                                              |
|                                                                |
|              2       4                                         |
|o4 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+

Ways to use imageFan:
=====================

  * "imageFan(Matrix,Cone)"

For the programmer
==================

The object imageFan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2684:0.

incompCones -- returns the pairs of incompatible cones
******************************************************

  * Usage:
        Lpairs = incompCones L
        Lpairs = incompCones(X,F)
        Lpairs = incompCones(F,X)
  * Inputs:
      * L, a list (Macaulay2Doc),
      * F, an instance of the type Fan,
      * X, see Cone, or Fan,
  * Outputs:
      * Lpairs, a list (Macaulay2Doc),

Description
===========

If incompCones is applied to a list of cones and fans, then it returns the
pairs of elements whose intersection is not a face of each. For a cone C and a
fan F in the list this means there is at least one generating cone of F whose
intersection with C is not a face of each. For two fans in the list this means
there is at least one generating cone each such that their intersection is not
a face of each. If applied to a pair consisting of a cone and a fan or two
fans, then it returns the pairs of cones that do not share a common face.
+---------------------------------------------+
|i1 : C1 = coneFromVData matrix{{1,0},{1,1}}; |
+---------------------------------------------+
|i2 : C2 = coneFromVData matrix{{1,0},{0,-1}};|
+---------------------------------------------+
|i3 : C3 = coneFromVData matrix{{-1,0},{0,1}};|
+---------------------------------------------+
|i4 : C4 = coneFromVData matrix{{1,1},{0,1}}; |
+---------------------------------------------+
|i5 : C5 = coneFromVData matrix {{1,2},{2,1}};|
+---------------------------------------------+
|i6 : L = {C1,C2,C3,C4,C5};                   |
+---------------------------------------------+
|i7 : Lpairs = incompCones L                  |
|                                             |
|o7 = {(C1, C5), (C4, C5)}                    |
|                                             |
|o7 : List                                    |
+---------------------------------------------+
|i8 : Lpairs == {(C1,C4),(C1,C5)}             |
|                                             |
|o8 = false                                   |
+---------------------------------------------+

Ways to use incompCones:
========================

  * "incompCones(Cone,Fan)"
  * "incompCones(Fan,Cone)"
  * "incompCones(Fan,Fan)"
  * "incompCones(List)"

For the programmer
==================

The object incompCones, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1659:0.

incompPolyhedra -- returns the pairs of incompatible polyhedra
**************************************************************

  * Usage:
        Lpairs = incompPolyhedra L
        Lpairs = incompPolyhedra(X,PC)
        Lpairs = incompPolyhedra(PC,X)
  * Inputs:
      * L, a list (Macaulay2Doc),
      * PC, an instance of the type PolyhedralComplex,
      * X, see Polyhedron, or PolyhedralComplex,
  * Outputs:
      * Lpairs, a list (Macaulay2Doc),

Description
===========

If incompPolyhedra is applied to a list of polyhedra and polyhedral complexes,
then it returns the pairs of elements whose intersection is not a face of each.
For a Polyhedron P and a PolyhedralComplex PC in the list this means there is
at least one generating Polyhedron of PC whose intersection with P is not a
face of each. For two polyhedral complexes in the list this means there is at
least one generating polyhedron each such that their intersection is not a face
of each. If applied to a pair consisting of a polyhedron and a polyhedral
complex or two polyhedral complexes, then it returns the pairs of polyhedra
that do not share a common face.
+-----------------------------------------------+
|i1 : P1 = convexHull matrix {{1,0,0},{1,1,0}}; |
+-----------------------------------------------+
|i2 : P2 = convexHull matrix {{1,0,0},{0,-1,0}};|
+-----------------------------------------------+
|i3 : P3 = convexHull matrix {{-1,0,0},{0,1,0}};|
+-----------------------------------------------+
|i4 : P4 = convexHull matrix {{1,1,0},{0,1,0}}; |
+-----------------------------------------------+
|i5 : P5 = convexHull matrix {{1,2,0},{2,1,0}}; |
+-----------------------------------------------+
|i6 : L = {P1,P2,P3,P4,P5};                     |
+-----------------------------------------------+
|i7 : Lpairs = incompPolyhedra L                |
|                                               |
|o7 = {(P1, P5), (P4, P5)}                      |
|                                               |
|o7 : List                                      |
+-----------------------------------------------+
|i8 : Lpairs == {(P1,P4),(P1,P5)}               |
|                                               |
|o8 = false                                     |
+-----------------------------------------------+

Ways to use incompPolyhedra:
============================

  * "incompPolyhedra(List)"
  * "incompPolyhedra(PolyhedralComplex,PolyhedralComplex)"
  * "incompPolyhedra(PolyhedralComplex,Polyhedron)"
  * "incompPolyhedra(Polyhedron,PolyhedralComplex)"

For the programmer
==================

The object incompPolyhedra, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1692:0.

inInterior -- checks if a point lies in the relative interior of a Cone/Polyhedron
**********************************************************************************

  * Usage:
        b = inInterior(p,C)
        b = inInterior(p,P)
  * Inputs:
      * p, a matrix (Macaulay2Doc),  over ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), with only one column
        representing a point
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if p lies in the relative interior of the
        Cone/Polyhedron, see false (Macaulay2Doc), otherwise

Description
===========

inInterior checks if the smallest face of the Cone, or the
Polyhedron, containing p is the Cone, or the
Polyhedron, itself. For this the number of rows of p must equal the
ambient dimension of the second argument.
+-----------------------------+
|i1 : P = cyclicPolytope(3,5) |
|                             |
|o1 = P                       |
|                             |
|o1 : Polyhedron              |
+-----------------------------+
|i2 : p = matrix{{2},{4},{8}} |
|                             |
|o2 = | 2 |                   |
|     | 4 |                   |
|     | 8 |                   |
|                             |
|              3       1      |
|o2 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i3 : q = matrix{{2},{6},{20}}|
|                             |
|o3 = | 2  |                  |
|     | 6  |                  |
|     | 20 |                  |
|                             |
|              3       1      |
|o3 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i4 : inInterior(p,P)         |
|                             |
|o4 = false                   |
+-----------------------------+
|i5 : inInterior(q,P)         |
|                             |
|o5 = true                    |
+-----------------------------+

Ways to use inInterior:
=======================

  * "inInterior(Matrix,Cone)"
  * "inInterior(Matrix,Polyhedron)"

For the programmer
==================

The object inInterior, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1721:0.

interiorLatticePoints -- computes the lattice points in the relative interior of a polytope
*******************************************************************************************

  * Usage:
        L = interiorLatticePoints P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * L, a list (Macaulay2Doc), containing the interior lattice
        points as matrices over ZZ (Macaulay2Doc), with only one
        column

Description
===========

latticePoints can only be applied to polytopes, i.e. compact polyhedra. It
returns all lattice points in the relative interior of the polytope.
+-----------------------------------------------------+
|i1 : P = crossPolytope(3,2)                          |
|                                                     |
|o1 = P                                               |
|                                                     |
|o1 : Polyhedron                                      |
+-----------------------------------------------------+
|i2 : interiorLatticePoints P                         |
|                                                     |
|o2 = {| -1 |, | 0  |, | 0  |, 0, | 0 |, | 0 |, | 1 |}|
|      | 0  |  | -1 |  | 0  |     | 0 |  | 1 |  | 0 | |
|      | 0  |  | 0  |  | -1 |     | 1 |  | 0 |  | 0 | |
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : Q = cyclicPolytope(2,4)                         |
|                                                     |
|o3 = Q                                               |
|                                                     |
|o3 : Polyhedron                                      |
+-----------------------------------------------------+
|i4 : interiorLatticePoints Q                         |
|                                                     |
|o4 = {| 1 |, | 2 |}                                  |
|      | 2 |  | 5 |                                   |
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+

Ways to use interiorLatticePoints:
==================================

  * "interiorLatticePoints(Polyhedron)"

For the programmer
==================

The object interiorLatticePoints, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1788:0.

interiorPoint -- computes a point in the relative interior of the Polyhedron
****************************************************************************

  * Usage:
        p = interiorPoint P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * p, a matrix (Macaulay2Doc),  over QQ (Macaulay2Doc),
        with only one column representing a point

Description
===========

interiorPoint takes the vertices of the Polyhedron, and
computes the sum multiplied by 1/n, where n is the number of vertices.
+----------------------------+
|i1 : P = cyclicPolytope(3,5)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : interiorPoint P        |
|                            |
|o2 = | 2  |                 |
|     | 6  |                 |
|     | 20 |                 |
|                            |
|              3       1     |
|o2 : Matrix QQ  <-- QQ      |
+----------------------------+

Ways to use interiorPoint:
==========================

  * "interiorPoint(Polyhedron)"

For the programmer
==================

The object interiorPoint, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1742:0.

interiorVector -- computes a vector in the relative interior of a Cone
**********************************************************************

  * Usage:
        p = interiorVector C
  * Inputs:
      * C, a convex rational cone,
  * Outputs:
      * p, a matrix (Macaulay2Doc),  over QQ (Macaulay2Doc),
        with only one column representing a vector

Description
===========

interiorVector takes the rays of the Cone, computes the sum and
divides by the gcd to get a primitive vector.
+----------------------------+
|i1 : P = cyclicPolytope(3,4)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : C = coneFromVData P    |
|                            |
|o2 = C                      |
|                            |
|o2 : Cone                   |
+----------------------------+
|i3 : interiorVector C       |
|                            |
|o3 = | 3  |                 |
|     | 6  |                 |
|     | 14 |                 |
|                            |
|              3       1     |
|o3 : Matrix ZZ  <-- ZZ      |
+----------------------------+

Ways to use interiorVector:
===========================

  * "interiorVector(Cone)"

For the programmer
==================

The object interiorVector, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1764:0.

intersect -- computes the intersection of cones, and polyhedra
**************************************************************

  * Usage:
        P = intersection L
        C = intersection(C1,C2)
        P = intersection(P1,P2)
  * Inputs:
      * L, a list (Macaulay2Doc), containing any of the inputs
        below
      * C1, a convex rational cone,
      * C2, a convex rational cone,
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,
  * Outputs:
      * P, a convex polyhedron,
      * C, a convex rational cone,

Description
===========

If two polyhedra or two cones are inserted, then the intersection of both
arguments is computed if both arguments lie in the same ambient space. If both
arguments are cones then the output is again a cone. Otherwise intersection
returns a polyhedron.

If intersection is called for a list L, then the list may contain a combination
of the following in any order.
  * Cone
  * Polyhedron
+---------------------------+
|i1 : C = hypercube 2       |
|                           |
|o1 = C                     |
|                           |
|o1 : Polyhedron            |
+---------------------------+
|i2 : S = simplex 2         |
|                           |
|o2 = S                     |
|                           |
|o2 : Polyhedron            |
+---------------------------+
|i3 : CS = intersection(C,S)|
|                           |
|o3 = CS                    |
|                           |
|o3 : Polyhedron            |
+---------------------------+

Ways to use intersect:
======================

  * "intersect(Cone,Cone)"
  * "intersect(Cone,Polyhedron)"
  * "intersect(List)" -- see intersect (Macaulay2Doc), --
    compute an intersection
  * "intersect(Polyhedron,Cone)"
  * "intersect(Polyhedron,Polyhedron)"
  * "intersect(Sequence)" -- see intersect (Macaulay2Doc), --
    compute an intersection
  * "intersect(Ideal)" -- see intersect(Ideal,Ideal) (Macaulay2Doc),
    -- compute an intersection of a
    sequence of ideals or modules
  * intersect(Ideal,Ideal) (Macaulay2Doc),
    -- compute an intersection of a sequence of ideals or modules
  * "intersect(Module)" -- see intersect(Ideal,Ideal) (Macaulay2Doc),
    -- compute an intersection of a
    sequence of ideals or modules
  * "intersect(Module,Module)" -- see intersect(Ideal,Ideal) (Macaulay2Doc),
    -- compute an intersection of a
    sequence of ideals or modules
  * intersect(Matrix) -- Deprecated variant of
    {\tt coneFromHData}
  * intersect(Matrix,Matrix), --
    Deprecated variants of {\tt polyhedronFromHData} and {\tt coneFromHData}
  * "intersect(Matrix,Matrix,Matrix,Matrix)" -- see
    intersect(Matrix,Matrix), -- Deprecated
    variants of {\tt polyhedronFromHData} and {\tt coneFromHData}
  * intersect(RRi) (Macaulay2Doc) -- intersection of
    input intervals
  * "intersect(RRi,RRi)" -- see intersect(RRi) (Macaulay2Doc),
    -- intersection of input intervals
  * intersect(Set,Set) (Macaulay2Doc) -- set
    intersection

For the programmer
==================

The object intersect (Macaulay2Doc), is an associative binary method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:558:0.

intersect(Matrix) -- Deprecated variant of {\tt coneFromHData}
**************************************************************

  * Function: intersect (Macaulay2Doc),

Ways to use this method:
========================

  * intersect(Matrix) -- Deprecated variant of
    {\tt coneFromHData}
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/deprecated_documentation.m2:15:0.

intersect(Matrix,Matrix) -- Deprecated variants of {\tt polyhedronFromHData} and {\tt coneFromHData}
****************************************************************************************************

  * Function: intersect (Macaulay2Doc),

Ways to use this method:
========================

  * intersect(Matrix,Matrix), --
    Deprecated variants of {\tt polyhedronFromHData} and {\tt coneFromHData}
  * "intersect(Matrix,Matrix,Matrix,Matrix)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/deprecated_documentation.m2:23:0.

isCompact -- checks compactness of a Polyhedron
***********************************************

  * Usage:
        b = isCompact P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Polyhedron, is compact,
        see false (Macaulay2Doc), otherwise

Description
===========

isCompact tests whether P is compact, i.e. a polytope, by checking if the rays
and lineality space matrices are 0.
+-----------------------------------------------------------------------------+
|i1 : P = polyhedronFromHData(matrix{{1,1,1},{0,1,0},{-1,-1,-1},{-1,-1,-1},{0 |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|,-1,0},{1,-1,1}},matrix{{2},{1},{2},{2},{1},{2}})                            |
+-----------------------------------------------------------------------------+
|i2 : isCompact P                                                             |
|                                                                             |
|o2 = false                                                                   |
+-----------------------------------------------------------------------------+

Ways to use isCompact:
======================

  * "isCompact(Polyhedron)"

For the programmer
==================

The object isCompact, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1185:0.

isComplete -- checks completeness of a Fan or PolyhedralComplex
***************************************************************

  * Usage:
        b = isComplete X
  * Inputs:
      * X, an instance of the type Fan, or an instance of the type
        PolyhedralComplex,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Fan,/see PolyhedralComplex,
        is complete, see false (Macaulay2Doc),
        otherwise

Description
===========

isComplete just calls an entry in the hash table of the Fan. The check for
completeness is done while generating the fan. Whenever a full dimensional Cone
is added (see fan, or addCone) the set of faces of
codimension 1 that appear only in one full dimensional Cone is updated. The Fan
is then complete if and only if this set is empty and there is at least one
full dimensional Cone.

 For a PolyhedralComplex, the function does the same.
Just note, that a complete polyhedral complex must contain non-compact
polyhedra.
+-----------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,0},{0,1}};  |
+-----------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,-1},{0,-2}};|
+-----------------------------------------------+
|i3 : C3 = coneFromVData matrix {{0,-2},{1,-1}};|
+-----------------------------------------------+
|i4 : F = fan {C1,C2,C3}                        |
|                                               |
|o4 = F                                         |
|                                               |
|o4 : Fan                                       |
+-----------------------------------------------+
|i5 : isComplete F                              |
|                                               |
|o5 = false                                     |
+-----------------------------------------------+

Hence the fan above is not complete, but we can add the missing cone:
+-------------------------------------------------+
|i6 : C4 = coneFromVData matrix {{-1,-2},{-2,-1}};|
+-------------------------------------------------+
|i7 : F = addCone(C4,F)                           |
|                                                 |
|o7 = F                                           |
|                                                 |
|o7 : Fan                                         |
+-------------------------------------------------+
|i8 : isComplete F                                |
|                                                 |
|o8 = true                                        |
+-------------------------------------------------+

Ways to use isComplete:
=======================

  * "isComplete(Fan)"
  * "isComplete(PolyhedralComplex)"

For the programmer
==================

The object isComplete, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1223:0.

isEmpty -- checks if a Polyhedron is empty
******************************************

  * Usage:
        b = isEmpty P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Polyhedron, is empty,
        see false (Macaulay2Doc), otherwise

Description
===========

The polyhedron is empty if the dimension is -1.
+-----------------------------------------------------------------------------+
|i1 : P = polyhedronFromHData(matrix{{1,0},{0,1},{-1,-1}},matrix{{-1},{1},{-1 |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|}})                                                                          |
+-----------------------------------------------------------------------------+
|i2 : isEmpty P                                                               |
|                                                                             |
|o2 = true                                                                    |
+-----------------------------------------------------------------------------+

Ways to use isEmpty:
====================

  * "isEmpty(Polyhedron)"
  * "isEmpty(Thing)" -- see isEmpty (Macaulay2Doc), -- whether an
    object is empty
  * isEmpty(RRi) (Macaulay2Doc) -- empty test for an
    interval

For the programmer
==================

The object isEmpty (Macaulay2Doc), is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1243:0.

isFace -- tests if the first argument is a face of the second
*************************************************************

  * Usage:
        b = isFace(X,Y)
  * Inputs:
      * X, a convex rational cone,  or Polyhedron,
      * Y, an element of the same class as X
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if X is a face of Y, false otherwise

Description
===========

Both arguments must lie in the same ambient space. Then isFace computes all
faces of Y with the dimension of X and checks if one of them is X.
+-----------------------------------------------------+
|i1 : P = hypercube 3                                 |
|                                                     |
|o1 = P                                               |
|                                                     |
|o1 : Polyhedron                                      |
+-----------------------------------------------------+
|i2 : Q = convexHull matrix{{1,1,1},{1,1,-1},{1,-1,1}}|
|                                                     |
|o2 = Q                                               |
|                                                     |
|o2 : Polyhedron                                      |
+-----------------------------------------------------+
|i3 : isFace(Q,P)                                     |
|                                                     |
|o3 = false                                           |
+-----------------------------------------------------+

Thus, Q is not a face of P, but we can extend it to a face.
+-------------------------------+
|i4 : v = matrix{{1},{-1},{-1}};|
|                               |
|              3       1        |
|o4 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i5 : Q = convexHull{Q,v}       |
|                               |
|o5 = Q                         |
|                               |
|o5 : Polyhedron                |
+-------------------------------+
|i6 : isFace(Q,P)               |
|                               |
|o6 = true                      |
+-------------------------------+

Ways to use isFace:
===================

  * "isFace(Cone,Cone)"
  * "isFace(Polyhedron,Polyhedron)"

For the programmer
==================

The object isFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1274:0.

isFullDimensional -- Determine whether a polyhedral object is full-dimensional
******************************************************************************

  * Usage:
        b = isFullDimensional PO
  * Inputs:
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc),

Description
===========

Checks whether the dimension of the polyhedral object is equal to its ambient
dimension.

+------------------------+
|i1 : C = hypercube 2    |
|                        |
|o1 = C                  |
|                        |
|o1 : Polyhedron         |
+------------------------+
|i2 : dim C              |
|                        |
|o2 = 2                  |
+------------------------+
|i3 : ambDim C           |
|                        |
|o3 = 2                  |
+------------------------+
|i4 : isFullDimensional C|
|                        |
|o4 = true               |
+------------------------+
+------------------------------+
|i5 : F = normalFan hypercube 2|
|                              |
|o5 = F                        |
|                              |
|o5 : Fan                      |
+------------------------------+
|i6 : dim F                    |
|                              |
|o6 = 2                        |
+------------------------------+
|i7 : ambDim F                 |
|                              |
|o7 = 2                        |
+------------------------------+
|i8 : isFullDimensional F      |
|                              |
|o8 = true                     |
+------------------------------+
+-------------------------+
|i9 : S = stdSimplex 2    |
|                         |
|o9 = S                   |
|                         |
|o9 : Polyhedron          |
+-------------------------+
|i10 : vertices S         |
|                         |
|o10 = | 1 0 0 |          |
|      | 0 1 0 |          |
|      | 0 0 1 |          |
|                         |
|               3       3 |
|o10 : Matrix QQ  <-- QQ  |
+-------------------------+
|i11 : dim S              |
|                         |
|o11 = 2                  |
+-------------------------+
|i12 : ambDim S           |
|                         |
|o12 = 3                  |
+-------------------------+
|i13 : isFullDimensional S|
|                         |
|o13 = false              |
+-------------------------+

Ways to use isFullDimensional:
==============================

  * "isFullDimensional(PolyhedralObject)"

For the programmer
==================

The object isFullDimensional, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:633:0.

isLatticePolytope -- checks if a polyhedron is a lattice polytope
*****************************************************************

  * Usage:
        b = isLatticePolytope P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if P is a
        lattice polytope

Description
===========

isLatticePolytope can only be applied to polytopes, i.e. compact polyhedra. It
simply checks if it is compact and all vertices are lattice points.
+-----------------------------------------------------------------------------+
|i1 : P = polyhedronFromHData(matrix{{2,0},{0,-3},{-3,0},{0,2}},matrix{{1},{1 |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|},{1},{1}})                                                                  |
+-----------------------------------------------------------------------------+
|i2 : isLatticePolytope P                                                     |
|                                                                             |
|o2 = false                                                                   |
+-----------------------------------------------------------------------------+
|i3 : P = polyhedronFromHData(matrix{{2,0},{0,-3},{-3,0},{0,2}},matrix{{4},{6 |
|                                                                             |
|o3 = P                                                                       |
|                                                                             |
|o3 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|},{3},{6}})                                                                  |
+-----------------------------------------------------------------------------+
|i4 : isLatticePolytope P                                                     |
|                                                                             |
|o4 = true                                                                    |
+-----------------------------------------------------------------------------+

Ways to use isLatticePolytope:
==============================

  * "isLatticePolytope(Polyhedron)"

For the programmer
==================

The object isLatticePolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1297:0.

isNormal(Polyhedron) -- checks if a polytope is normal in the ambient lattice
*****************************************************************************

  * Function: isNormal (Macaulay2Doc),
  * Usage:
        b = isNormal P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if P is normal
        in the ambient lattice

Description
===========

isNormal can only be applied to polytopes, i.e. compact polyhedra. It embeds
the polytope on height 1 in a space of dimension plus 1 and takes the Cone over
this polytope. Then it checks if all elements of the Hilbert basis lie in
height 1.
+----------------------------------------------------------------------+
|i1 : P = convexHull transpose matrix {{0,0,0},{1,0,0},{0,1,0},{1,1,3}}|
|                                                                      |
|o1 = P                                                                |
|                                                                      |
|o1 : Polyhedron                                                       |
+----------------------------------------------------------------------+
|i2 : isNormal P                                                       |
|                                                                      |
|o2 = false                                                            |
+----------------------------------------------------------------------+

Ways to use this method:
========================

  * isNormal(Polyhedron) -- checks if a
    polytope is normal in the ambient lattice
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1319:0.

isPointed -- checks if a Cone or Fan is pointed
***********************************************

  * Usage:
        b = isPointed C
        b = isPointed F
  * Inputs:
      * C, a convex rational cone,
      * F, an instance of the type Fan,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Cone, or the Fan, is
        pointed, false otherwise

Description
===========

Tests if a Cone is pointed, i.e. the lineality space is 0. A Fan is pointed if
one of its Cones is pointed. This is equivalent to all Cones being pointed.
+----------------------------------------------------------+
|i1 : C = coneFromHData(matrix{{1,1,-1},{-1,-1,-1}})       |
|                                                          |
|o1 = C                                                    |
|                                                          |
|o1 : Cone                                                 |
+----------------------------------------------------------+
|i2 : isPointed C                                          |
|                                                          |
|o2 = false                                                |
+----------------------------------------------------------+
|i3 : C = intersection{C, coneFromHData(matrix{{1,-1,-1}})}|
|                                                          |
|o3 = C                                                    |
|                                                          |
|o3 : Cone                                                 |
+----------------------------------------------------------+
|i4 : isPointed C                                          |
|                                                          |
|o4 = true                                                 |
+----------------------------------------------------------+

Ways to use isPointed:
======================

  * "isPointed(Cone)"
  * "isPointed(Fan)"

For the programmer
==================

The object isPointed, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1343:0.

isPolytopal -- checks if a Fan is polytopal
*******************************************

  * Usage:
        b = isPolytopal F
  * Inputs:
      * F, an instance of the type Fan,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Fan, is polytopal, see false (Macaulay2Doc),
        otherwise

Description
===========

If F is projective, then there exists a polyhedron P such that F is the
normalFan of P. This means every codimension 1 cone of the Fan corresponds
exactly to an edge of the polytope. So consider QQ (Macaulay2Doc), to
the number of all edges. This can be considered as the space of all edge
lengths. If we take arbitrary lengths now for every edge we do not get a
polytope. But every codimension 2 cone of the fan corresponds to a 2
dimensional face of the polytope and if the edges belonging to this face add up
to 0 zero, they form in fact a 2 dimensional face. This gives linear equations
on the space of edge lengths and if we intersect these equations with the
positive orthant in the space of edge lengths we get a Cone. Thus, there exists
such a polytope if and only if there is a vector in this cone with strictly
positive entries, since every edge has to appear in the polytope.

IF F is polytopal, the function polytope, returns a polytope of
which F is the normalFan.

Note that the function first checks if the fan is complete.
+-------------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,0},{0,1}};    |
+-------------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,-1},{0,-2}};  |
+-------------------------------------------------+
|i3 : C3 = coneFromVData matrix {{0,-2},{1,-1}};  |
+-------------------------------------------------+
|i4 : C4 = coneFromVData matrix {{-1,-2},{-2,-1}};|
+-------------------------------------------------+
|i5 : F = fan{C1,C2,C3,C4}                        |
|                                                 |
|o5 = F                                           |
|                                                 |
|o5 : Fan                                         |
+-------------------------------------------------+
|i6 : isPolytopal F                               |
|                                                 |
|o6 = true                                        |
+-------------------------------------------------+

Ways to use isPolytopal:
========================

  * "isPolytopal(Fan)"

For the programmer
==================

The object isPolytopal, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1380:0.

isPure -- checks if a Fan or PolyhedralComplex is of pure dimension
*******************************************************************

  * Usage:
        b = isPure X
  * Inputs:
      * X, an instance of the type Fan, or an instance of the type
        PolyhedralComplex,
  * Outputs:
      * b, see true (Macaulay2Doc), if the Fan,/see
        PolyhedralComplex, is of pure dimension, see
        false (Macaulay2Doc), otherwise

Description
===========

isPure tests if the Fan,/see PolyhedralComplex,
is pure by checking if the first and the last entry in the list of generating
Cones/Polyhedra are of the same dimension.

Let us construct a fan consisting of the positive orthant and the ray v that is
the negative sum of the canonical basis, which is obviously not pure:
+-------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,0,0},{0,1,0},{0,0,1}}|
|                                                       |
|o1 = C                                                 |
|                                                       |
|o1 : Cone                                              |
+-------------------------------------------------------+
|i2 : v = coneFromVData matrix {{-1},{-1},{-1}}         |
|                                                       |
|o2 = v                                                 |
|                                                       |
|o2 : Cone                                              |
+-------------------------------------------------------+
|i3 : F = fan {C,v}                                     |
|                                                       |
|o3 = F                                                 |
|                                                       |
|o3 : Fan                                               |
+-------------------------------------------------------+
|i4 : isPure F                                          |
|                                                       |
|o4 = false                                             |
+-------------------------------------------------------+

But we can make a pure fan if we choose any two dimensional face of the
positive orthant and take the cone generated by this face and v and add it to
the cone:
+-------------------------------------------------+
|i5 : C1 = coneFromVData (rays C)_((faces(1,C))#0)|
|                                                 |
|o5 = C1                                          |
|                                                 |
|o5 : Cone                                        |
+-------------------------------------------------+
|i6 : C1 = coneFromVData(C1, v)                   |
|                                                 |
|o6 = C1                                          |
|                                                 |
|o6 : Cone                                        |
+-------------------------------------------------+
|i7 : F = addCone(C1,F)                           |
|                                                 |
|o7 = F                                           |
|                                                 |
|o7 : Fan                                         |
+-------------------------------------------------+
|i8 : isPure F                                    |
|                                                 |
|o8 = true                                        |
+-------------------------------------------------+

Ways to use isPure:
===================

  * "isPure(Fan)"
  * "isPure(PolyhedralComplex)"

For the programmer
==================

The object isPure, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1416:0.

isReflexive --  checks if a Polytope is reflexive
*************************************************

  * Usage:
        b = isReflexive P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * b, see true (Macaulay2Doc), if the Polyhedron,
        is reflexive, see false (Macaulay2Doc), otherwise

Description
===========

A lattice polytope P in the QQ (Macaulay2Doc), space of a lattice $M$
is reflexive if its polar polytope is also a lattice polytope. The function
checks if P is compact, a lattice polytope and if the dual is a lattice
polytope.
+----------------------------------------------+
|i1 : P = convexHull matrix {{1,0,-1},{0,1,-1}}|
|                                              |
|o1 = P                                        |
|                                              |
|o1 : Polyhedron                               |
+----------------------------------------------+
|i2 : isReflexive P                            |
|                                              |
|o2 = true                                     |
+----------------------------------------------+

See also
========

  * isCompact -- checks compactness of a Polyhedron
  * isLatticePolytope -- checks if a polyhedron is a
    lattice polytope
  * polar --  computes the polar of a polyhedron

Ways to use isReflexive:
========================

  * "isReflexive(Polyhedron)"

For the programmer
==================

The object isReflexive, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1442:0.

isSimplicial --  checks if a polyhedral object is simplicial
************************************************************

  * Usage:
        b = isSimplicial X
  * Inputs:
      * X, an instance of the type PolyhedralObject,
  * Outputs:
      * b, see true (Macaulay2Doc), if the PolyhedralObject,
        is simplicial, see false (Macaulay2Doc),
        otherwise

Description
===========

A Polyhedron, of dimension $d$ is simplicial if it is compact
and every facet is (isomorphic to) a simplex.
+----------------------------------------------------------------+
|i1 : P = convexHull matrix {{3,0,0,0,1},{0,3,0,0,1},{0,0,3,0,1}}|
|                                                                |
|o1 = P                                                          |
|                                                                |
|o1 : Polyhedron                                                 |
+----------------------------------------------------------------+
|i2 : isSimplicial P                                             |
|                                                                |
|o2 = true                                                       |
+----------------------------------------------------------------+
|i3 : P = hypercube 2                                            |
|                                                                |
|o3 = P                                                          |
|                                                                |
|o3 : Polyhedron                                                 |
+----------------------------------------------------------------+
|i4 : isSimplicial P                                             |
|                                                                |
|o4 = true                                                       |
+----------------------------------------------------------------+

A pointed Cone, of dimension $d$ is simplicial if it has $d$ rays.
+-----------------------------------------------------------------+
|i5 : C = coneFromVData matrix {{1,0,0,1},{0,1,0,1},{0,0,1,1}}    |
|                                                                 |
|o5 = C                                                           |
|                                                                 |
|o5 : Cone                                                        |
+-----------------------------------------------------------------+
|i6 : isSimplicial C                                              |
|                                                                 |
|o6 = true                                                        |
+-----------------------------------------------------------------+
|i7 : C = coneFromVData matrix {{1,1,-1,-1},{1,-1,1,-1},{1,1,1,1}}|
|                                                                 |
|o7 = C                                                           |
|                                                                 |
|o7 : Cone                                                        |
+-----------------------------------------------------------------+
|i8 : isSimplicial C                                              |
|                                                                 |
|o8 = false                                                       |
+-----------------------------------------------------------------+

A Fan,/see PolyhedralComplex, is simplicial if
every Cone,/see Polyhedron, of it is simplicial.
+--------------------------------------------------------+
|i9 : F = normalFan hypercube 3                          |
|                                                        |
|o9 = F                                                  |
|                                                        |
|o9 : Fan                                                |
+--------------------------------------------------------+
|i10 : isSimplicial F                                    |
|                                                        |
|o10 = true                                              |
+--------------------------------------------------------+
|i11 : PC = skeleton(2,polyhedralComplex crossPolytope 3)|
|                                                        |
|o11 = PC                                                |
|                                                        |
|o11 : PolyhedralComplex                                 |
+--------------------------------------------------------+
|i12 : isSimplicial PC                                   |
|                                                        |
|o12 = true                                              |
+--------------------------------------------------------+

See also
========

  * isCompact -- checks compactness of a Polyhedron
  * isPointed -- checks if a Cone or Fan is pointed
  * dim (Macaulay2Doc) -- compute the Krull dimension
  * vertices -- displays the vertices of a Polyhedron or a
    PolyhedralComplex
  * rays (Macaulay2Doc) -- 1-dimensional cones of a fan or
    polyhedral object

Ways to use isSimplicial:
=========================

  * "isSimplicial(PolyhedralObject)"

For the programmer
==================

The object isSimplicial, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1490:0.

isSmooth(Cone) -- checks if a Cone or Fan is smooth
***************************************************

  * Function: isSmooth (Macaulay2Doc),
  * Usage:
        b = isSmooth C
        b = isSmooth F
  * Inputs:
      * C, a convex rational cone,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Cone,/see Fan, is smooth,
        see false (Macaulay2Doc), otherwise

Description
===========

isSmooth checks for a Cone, if the rays are a subset of a basis of
the lattice. For a Fan, it checks smoothness for every Cone.
+-------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,2,3},{3,1,2},{2,3,1}}|
|                                                       |
|o1 = C                                                 |
|                                                       |
|o1 : Cone                                              |
+-------------------------------------------------------+
|i2 : isSmooth C                                        |
|                                                       |
|o2 = false                                             |
+-------------------------------------------------------+
|i3 : F = hirzebruch 3                                  |
|                                                       |
|o3 = F                                                 |
|                                                       |
|o3 : Fan                                               |
+-------------------------------------------------------+
|i4 : isSmooth F                                        |
|                                                       |
|o4 = true                                              |
+-------------------------------------------------------+

Ways to use this method:
========================

  * isSmooth(Cone) -- checks if a Cone or Fan is
    smooth
  * "isSmooth(Fan)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1513:0.

isVeryAmple(Polyhedron) -- checks if the Polyhedron is very ample
*****************************************************************

  * Function: isVeryAmple (Macaulay2Doc),
  * Usage:
        b = isVeryAmple P
  * Inputs:
      * P, a convex polyhedron, , which must be compact
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true (Macaulay2Doc),
        if the Polyhedron, is very ample,
        see false (Macaulay2Doc), otherwise

Description
===========

A lattice polytope P in the QQ (Macaulay2Doc), space of a lattice $M$
is very ample if for every vertex $v\in P$ the semigroup $\mathbb{N}(P\cap M -
v)$ generated by $P\cap M - v = \{v'-v|v'\in P\cap M\}$ is saturated in $M$.
For example, normal lattice polytopes are very ample.

Note that therefore P must be compact and a lattice polytope.
+-----------------------------------------------------------------------------+
|i1 : P = convexHull matrix                                                   |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|{{0,1,0,0,1,0,1,2,0,0},{0,0,1,0,1,0,2,2,0,-1},{0,0,0,1,2,0,1,2,0,-1},{0,0,0,0|
|-----------------------------------------------------------------------------|
|,-1,1,0,-1,0,1},{0,0,0,0,0,0,-1,-1,1,1}}                                     |
+-----------------------------------------------------------------------------+
|i2 : isVeryAmple P                                                           |
|                                                                             |
|o2 = true                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * isVeryAmple(Polyhedron) -- checks if
    the Polyhedron is very ample
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1537:0.

isWellDefined(Cone) -- Checks whether a polyhedral object is well-defined.
**************************************************************************

  * Function: isWellDefined (Macaulay2Doc),
  * Usage:
        b = isWellDefined PO
  * Inputs:
      * PO, a convex rational cone, or an instance of the type
        Fan, or a convex polyhedron, or an
        instance of the type PolyhedralComplex,
  * Outputs:
      * b, a Boolean value (Macaulay2Doc),

Description
===========

This method checks whether all description given and computed for a polyhedral
object yield the same.

Furthermore, for a fan or polyhedral complex, it will check whether the
intersection of two subobjects always yields a face.

This method can be very expensive computationally.

+----------------------------------------+
|i1 : isWellDefined normalFan hypercube 3|
|                                        |
|o1 = true                               |
+----------------------------------------+

Ways to use this method:
========================

  * isWellDefined(Cone) -- Checks whether a
    polyhedral object is well-defined.
  * "isWellDefined(Fan)"
  * "isWellDefined(PolyhedralComplex)"
  * "isWellDefined(PolyhedralObject)"
  * "isWellDefined(Polyhedron)"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:218:0.

latticePoints -- computes the lattice points of a polytope
**********************************************************

  * Usage:
        L = latticePoints P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * L, a list (Macaulay2Doc), containing the lattice points as
        matrices over ZZ (Macaulay2Doc), with only one column

Description
===========

latticePoints can only be applied to polytopes, i.e. compact polyhedra. It
embeds the polytope on height 1 in a space of dimension plus 1 and takes the
Cone over this polytope. Then it projects the elements of height 1 of the
Hilbert basis back again.
+---------------------------------------------------------+
|i1 : P = crossPolytope 3                                 |
|                                                         |
|o1 = P                                                   |
|                                                         |
|o1 : Polyhedron                                          |
+---------------------------------------------------------+
|i2 : latticePoints P                                     |
|                                                         |
|o2 = {| -1 |, | 0  |, | 0  |, 0, | 0 |, | 0 |, | 1 |}    |
|      | 0  |  | -1 |  | 0  |     | 0 |  | 1 |  | 0 |     |
|      | 0  |  | 0  |  | -1 |     | 1 |  | 0 |  | 0 |     |
|                                                         |
|o2 : List                                                |
+---------------------------------------------------------+
|i3 : Q = cyclicPolytope(2,4)                             |
|                                                         |
|o3 = Q                                                   |
|                                                         |
|o3 : Polyhedron                                          |
+---------------------------------------------------------+
|i4 : latticePoints Q                                     |
|                                                         |
|o4 = {0, | 1 |, | 1 |, | 1 |, | 2 |, | 2 |, | 2 |, | 3 |}|
|         | 1 |  | 2 |  | 3 |  | 4 |  | 5 |  | 6 |  | 9 | |
|                                                         |
|o4 : List                                                |
+---------------------------------------------------------+

Ways to use latticePoints:
==========================

  * "latticePoints(Polyhedron)"

For the programmer
==================

The object latticePoints, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1813:0.

latticeVolume -- Returning the lattice volume of a polyhedron.
**************************************************************

  * Usage:
        v = latticeVolume P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * v, a rational number (Macaulay2Doc),

Description
===========

The lattice volume describes how many unit simplices fit into the polyhedron.
It is computed via a triangulation of the polyhedron and then summing over the
volumes of the simplices.

+------------------------------+
|i1 : latticeVolume hypercube 3|
|                              |
|o1 = 48                       |
|                              |
|o1 : QQ                       |
+------------------------------+

Ways to use latticeVolume:
==========================

  * "latticeVolume(Polyhedron)"

For the programmer
==================

The object latticeVolume, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:127:0.

linealitySpace -- computes a basis of the lineality space
*********************************************************

  * Usage:
        LS = linealitySpace C
        LS = linealitySpace F
        LS = linealitySpace P
  * Inputs:
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * LS, a matrix (Macaulay2Doc),

Description
===========

linealitySpace returns a basis of the lineality space of the input as the
columns of the matrix LS. The lineality space of a Fan is the lineality space
of any Cone of the Fan, since they all have the same lineality space.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.
+-------------------------------------------------------------------------+
|i1 : M = matrix {{1,1,1},{0,1,0},{-1,1,-1},{-1,-1,-1},{0,-1,0},{1,-1,1}};|
|                                                                         |
|              6       3                                                  |
|o1 : Matrix ZZ  <-- ZZ                                                   |
+-------------------------------------------------------------------------+
|i2 : v = matrix {{2},{1},{2},{2},{1},{2}};                               |
|                                                                         |
|              6       1                                                  |
|o2 : Matrix ZZ  <-- ZZ                                                   |
+-------------------------------------------------------------------------+
|i3 : P = polyhedronFromHData(M,v)                                        |
|                                                                         |
|o3 = P                                                                   |
|                                                                         |
|o3 : Polyhedron                                                          |
+-------------------------------------------------------------------------+
|i4 : linealitySpace P                                                    |
|                                                                         |
|o4 = | -1 |                                                              |
|     | 0  |                                                              |
|     | 1  |                                                              |
|                                                                         |
|              3       1                                                  |
|o4 : Matrix QQ  <-- QQ                                                   |
+-------------------------------------------------------------------------+
|i5 : C = dualCone coneFromHData M                                        |
|                                                                         |
|o5 = C                                                                   |
|                                                                         |
|o5 : Cone                                                                |
+-------------------------------------------------------------------------+
|i6 : linealitySpace C                                                    |
|                                                                         |
|o6 = | 0 1 |                                                             |
|     | 1 0 |                                                             |
|     | 0 1 |                                                             |
|                                                                         |
|              3       2                                                  |
|o6 : Matrix ZZ  <-- ZZ                                                   |
+-------------------------------------------------------------------------+

Ways to use linealitySpace:
===========================

  * "linealitySpace(PolyhedralObject)"

For the programmer
==================

The object linealitySpace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:979:0.

linearTransform
***************

Ways to use linearTransform:
============================

  * linearTransform(Fan,Matrix) (missing documentation)

For the programmer
==================

The object linearTransform (missing documentation) is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in currentString:1:387.

linSpace -- Deprecated version of @TO "linealitySpace"@
*******************************************************

Ways to use linSpace:
=====================

  * "linSpace(Cone)"
  * "linSpace(Fan)"
  * "linSpace(Polyhedron)"

For the programmer
==================

The object linSpace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:105:0.

maxCones -- displays the generating Cones of a Fan
**************************************************

  * Usage:
        L = maxCones F
  * Inputs:
      * F, an instance of the type Fan,
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

maxCones displays the List (Macaulay2Doc), of generating cones of
the Fan, i.e. all Cones that are not a face of one of the other
cones. These are all of the same dimension if and only if the Fan is pure (see:
isPure).
+-----------------------------------------------------------------------------+
|i1 : F = normalFan crossPolytope 3                                           |
|                                                                             |
|o1 = F                                                                       |
|                                                                             |
|o1 : Fan                                                                     |
+-----------------------------------------------------------------------------+
|i2 : L = maxCones F                                                          |
|                                                                             |
|o2 = {{1, 3, 5, 7}, {0, 2, 4, 6}, {2, 3, 6, 7}, {0, 1, 4, 5}, {4, 5, 6, 7},  |
|     ------------------------------------------------------------------------|
|     {0, 1, 2, 3}}                                                           |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : raysF = rays F                                                          |
|                                                                             |
|o3 = | -1 1  -1 1  -1 1  -1 1 |                                              |
|     | -1 -1 1  1  -1 -1 1  1 |                                              |
|     | -1 -1 -1 -1 1  1  1  1 |                                              |
|                                                                             |
|              3       8                                                      |
|o3 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i4 : apply(L, mc -> raysF_mc)                                                |
|                                                                             |
|o4 = {| 1  1  1  1 |, | -1 -1 -1 -1 |, | -1 1  -1 1 |, | -1 1  -1 1  |, | -1 |
|      | -1 1  -1 1 |  | -1 1  -1 1  |  | 1  1  1  1 |  | -1 -1 -1 -1 |  | -1 |
|      | -1 -1 1  1 |  | -1 -1 1  1  |  | -1 -1 1  1 |  | -1 -1 1  1  |  | 1  |
|     ------------------------------------------------------------------------|
|     1  -1 1 |, | -1 1  -1 1  |}                                             |
|     -1 1  1 |  | -1 -1 1  1  |                                              |
|     1  1  1 |  | -1 -1 -1 -1 |                                              |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use maxCones:
=====================

  * "maxCones(Fan)"

For the programmer
==================

The object maxCones, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:843:0.

maxFace -- computes the face of a Polyhedron or Cone where a weight attains its maximum
***************************************************************************************

  * Usage:
        F = maxFace(w,P)
        F = maxFace(w,C)
  * Inputs:
      * w, a matrix (Macaulay2Doc),  over ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), with only one column
        representing a weight vector
      * P, a convex polyhedron,
      * C, a convex rational cone,
  * Outputs:
      * F, Depending on the input, a Cone or a Polyhedron, the face where w
        attains its maximum

Description
===========

maxFace computes the face of the given Polyhedron P or Cone C where w attains
its maximum.
+------------------------------+
|i1 : P = crossPolytope 3      |
|                              |
|o1 = P                        |
|                              |
|o1 : Polyhedron               |
+------------------------------+
|i2 : w = matrix {{1},{-1},{0}}|
|                              |
|o2 = | 1  |                   |
|     | -1 |                   |
|     | 0  |                   |
|                              |
|              3       1       |
|o2 : Matrix ZZ  <-- ZZ        |
+------------------------------+
|i3 : F = maxFace(w,P)         |
|                              |
|o3 = F                        |
|                              |
|o3 : Polyhedron               |
+------------------------------+
|i4 : vertices F               |
|                              |
|o4 = | 1 0  |                 |
|     | 0 -1 |                 |
|     | 0 0  |                 |
|                              |
|              3       2       |
|o4 : Matrix QQ  <-- QQ        |
+------------------------------+

Ways to use maxFace:
====================

  * "maxFace(Matrix,Cone)"
  * "maxFace(Matrix,Polyhedron)"

For the programmer
==================

The object maxFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1839:0.

maxPolyhedra -- displays the generating Polyhedra of a PolyhedralComplex
************************************************************************

  * Usage:
        L = maxPolyhedra PC
  * Inputs:
      * PC, an instance of the type PolyhedralComplex,
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

maxPolyhedra displays the List (Macaulay2Doc), of generating
polyhedra of the PolyhedralComplex, i.e. all
Polyhedra that are not a face of one of the other Polyhedra. These are all of
the same dimension if and only if the PolyhedralComplex is pure (see:
isPure).
+---------------------------------------------------+
|i1 : PC = skeleton(1,polyhedralComplex hypercube 2)|
|                                                   |
|o1 = PC                                            |
|                                                   |
|o1 : PolyhedralComplex                             |
+---------------------------------------------------+
|i2 : L = maxPolyhedra PC                           |
|                                                   |
|o2 = {({0}, {}), ({1}, {}), ({2}, {}), ({3}, {})}  |
|                                                   |
|o2 : List                                          |
+---------------------------------------------------+
|i3 : vertPC = vertices PC                          |
|                                                   |
|o3 = | -1 1  -1 1 |                                |
|     | -1 -1 1  1 |                                |
|                                                   |
|              2       4                            |
|o3 : Matrix QQ  <-- QQ                             |
+---------------------------------------------------+
|i4 : apply(L, mp -> vertPC_(mp#0))                 |
|                                                   |
|o4 = {| -1 |, | 1  |, | -1 |, | 1 |}               |
|      | -1 |  | -1 |  | 1  |  | 1 |                |
|                                                   |
|o4 : List                                          |
+---------------------------------------------------+

Ways to use maxPolyhedra:
=========================

  * "maxPolyhedra(PolyhedralComplex)"

For the programmer
==================

The object maxPolyhedra, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:868:0.

minFace -- computes the face of a Polyhedron or Cone where a weight attains its minimum
***************************************************************************************

  * Usage:
        F = minFace(w,P)
        F = minFace(w,C)
  * Inputs:
      * w, a matrix (Macaulay2Doc),  over ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), with only one column
        representing a weight vector
      * P, a convex polyhedron,
      * C, a convex rational cone,
  * Outputs:
      * F, Depending on the input, a Cone or a Polyhedron, the face where w
        attains its minimum

Description
===========

minFace computes the face of the given Polyhedron P or Cone C where w attains
its minimum.
+-----------------------------+
|i1 : P = hypercube 3         |
|                             |
|o1 = P                       |
|                             |
|o1 : Polyhedron              |
+-----------------------------+
|i2 : w = matrix {{1},{2},{0}}|
|                             |
|o2 = | 1 |                   |
|     | 2 |                   |
|     | 0 |                   |
|                             |
|              3       1      |
|o2 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i3 : F = minFace(w,P)        |
|                             |
|o3 = F                       |
|                             |
|o3 : Polyhedron              |
+-----------------------------+
|i4 : vertices F              |
|                             |
|o4 = | -1 -1 |               |
|     | -1 -1 |               |
|     | -1 1  |               |
|                             |
|              3       2      |
|o4 : Matrix QQ  <-- QQ       |
+-----------------------------+

Ways to use minFace:
====================

  * "minFace(Matrix,Cone)"
  * "minFace(Matrix,Polyhedron)"

For the programmer
==================

The object minFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1866:0.

minimalNonFaces
***************

Ways to use minimalNonFaces:
============================

  * minimalNonFaces(Fan) -- Giving the minimal
    non-faces of a fan..

For the programmer
==================

The object minimalNonFaces (missing documentation) is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in currentString:1:387.

minimalNonFaces(Fan) -- Giving the minimal non-faces of a fan..
***************************************************************

  * Function: minimalNonFaces (missing documentation)
  * Usage:
        S = minimalNonFaces Phi
  * Inputs:
      * Phi, an instance of the type Fan,
  * Outputs:
      * S, a list (Macaulay2Doc), List of minimal non-faces of Phi

Description
===========

Returns a List with the indices of the minimal non-faces of a fan.

+----------------------------------------------+
|i1 : S = minimalNonFaces normalFan hypercube 2|
|                                              |
|o1 = {{0, 1}, {2, 3}}                         |
|                                              |
|o1 : List                                     |
+----------------------------------------------+

Ways to use this method:
========================

  * minimalNonFaces(Fan) -- Giving the minimal
    non-faces of a fan..
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:53:0.

minkowskiSum --  computes the Minkowski sum of two convex objects
*****************************************************************

  * Usage:
        Q = minkowskiSum(X,Y)
  * Inputs:
      * X, see Cone, or Polyhedron,
      * Y, see Cone, or Polyhedron,
  * Outputs:
      * Q, see Cone, or Polyhedron,

Description
===========

The Minkowski sum of X and Y is the polyhedron X + Y = {x + y | x in X, y in
Y}. If X and Y are both cones, then their Minkowski sum is their positive hull,
which is a cone, so the output is a Cone. Otherwise the output is
a Polyhedron. X and Y have to lie in the same ambient space.
+------------------------------------------------+
|i1 : P1 = convexHull matrix {{0,1,-1},{0,-1,-1}}|
|                                                |
|o1 = P1                                         |
|                                                |
|o1 : Polyhedron                                 |
+------------------------------------------------+
|i2 : P2 = convexHull matrix {{0,1,-1},{0,1,1}}  |
|                                                |
|o2 = P2                                         |
|                                                |
|o2 : Polyhedron                                 |
+------------------------------------------------+
|i3 : Q = minkowskiSum(P1,P2)                    |
|                                                |
|o3 = Q                                          |
|                                                |
|o3 : Polyhedron                                 |
+------------------------------------------------+
|i4 : vertices Q                                 |
|                                                |
|o4 = | -2 2 -1 1  -1 1 |                        |
|     | 0  0 -1 -1 1  1 |                        |
|                                                |
|              2       6                         |
|o4 : Matrix QQ  <-- QQ                          |
+------------------------------------------------+

See also Cone + Cone, Cone + Polyhedron,
see Polyhedron + Cone, and Polyhedron + Cone.

Ways to use minkowskiSum:
=========================

  * "minkowskiSum(Cone,Cone)"
  * "minkowskiSum(Cone,Polyhedron)"
  * "minkowskiSum(Polyhedron,Cone)"
  * "minkowskiSum(Polyhedron,Polyhedron)"

For the programmer
==================

The object minkowskiSum, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2715:0.

minkSummandCone -- computes the Cone of all Minkowski summands and the minimal decompositions
*********************************************************************************************

  * Usage:
        (C,L,M) = minkSummandCone P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * C, a convex rational cone,
      * L, a list (Macaulay2Doc),  containing Polyhedra
      * M, a matrix (Macaulay2Doc),

Description
===========

For the Minkowski summand cone one takes QQ (Macaulay2Doc),^d where d
is the number of edges of the input polyhedron P. Every Minkowski summand of P
has only edges that are edges of P, so it can be constructed by rescaling every
edge of P, i.e. is represented by a point in QQ (Macaulay2Doc),^d. But
not every point in QQ (Macaulay2Doc),^d gives a polyhedron via this
method. This is the case if on the one hand the point lies in the positive
orthant and on the other hand for every compact two dimensional face of P the
rescaled edges of such a face give a two dimensional polytope, i.e. the sum of
the ordered rescaled edge directions is zero. Therefore, every compact two
dimensional face of P gives a set of linear equalities on a part of the
variables in QQ (Macaulay2Doc),^d. The Minkowski Summand Cone C is the
intersection of the positive orthant with these equations. Thus, every point in
C corresponds to a Minkowski summand (probably after rescaling). The
corresponding polyhedron to every minimal generator of C is saved in the hash
table L. Finally, all possible minimal decompositions of P are saved as columns
in the matrix M.

For example, consider the Minkowski summand cone of the hexagon.
+------------------------------------------------------------+
|i1 : P = convexHull matrix{{2,1,-1,-2,-1,1},{0,1,1,0,-1,-1}}|
|                                                            |
|o1 = P                                                      |
|                                                            |
|o1 : Polyhedron                                             |
+------------------------------------------------------------+
|i2 : (C,L,M) = minkSummandCone P                            |
|                                                            |
|o2 = (C, HashTable{0 => Polyhedron{...1...}}, | 1 0 |)      |
|                   1 => Polyhedron{...1...}   | 0 1 |       |
|                   2 => Polyhedron{...1...}   | 1 0 |       |
|                   3 => Polyhedron{...1...}   | 1 0 |       |
|                   4 => Polyhedron{...1...}   | 0 1 |       |
|                                                            |
|o2 : Sequence                                               |
+------------------------------------------------------------+

Thus, we see that the minimal Minkowski summands of the hexagon are two
triangles and three lines and that there are two minimal decompositions, i.e.
the hexagon is the sum of the two triangles or the three lines:
+--------------------------------------------------------+
|i3 : rays C                                             |
|                                                        |
|o3 = | 1 0 0 0 1 |                                      |
|     | 0 1 0 1 0 |                                      |
|     | 0 1 1 0 0 |                                      |
|     | 1 1 0 0 0 |                                      |
|     | 0 0 1 0 1 |                                      |
|     | 0 0 0 1 1 |                                      |
|                                                        |
|              6       5                                 |
|o3 : Matrix ZZ  <-- ZZ                                  |
+--------------------------------------------------------+
|i4 : apply(values L,vertices)                           |
|                                                        |
|o4 = {| 0 2 |, | 0 2 1  |, | 0 1 |, | 0 1  |, | 0 2 1 |}|
|      | 0 0 |  | 0 0 -1 |  | 0 1 |  | 0 -1 |  | 0 0 1 | |
|                                                        |
|o4 : List                                               |
+--------------------------------------------------------+
|i5 : M                                                  |
|                                                        |
|o5 = | 1 0 |                                            |
|     | 0 1 |                                            |
|     | 1 0 |                                            |
|     | 1 0 |                                            |
|     | 0 1 |                                            |
|                                                        |
|              5       2                                 |
|o5 : Matrix QQ  <-- QQ                                  |
+--------------------------------------------------------+

Ways to use minkSummandCone:
============================

  * "minkSummandCone(Polyhedron)"

For the programmer
==================

The object minkSummandCone, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1914:0.

mixedVolume -- computes the mixed volume of a list of polytope
**************************************************************

  * Usage:
        v = mixedVolume L
  * Inputs:
      * L, a list (Macaulay2Doc), containing n polytopes in n-space
  * Outputs:
      * v, an integer (Macaulay2Doc), the mixed volume

Description
===========

Let $P_1,...,P_n$ be polytopes in $n$-space. Then the volume of the Minkowski
sum $\lambda_1 P_1 + ... + \lambda_n P_n$ is a homogeneous polynomial of degree
$n$ in nonnegative variables $\lambda_1,...,\lambda_n$. The coefficient
Vol$(P_1,...,P_n)$ of $\lambda_1\lambda_2 ... \lambda_n$ is called the mixed
volume of $P_1,...,P_n$. For example, the number of toric solutions to a
generic system of /$n$ polynomial equations on $n$-space amounts to the mixed
volume of the corresponding Newton polytopes.

The function mixedVolume takes the List (Macaulay2Doc), L with $n$
polytopes in $n$-space and computes their mixed Volume by using the algorithm
by Ioannis Z. Emiris in his paper Mixed Volume Implementation (see
http://www.nag.co.uk/projects/frisco/frisco/reports/d33421.ps ). Note that this
function computes an upper bound by using a random lifting. To reassure the
result run the function until it returns the same result.

CAVEAT: So far the input is not checked so use the function with care!
+------------------------+
|i1 : P = crossPolytope 2|
|                        |
|o1 = P                  |
|                        |
|o1 : Polyhedron         |
+------------------------+
|i2 : Q = hypercube 2    |
|                        |
|o2 = Q                  |
|                        |
|o2 : Polyhedron         |
+------------------------+
|i3 : mixedVolume {P,Q}  |
|                        |
|o3 = 8                  |
|                        |
|o3 : QQ                 |
+------------------------+

Ways to use mixedVolume:
========================

  * "mixedVolume(List)"

For the programmer
==================

The object mixedVolume, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1948:0.

newtonPolytope -- computes the Newton polytope of a polynomial
**************************************************************

  * Usage:
        P = newtonPolytope f
  * Inputs:
      * f, a ring element (Macaulay2Doc),
  * Outputs:
      * P, a convex polyhedron,

Description
===========

The newtonPolytope of f is the convex hull of its exponent vectors in n-space,
where n is the number of variables in the ring.

Consider the Vandermond determinant in 3 variables:
+-----------------------------------------+
|i1 : R = QQ[a,b,c]                       |
|                                         |
|o1 = R                                   |
|                                         |
|o1 : PolynomialRing                      |
+-----------------------------------------+
|i2 : f = (a-b)*(a-c)*(b-c)               |
|                                         |
|      2       2    2     2       2      2|
|o2 = a b - a*b  - a c + b c + a*c  - b*c |
|                                         |
|o2 : R                                   |
+-----------------------------------------+

If we compute the Newton polytope we get a hexagon in QQ^3.
+-------------------------+
|i3 : P = newtonPolytope f|
|                         |
|o3 = P                   |
|                         |
|o3 : Polyhedron          |
+-------------------------+

Ways to use newtonPolytope:
===========================

  * "newtonPolytope(RingElement)"

For the programmer
==================

The object newtonPolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3006:0.

normalCone(Polyhedron,Polyhedron) -- computes the normal cone of a face of a polyhedron
***************************************************************************************

  * Function: normalCone (Macaulay2Doc),
  * Usage:
        C = normalCone(P,Q)
  * Inputs:
      * P, a convex polyhedron,
      * Q, a convex polyhedron, which must be a face of P
  * Outputs:
      * C, a convex rational cone,

Description
===========

The normal cone of a face Q of a polyhedron P is the cone in the normal fan
(see normalFan) that corresponds to this face. This is the
cone of all vectors attaining their maximum on this face.
+--------------------------------------------------------------+
|i1 : P = hypercube 3                                          |
|                                                              |
|o1 = P                                                        |
|                                                              |
|o1 : Polyhedron                                               |
+--------------------------------------------------------------+
|i2 : Q = convexHull matrix {{1,1,-1,-1},{1,-1,1,-1},{1,1,1,1}}|
|                                                              |
|o2 = Q                                                        |
|                                                              |
|o2 : Polyhedron                                               |
+--------------------------------------------------------------+
|i3 : C = normalCone(P,Q)                                      |
|                                                              |
|o3 = C                                                        |
|                                                              |
|o3 : Cone                                                     |
+--------------------------------------------------------------+
|i4 : rays C                                                   |
|                                                              |
|o4 = | 0  |                                                   |
|     | 0  |                                                   |
|     | -1 |                                                   |
|                                                              |
|              3       1                                       |
|o4 : Matrix ZZ  <-- ZZ                                        |
+--------------------------------------------------------------+

Ways to use this method:
========================

  * normalCone(Polyhedron,Polyhedron)
    -- computes the normal cone of a
    face of a polyhedron
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2001:0.

normalFan -- computes the normalFan of a polyhedron
***************************************************

  * Usage:
        F = normalFan P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * F, an instance of the type Fan,

Description
===========

The normalFan of a Polyhedron, is the fan generated by the
cones C_v for all vertices v of the Polyhedron, where C_v is
the dual Cone of the positive Hull of P-v. If P is compact, i.e. a polytope,
then the normalFan is complete.
+-------------------------------------------+
|i1 : P = convexHull matrix{{1,0,0},{0,1,0}}|
|                                           |
|o1 = P                                     |
|                                           |
|o1 : Polyhedron                            |
+-------------------------------------------+
|i2 : F = normalFan P                       |
|                                           |
|o2 = F                                     |
|                                           |
|o2 : Fan                                   |
+-------------------------------------------+
|i3 : raysF = rays F                        |
|                                           |
|o3 = | 1 -1 0 |                            |
|     | 0 -1 1 |                            |
|                                           |
|              2       3                    |
|o3 : Matrix ZZ  <-- ZZ                     |
+-------------------------------------------+
|i4 : apply(maxCones F, mc -> raysF_mc)     |
|                                           |
|o4 = {| 1 0 |, | -1 0 |, | 1 -1 |}         |
|      | 0 1 |  | -1 1 |  | 0 -1 |          |
|                                           |
|o4 : List                                  |
+-------------------------------------------+

Ways to use normalFan:
======================

  * "normalFan(Polyhedron)"

For the programmer
==================

The object normalFan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2740:0.

nVertices -- Returns the number of vertices of a polyhedron
***********************************************************

  * Usage:
        n = nVertices P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * n, an integer (Macaulay2Doc),

Description
===========

Returns the number of vertices of a polyhedron

+--------------------+
|i1 : C = hypercube 2|
|                    |
|o1 = C              |
|                    |
|o1 : Polyhedron     |
+--------------------+
|i2 : nVertices C    |
|                    |
|o2 = 4              |
+--------------------+

Ways to use nVertices:
======================

  * "nVertices(Polyhedron)"

For the programmer
==================

The object nVertices, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:597:0.

objectiveVector -- computes an objective vector of a face of a polyhedron
*************************************************************************

  * Usage:
        v = objectiveVector(P,Q)
  * Inputs:
      * P, a convex polyhedron,
      * Q, a convex polyhedron, which must be a face of P
  * Outputs:
      * v, a matrix (Macaulay2Doc), one column vector over
        QQ (Macaulay2Doc), representing a vector

Description
===========

An objective vector v of a face Q of a polyhedron P is vector such that Q = {p
in P | v*p = max over P} i.e. it is the face on which v attains its maximum.
+--------------------------------------------------------------+
|i1 : P = hypercube 3                                          |
|                                                              |
|o1 = P                                                        |
|                                                              |
|o1 : Polyhedron                                               |
+--------------------------------------------------------------+
|i2 : Q = convexHull matrix {{1,1,-1,-1},{1,-1,1,-1},{1,1,1,1}}|
|                                                              |
|o2 = Q                                                        |
|                                                              |
|o2 : Polyhedron                                               |
+--------------------------------------------------------------+
|i3 : v = objectiveVector(P,Q)                                 |
|                                                              |
|o3 = | 0 |                                                    |
|     | 0 |                                                    |
|     | 1 |                                                    |
|                                                              |
|              3       1                                       |
|o3 : Matrix QQ  <-- QQ                                        |
+--------------------------------------------------------------+

Since it is the face on which v attains its maximum it can be recovered with
maxFace,:
+----------------------+
|i4 : Q == maxFace(v,P)|
|                      |
|o4 = true             |
+----------------------+

Ways to use objectiveVector:
============================

  * "objectiveVector(Polyhedron,Polyhedron)"

For the programmer
==================

The object objectiveVector, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1978:0.

polar --  computes the polar of a polyhedron
********************************************

  * Usage:
        Pv = polar P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * Pv, a convex polyhedron,

Description
===========

The polar polyhedron of P in n-space is the polyhedron in the dual space given
by {v in (QQ^n)^* | v*p >= -1 for all p in P}.
+-------------------------+
|i1 : P = hypercube 3     |
|                         |
|o1 = P                   |
|                         |
|o1 : Polyhedron          |
+-------------------------+
|i2 : Q = polar P         |
|                         |
|o2 = Q                   |
|                         |
|o2 : Polyhedron          |
+-------------------------+
|i3 : Q == crossPolytope 3|
|                         |
|o3 = true                |
+-------------------------+

Ways to use polar:
==================

  * "polar(Polyhedron)"

For the programmer
==================

The object polar, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2762:0.

polarFace --  computes the dual face of the polar polyhedron
************************************************************

  * Usage:
        fv = polarFace f
  * Inputs:
      * f, a convex polyhedron,
      * P, a convex polyhedron,
  * Outputs:
      * fv, a convex polyhedron,

Description
===========

Given a polyhedron f which is a face of a polyhedron P the function polarFace
computes the polar, P' of P and the corresponding face of P' on
which all points of f attain their minimum. Note that this function only works
correctly for polyhedra with the origin in its relative interior.
+--------------------------------------+
|i1 : P = hypercube 3                  |
|                                      |
|o1 = P                                |
|                                      |
|o1 : Polyhedron                       |
+--------------------------------------+
|i2 : f = first faces(1,P)             |
|                                      |
|o2 = ({0, 2, 4, 6}, {})               |
|                                      |
|o2 : Sequence                         |
+--------------------------------------+
|i3 : f = convexHull (vertices P)_(f#0)|
|                                      |
|o3 = f                                |
|                                      |
|o3 : Polyhedron                       |
+--------------------------------------+
|i4 : fv = polarFace(f, P)             |
|                                      |
|o4 = fv                               |
|                                      |
|o4 : Polyhedron                       |
+--------------------------------------+
|i5 : vertices fv                      |
|                                      |
|o5 = | 1 |                            |
|     | 0 |                            |
|     | 0 |                            |
|                                      |
|              3       1               |
|o5 : Matrix QQ  <-- QQ                |
+--------------------------------------+

If f is not a face of another polytope, then it considers f as a face of
itself. Thus, it computes the polar of f, and returns the empty polyhedron as a
face of the polar of f.
+------------------------+
|i6 : P = hypercube 3    |
|                        |
|o6 = P                  |
|                        |
|o6 : Polyhedron         |
+------------------------+
|i7 : polarFace(P, P)    |
|                        |
|o7 = Polyhedron{...1...}|
|                        |
|o7 : Polyhedron         |
+------------------------+

Ways to use polarFace:
======================

  * "polarFace(Polyhedron,Polyhedron)"

For the programmer
==================

The object polarFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2798:0.

polyhedra -- computes all polyhedra of a polyhedral complex of a certain dimension
**********************************************************************************

  * Usage:
        L = polyhedra(d,PC)
  * Inputs:
      * d, an integer (Macaulay2Doc),  between 0 and the dimension of
        the polyhedral complex
      * PC, an instance of the type PolyhedralComplex,
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

polyhedra computes the List (Macaulay2Doc), of all Polyhedra in PC
of dimension d.
+-----------------------------------------------------------------------------+
|i1 : PC = polyhedralComplex hypercube 3                                      |
|                                                                             |
|o1 = PC                                                                      |
|                                                                             |
|o1 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+
|i2 : L = polyhedra(2,PC)                                                     |
|                                                                             |
|o2 = {({0, 1}, {}), ({0, 2}, {}), ({0, 4}, {}), ({1, 3}, {}), ({1, 5}, {}),  |
|     ------------------------------------------------------------------------|
|     ({2, 3}, {}), ({2, 6}, {}), ({3, 7}, {}), ({4, 5}, {}), ({4, 6}, {}),   |
|     ------------------------------------------------------------------------|
|     ({5, 7}, {}), ({6, 7}, {})}                                             |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

To actually see the polyhedra of the complex we can look at their vertices, for
example:
+-----------------------------------------------------------------------------+
|i3 : vertPC = vertices PC                                                    |
|                                                                             |
|o3 = | -1 1  -1 1  -1 1  -1 1 |                                              |
|     | -1 -1 1  1  -1 -1 1  1 |                                              |
|     | -1 -1 -1 -1 1  1  1  1 |                                              |
|                                                                             |
|              3       8                                                      |
|o3 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+
|i4 : apply(L, l -> vertPC_(l#0))                                             |
|                                                                             |
|o4 = {| -1 1  |, | -1 -1 |, | -1 -1 |, | 1  1  |, | 1  1  |, | -1 1  |, | -1 |
|      | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 1  |  | -1 -1 |  | 1  1  |  | 1  |
|      | -1 -1 |  | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 |
|     ------------------------------------------------------------------------|
|     -1 |, | 1  1 |, | -1 1  |, | -1 -1 |, | 1  1 |, | -1 1 |}               |
|     1  |  | 1  1 |  | -1 -1 |  | -1 1  |  | -1 1 |  | 1  1 |                |
|     1  |  | -1 1 |  | 1  1  |  | 1  1  |  | 1  1 |  | 1  1 |                |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use polyhedra:
======================

  * "polyhedra(ZZ,PolyhedralComplex)"

For the programmer
==================

The object polyhedra, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:818:0.

PolyhedralComplex -- the class of all polyhedral complexes
**********************************************************

Description
===========

A PolyhedralComplex represents a complex of rational convex polyhedra, i.e. a
collection of polyhedra, such that for every polyhedron in the complex all
faces are in the complex and for every two polyhedra in the complex their
intersection is a face of each (intersection condition). It need not be full
dimensional or pure, and the polyhedra need not be compact. It is saved as a
hash table which contains a list of the generating polyhedra of the complex
starting with those of maximal dimension. So for every polyhedron in this list
all faces are considered to be in the complex. The output of a
PolyhedralComplex looks like this:
+--------------------------------------+
|i1 : polyhedralComplex crossPolytope 3|
|                                      |
|o1 = PolyhedralComplex{...1...}       |
|                                      |
|o1 : PolyhedralComplex                |
+--------------------------------------+

This table displays a short summary of the properties of the PolyhedralComplex.
However, one can not access the above information directly, because this is
just a virtual hash table generated for the output. The data defining a
PolyhedralComplex is extracted by the functions included in this package. A
PolyhedralComplex can be constructed by collecting Polyhedra that satisfy the
intersection condition. Every polyhedron that is added to a PolyhedralComplex
is always considered as the collection of the Polyhedron and all of its faces.
+-------------------------------------------------+
|i2 : P1 = convexHull matrix {{2,2,0},{1,-1,0}};  |
+-------------------------------------------------+
|i3 : P2 = convexHull matrix {{2,-2,0},{1,1,0}};  |
+-------------------------------------------------+
|i4 : P3 = convexHull matrix {{-2,-2,0},{1,-1,0}};|
+-------------------------------------------------+
|i5 : P4 = convexHull matrix {{-2,2,0},{-1,-1,0}};|
+-------------------------------------------------+
|i6 : F = polyhedralComplex {P1,P2,P3,P4}         |
|                                                 |
|o6 = F                                           |
|                                                 |
|o6 : PolyhedralComplex                           |
+-------------------------------------------------+

Methods that use an object of class PolyhedralComplex:
======================================================

  * "addPolyhedron(List,PolyhedralComplex)" -- see addPolyhedron,
    -- adds Polyhedra to a PolyhedralComplex
  * "addPolyhedron(Polyhedron,PolyhedralComplex)" -- see addPolyhedron,
    -- adds Polyhedra to a PolyhedralComplex
  * fan(PolyhedralComplex) -- Take the fan
    over a polyhedral complex
  * "incompPolyhedra(PolyhedralComplex,PolyhedralComplex)" -- see
    incompPolyhedra, -- returns the pairs of incompatible
    polyhedra
  * "incompPolyhedra(PolyhedralComplex,Polyhedron)" -- see
    incompPolyhedra, -- returns the pairs of incompatible
    polyhedra
  * "incompPolyhedra(Polyhedron,PolyhedralComplex)" -- see
    incompPolyhedra, -- returns the pairs of incompatible
    polyhedra
  * "isComplete(PolyhedralComplex)" -- see isComplete, --
    checks completeness of a Fan or PolyhedralComplex
  * "isPure(PolyhedralComplex)" -- see isPure, -- checks if a Fan
    or PolyhedralComplex is of pure dimension
  * "isWellDefined(PolyhedralComplex)" -- see isWellDefined(Cone),
    -- Checks whether a polyhedral object is
    well-defined.
  * "maxPolyhedra(PolyhedralComplex)" -- see maxPolyhedra,
    -- displays the generating Polyhedra of a PolyhedralComplex
  * "polyhedra(ZZ,PolyhedralComplex)" -- see polyhedra, --
    computes all polyhedra of a polyhedral complex of a certain dimension
  * "skeleton(ZZ,PolyhedralComplex)" -- see skeleton, --
    computes the k-skeleton of a Fan or PolyhedralComplex
  * "vertices(PolyhedralComplex)" -- see vertices, -- displays
    the vertices of a Polyhedron or a PolyhedralComplex

For the programmer
==================

The object PolyhedralComplex, is a type (Macaulay2Doc),
with ancestor classes PolyhedralObject,
< MutableHashTable (Macaulay2Doc) <
HashTable (Macaulay2Doc) < Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:343:0.

polyhedralComplex -- generates a PolyhedralComplex
**************************************************

  * Usage:
        PC = polyhedralComplex P
        PC = polyhedralComplex L
  * Inputs:
      * P, a convex polyhedron,
      * L, a list (Macaulay2Doc), with elements of class
        Polyhedron, or PolyhedralComplex,
  * Outputs:
      * F, an instance of the type PolyhedralComplex,

Description
===========

 If polyhedralComplex is applied to a Polyhedron, it
generates the PolyhedralComplex, given by the
Polyhedron and all of its faces. If applied to a List (Macaulay2Doc),
the list must only contain Polyhedra and
PolyhedralComplexes in the same ambient space. Then it adds the Polyhedra in
the List and the generating Polyhedra of the PolyhedralComplexes in the List
one by one to the new PolyhedralComplex, checking each time if the new
Polyhedron is compatible with the polyhedra that have already been added, i.e.
that the intersection with each of them is a face of both Polyhedra
(intersection condition).

If one of the polyhedra is in the wrong ambient space (i.e. not the ambient
space of the first object in the list), then there will be an error and no
PolyhedralComplex will be returned. If the intersection condition fails, there
will also be an error. The pairs of incompatible polyhedra can be accessed with
the function incompPolyhedra.
+------------------------------------------------+
|i1 : P = convexHull matrix {{1,-1,0},{0,-1,0}}  |
|                                                |
|o1 = P                                          |
|                                                |
|o1 : Polyhedron                                 |
+------------------------------------------------+
|i2 : PC = polyhedralComplex P                   |
|                                                |
|o2 = PC                                         |
|                                                |
|o2 : PolyhedralComplex                          |
+------------------------------------------------+
|i3 : P1 = convexHull matrix {{1,0,0},{0,1,0}};  |
+------------------------------------------------+
|i4 : P2 = convexHull matrix {{0,-1,0},{1,-1,0}};|
+------------------------------------------------+
|i5 : PC = polyhedralComplex {PC,P1,P2}          |
|                                                |
|o5 = PC                                         |
|                                                |
|o5 : PolyhedralComplex                          |
+------------------------------------------------+

Ways to use polyhedralComplex:
==============================

  * "polyhedralComplex(List)"
  * "polyhedralComplex(Polyhedron)"
  * polyhedralComplex(Fan) -- Turn a fan
    into a polyhedral complex
  * "polyhedralComplex(Matrix,List)" -- see
    polyhedralComplex(Matrix,Matrix,Matrix,List),
    -- Constructing a
    polyhedral complex.
  * "polyhedralComplex(Matrix,Matrix,List)" -- see
    polyhedralComplex(Matrix,Matrix,Matrix,List),
    -- Constructing a
    polyhedral complex.
  * polyhedralComplex(Matrix,Matrix,Matrix,List)
    -- Constructing a
    polyhedral complex.

For the programmer
==================

The object polyhedralComplex, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:630:0.

polyhedralComplex(Fan) -- Turn a fan into a polyhedral complex
**************************************************************

  * Function: polyhedralComplex,
  * Usage:
        PC = polyhedralComplex F
  * Inputs:
      * F, an instance of the type Fan,
  * Outputs:
      * PC, an instance of the type PolyhedralComplex,

Description
===========

Every fan is naturally a polyhedral complex, since every cone is naturally a
polyhedron. This method converts a fan into a polyhedral complex.

+-----------------------------------------------------------------+
|i1 : F = normalFan hypercube 2                                   |
|                                                                 |
|o1 = F                                                           |
|                                                                 |
|o1 : Fan                                                         |
+-----------------------------------------------------------------+
|i2 : rays F                                                      |
|                                                                 |
|o2 = | -1 1 0  0 |                                               |
|     | 0  0 -1 1 |                                               |
|                                                                 |
|              2       4                                          |
|o2 : Matrix ZZ  <-- ZZ                                           |
+-----------------------------------------------------------------+
|i3 : maxCones F                                                  |
|                                                                 |
|o3 = {{1, 3}, {0, 3}, {1, 2}, {0, 2}}                            |
|                                                                 |
|o3 : List                                                        |
+-----------------------------------------------------------------+
|i4 : PC = polyhedralComplex F                                    |
|                                                                 |
|o4 = PC                                                          |
|                                                                 |
|o4 : PolyhedralComplex                                           |
+-----------------------------------------------------------------+
|i5 : vertices PC                                                 |
|                                                                 |
|o5 = 0                                                           |
|                                                                 |
|              2       1                                          |
|o5 : Matrix QQ  <-- QQ                                           |
+-----------------------------------------------------------------+
|i6 : rays PC                                                     |
|                                                                 |
|o6 = | -1 1 0  0 |                                               |
|     | 0  0 -1 1 |                                               |
|                                                                 |
|              2       4                                          |
|o6 : Matrix QQ  <-- QQ                                           |
+-----------------------------------------------------------------+
|i7 : maxPolyhedra PC                                             |
|                                                                 |
|o7 = {({0}, {1, 3}), ({0}, {0, 3}), ({0}, {1, 2}), ({0}, {0, 2})}|
|                                                                 |
|o7 : List                                                        |
+-----------------------------------------------------------------+

Ways to use this method:
========================

  * polyhedralComplex(Fan) -- Turn a fan
    into a polyhedral complex
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:683:0.

polyhedralComplex(Matrix,Matrix,Matrix,List) -- Constructing a polyhedral complex.
**********************************************************************************

  * Function: polyhedralComplex,
  * Usage:
        PC = polyhedralComplex(V,R,N,L)
  * Inputs:
      * V, a matrix (Macaulay2Doc), Matrix containing the
        vertices as columns
      * R, a matrix (Macaulay2Doc), Matrix containing rays as
        columns (optional)
      * N, a matrix (Macaulay2Doc), Matrix containing generators
        of the lineality space as columns (optional)
      * L, a list (Macaulay2Doc), List containing lists with
        indices of the vertices of the maximal cells.
  * Outputs:
      * PC, an instance of the type PolyhedralComplex,

Description
===========

Basic constructor for polyhedral complices that takes a matrix containing the
vertices of the polyhedral complex and a list of lists with the indices of the
vertices and rays in the maximal cells. Both the rays and the lineality space
are optional arguments. If two matrices are provided, then the second matrix is
considered to contain rays. To input a lineality space, one must provide three
matrices.

This constructor does not check well-definedness, see isWellDefined (Macaulay2Doc).

+--------------------------------+
|i1 : M = matrix {{0,1,2}}       |
|                                |
|o1 = | 0 1 2 |                  |
|                                |
|              1       3         |
|o1 : Matrix ZZ  <-- ZZ          |
+--------------------------------+
|i2 : L = {{0,1},{1,2}}          |
|                                |
|o2 = {{0, 1}, {1, 2}}           |
|                                |
|o2 : List                       |
+--------------------------------+
|i3 : PC = polyhedralComplex(M,L)|
|                                |
|o3 = PC                         |
|                                |
|o3 : PolyhedralComplex          |
+--------------------------------+
+--------------------------------------------------------------+
|i4 : C = hypercube 2                                          |
|                                                              |
|o4 = C                                                        |
|                                                              |
|o4 : Polyhedron                                               |
+--------------------------------------------------------------+
|i5 : F = faces(1,C)                                           |
|                                                              |
|o5 = {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})} |
|                                                              |
|o5 : List                                                     |
+--------------------------------------------------------------+
|i6 : V = vertices C                                           |
|                                                              |
|o6 = | -1 1  -1 1 |                                           |
|     | -1 -1 1  1 |                                           |
|                                                              |
|              2       4                                       |
|o6 : Matrix QQ  <-- QQ                                        |
+--------------------------------------------------------------+
|i7 : L = linealitySpace C                                     |
|                                                              |
|o7 = 0                                                        |
|                                                              |
|              2                                               |
|o7 : Matrix QQ  <-- 0                                         |
+--------------------------------------------------------------+
|i8 : PC = polyhedralComplex(V,L,F)                            |
|                                                              |
|o8 = PC                                                       |
|                                                              |
|o8 : PolyhedralComplex                                        |
+--------------------------------------------------------------+
|i9 : vertices PC                                              |
|                                                              |
|o9 = | -1 1  -1 1 |                                           |
|     | -1 -1 1  1 |                                           |
|                                                              |
|              2       4                                       |
|o9 : Matrix QQ  <-- QQ                                        |
+--------------------------------------------------------------+
|i10 : maxPolyhedra PC                                         |
|                                                              |
|o10 = {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})}|
|                                                              |
|o10 : List                                                    |
+--------------------------------------------------------------+
|i11 : dim PC                                                  |
|                                                              |
|o11 = 1                                                       |
+--------------------------------------------------------------+

Ways to use this method:
========================

  * "polyhedralComplex(Matrix,List)"
  * "polyhedralComplex(Matrix,Matrix,List)"
  * polyhedralComplex(Matrix,Matrix,Matrix,List)
    -- Constructing a
    polyhedral complex.
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:300:0.

PolyhedralObject -- the class of all polyhedral objects in Polyhedra
********************************************************************

Description
===========

PolyhedralObject is the parent class of the four polyhedral objects in
Polyhedra:
  * Cone
  * Polyhedron
  * Fan
  * PolyhedralComplex
+--------------------------------------------+
|i1 : coneFromVData matrix {{1,2},{2,1}}     |
|                                            |
|o1 = Cone{...1...}                          |
|                                            |
|o1 : Cone                                   |
+--------------------------------------------+
|i2 : convexHull matrix {{1,1,0,0},{1,0,1,0}}|
|                                            |
|o2 = Polyhedron{...1...}                    |
|                                            |
|o2 : Polyhedron                             |
+--------------------------------------------+
|i3 : hirzebruch 3                           |
|                                            |
|o3 = Fan{...1...}                           |
|                                            |
|o3 : Fan                                    |
+--------------------------------------------+
|i4 : polyhedralComplex crossPolytope 3      |
|                                            |
|o4 = PolyhedralComplex{...1...}             |
|                                            |
|o4 : PolyhedralComplex                      |
+--------------------------------------------+

Types of PolyhedralObject:
==========================

  * Cone -- the class of all rational convex polyhedral cones
  * Fan -- the class of all fans
  * PolyhedralComplex -- the class of all polyhedral
    complexes
  * Polyhedron -- the class of all convex polyhedra

Methods that use an object of class PolyhedralObject:
=====================================================

  * "ambDim(PolyhedralObject)" -- see ambDim, -- ambient
    dimension of a Polyhedron, Cone or Fan
  * dim(PolyhedralObject) -- computes the
    dimension of a cone, polyhedron, fan or polyhedral complex
  * "faces(ZZ,PolyhedralObject)" -- see faces, -- computes all
    faces of a certain codimension of a Cone or Polyhedron
  * faces(PolyhedralObject) -- Giving the
    faces of a polyhedral object.
  * "fVector(PolyhedralObject)" -- see fVector, -- computes the
    f-vector of a Cone, Polyhedron, Fan or PolyhedralComplex
  * "isFullDimensional(PolyhedralObject)" -- see isFullDimensional,
    -- Determine whether a polyhedral object is
    full-dimensional
  * "isSimplicial(PolyhedralObject)" -- see isSimplicial,
    --  checks if a polyhedral object is simplicial
  * "isWellDefined(PolyhedralObject)" -- see isWellDefined(Cone),
    -- Checks whether a polyhedral object is
    well-defined.
  * "linealitySpace(PolyhedralObject)" -- see linealitySpace,
    -- computes a basis of the lineality space
  * rays(PolyhedralObject) -- displays all
    rays of a Cone, a Fan, or a Polyhedron

For the programmer
==================

The object PolyhedralObject, is a type (Macaulay2Doc),
with ancestor classes MutableHashTable (Macaulay2Doc),
< HashTable (Macaulay2Doc) <
Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:166:0.

Polyhedron -- the class of all convex polyhedra
***********************************************

Description
===========

A Polyhedron represents a rational polyhedron. It can be bounded or unbounded,
need not be full dimensional or may contain a proper affine subspace. It can be
empty or zero dimensional. It is saved as a hash table which contains the
vertices, generating rays, and the basis of the lineality space of the
Polyhedron as well as the defining affine half-spaces and hyperplanes. The
output of a Polyhedron looks like this:
+-----------------------------------------------------------------------------+
|i1 : convexHull(matrix {{0,0,-1,-1},{2,-2,1,-1},{0,0,0,0}},matrix            |
|                                                                             |
|o1 = Polyhedron{...1...}                                                     |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|{{1},{0},{0}})                                                               |
+-----------------------------------------------------------------------------+

This table displays a short summary of the properties of the Polyhedron. Note
that the number of rays and vertices are modulo the lineality space. So for
example a line in QQ^2 has one vertex and no rays. However, one can not access
the above information directly, because this is just a virtual hash table
generated for the output. The data defining a Polyhedron is extracted by the
functions included in this package. A Polyhedron can be constructed as the
convex hull (see convexHull) of a set of points and a set of
rays or as the intersection (see polyhedronFromHData)
of a set of affine half-spaces and affine hyperplanes.

For example, consider the square and the square with an emerging ray for the
convex hull:
+-----------------------------------------+
|i2 : V = matrix {{1,1,-1,-1},{1,-1,1,-1}}|
|                                         |
|o2 = | 1 1  -1 -1 |                      |
|     | 1 -1 1  -1 |                      |
|                                         |
|              2       4                  |
|o2 : Matrix ZZ  <-- ZZ                   |
+-----------------------------------------+
|i3 : convexHull V                        |
|                                         |
|o3 = Polyhedron{...1...}                 |
|                                         |
|o3 : Polyhedron                          |
+-----------------------------------------+
|i4 : R = matrix {{1},{1}}                |
|                                         |
|o4 = | 1 |                               |
|     | 1 |                               |
|                                         |
|              2       1                  |
|o4 : Matrix ZZ  <-- ZZ                   |
+-----------------------------------------+
|i5 : convexHull(V,R)                     |
|                                         |
|o5 = Polyhedron{...1...}                 |
|                                         |
|o5 : Polyhedron                          |
+-----------------------------------------+

If we take the intersection of the half-spaces defined by the directions of the
vertices and 1 we get the crosspolytope:
+----------------------------------+
|i6 : HS = transpose V             |
|                                  |
|o6 = | 1  1  |                    |
|     | 1  -1 |                    |
|     | -1 1  |                    |
|     | -1 -1 |                    |
|                                  |
|              4       2           |
|o6 : Matrix ZZ  <-- ZZ            |
+----------------------------------+
|i7 : v = R || R                   |
|                                  |
|o7 = | 1 |                        |
|     | 1 |                        |
|     | 1 |                        |
|     | 1 |                        |
|                                  |
|              4       1           |
|o7 : Matrix ZZ  <-- ZZ            |
+----------------------------------+
|i8 : P = polyhedronFromHData(HS,v)|
|                                  |
|o8 = P                            |
|                                  |
|o8 : Polyhedron                   |
+----------------------------------+
|i9 : vertices P                   |
|                                  |
|o9 = | -1 1 0  0 |                |
|     | 0  0 -1 1 |                |
|                                  |
|              2       4           |
|o9 : Matrix QQ  <-- QQ            |
+----------------------------------+

This can for example be embedded in 3-space on height 1:
+----------------------------------------------------+
|i10 : HS = HS | matrix {{0},{0},{0},{0}}            |
|                                                    |
|o10 = | 1  1  0 |                                   |
|      | 1  -1 0 |                                   |
|      | -1 1  0 |                                   |
|      | -1 -1 0 |                                   |
|                                                    |
|               4       3                            |
|o10 : Matrix ZZ  <-- ZZ                             |
+----------------------------------------------------+
|i11 : hyperplanesTmp = matrix {{0,0,1}}             |
|                                                    |
|o11 = | 0 0 1 |                                     |
|                                                    |
|               1       3                            |
|o11 : Matrix ZZ  <-- ZZ                             |
+----------------------------------------------------+
|i12 : w = matrix {{1}}                              |
|                                                    |
|o12 = | 1 |                                         |
|                                                    |
|               1       1                            |
|o12 : Matrix ZZ  <-- ZZ                             |
+----------------------------------------------------+
|i13 : P = polyhedronFromHData(HS,v,hyperplanesTmp,w)|
|                                                    |
|o13 = P                                             |
|                                                    |
|o13 : Polyhedron                                    |
+----------------------------------------------------+
|i14 : vertices P                                    |
|                                                    |
|o14 = | -1 1 0  0 |                                 |
|      | 0  0 -1 1 |                                 |
|      | 1  1 1  1 |                                 |
|                                                    |
|               3       4                            |
|o14 : Matrix QQ  <-- QQ                             |
+----------------------------------------------------+

See also Working with polyhedra.

Functions and methods returning a convex polyhedron:
====================================================

  * affineHull -- computes the affine hull of a polyhedron
  * affineImage -- computes the affine image of a cone or
    polyhedron
  * affinePreimage -- computes the affine preimage of a
    cone or polyhedron
  * bipyramid -- computes the bipyramid over a polyhedron
  * convexHull -- computing the convex hull of points, rays
    and polyhedra
  * crossPolytope -- computes the d-dimensional
    crosspolytope with diameter 2s
  * cyclicPolytope -- computes the d dimensional cyclic
    polytope with n vertices
  * emptyPolyhedron -- generates the empty polyhedron
    in n-space
  * hypercube -- Returns the d-dimensional hypercube
  * minkowskiSum --  computes the Minkowski sum of two
    convex objects
  * newtonPolytope -- computes the Newton polytope of a
    polynomial
  * polar --  computes the polar of a polyhedron
  * polarFace --  computes the dual face of the polar
    polyhedron
  * polytope -- returns a polytope of which the fan is the
    normal fan if it is polytopal
  * pyramid -- computes the pyramid over a polyhedron
  * secondaryPolytope -- computes the secondary
    polytope of a compact polyhedron
  * simplex -- Produces a full-dimensional simplex
  * statePolytope -- computes the state polytope of a
    homogeneous ideal
  * stdSimplex -- generates the d-dimensional standard
    simplex

Methods that use a convex polyhedron:
=====================================

  * "addPolyhedron(Polyhedron,PolyhedralComplex)" -- see addPolyhedron,
    -- adds Polyhedra to a PolyhedralComplex
  * "affineHull(Polyhedron)" -- see affineHull, -- computes
    the affine hull of a polyhedron
  * "affineImage(Matrix,Polyhedron)" -- see
    affineImage(Matrix,Polyhedron,Matrix),
    -- computes the affine image
    of a polyhedron
  * affineImage(Matrix,Polyhedron,Matrix)
    -- computes the affine image
    of a polyhedron
  * "affineImage(Polyhedron,Matrix)" -- see
    affineImage(Matrix,Polyhedron,Matrix),
    -- computes the affine image
    of a polyhedron
  * "affinePreimage(Matrix,Polyhedron)" -- see
    affinePreimage(Matrix,Polyhedron,Matrix),
    -- computes the affine
    preimage of a polyhedron
  * affinePreimage(Matrix,Polyhedron,Matrix)
    -- computes the affine
    preimage of a polyhedron
  * "affinePreimage(Polyhedron,Matrix)" -- see
    affinePreimage(Matrix,Polyhedron,Matrix),
    -- computes the affine
    preimage of a polyhedron
  * "areCompatible(Polyhedron,Polyhedron)" -- see areCompatible,
    -- checks if the intersection of two cones/polyhedra is a
    face of each
  * "barycentricTriangulation(Polyhedron)" -- see
    barycentricTriangulation, -- computes a
    triangulation of a polytope
  * "bipyramid(Polyhedron)" -- see bipyramid, -- computes the
    bipyramid over a polyhedron
  * "cellDecompose(Polyhedron,Matrix)" -- see cellDecompose,
    -- Deprecated variant of {\tt regularSubdivision}
  * "commonFace(Polyhedron,Polyhedron)" -- see commonFace, --
    checks if the intersection is a face of both Cones or Polyhedra, or of
    cones with fans
  * Cone * Polyhedron -- computes the direct
    product of a cone and a polyhedron
  * Cone + Polyhedron -- computes the Minkowski sum
    of a cone and a polyhedron
  * cone(Polyhedron) -- Take the cone over a
    polyhedron
  * "coneFromVData(Polyhedron)" -- see coneFromVData, --
    computes the positive hull of rays, cones, and the cone over a polyhedron
  * "contains(Cone,Polyhedron)" -- see contains, -- checks if
    the first argument contains the second argument
  * "contains(List,Polyhedron)" -- see contains, -- checks if
    the first argument contains the second argument
  * "contains(Polyhedron,Cone)" -- see contains, -- checks if
    the first argument contains the second argument
  * "contains(Polyhedron,Matrix)" -- see contains, -- checks if
    the first argument contains the second argument
  * "contains(Polyhedron,Polyhedron)" -- see contains, --
    checks if the first argument contains the second argument
  * "convexHull(Polyhedron,Polyhedron)" -- see convexHull, --
    computing the convex hull of points, rays and polyhedra
  * "directProduct(Cone,Polyhedron)" -- see directProduct(Cone,Cone),
    -- computes the direct product of polyhedra
    and cones
  * "directProduct(Polyhedron,Cone)" -- see directProduct(Cone,Cone),
    -- computes the direct product of polyhedra
    and cones
  * "directProduct(Polyhedron,Polyhedron)" -- see
    directProduct(Cone,Cone), -- computes the
    direct product of polyhedra and cones
  * dualFaceRepresentationMap(Polyhedron) (missing documentation)
  * "ehrhart(Polyhedron)" -- see ehrhart, -- calculates the
    Ehrhart polynomial of a polytope
  * "faceFan(Polyhedron)" -- see faceFan, --  computes the fan
    generated by the cones over the faces
  * "facesAsPolyhedra(ZZ,Polyhedron)" -- see facesAsPolyhedra,
    -- Returns the faces of a polyhedron as actual polyhedra.
  * "facets(Polyhedron)" -- see facets, -- Giving the facet
    inequalities of a cone or polyhedron.
  * "halfspaces(Polyhedron)" -- see halfspaces, -- computes
    the defining half-spaces of a Cone or a Polyhedron
  * "hyperplanes(Polyhedron)" -- see hyperplanes, --
    computes the defining hyperplanes of a Cone or a Polyhedron
  * "incompPolyhedra(PolyhedralComplex,Polyhedron)" -- see
    incompPolyhedra, -- returns the pairs of incompatible
    polyhedra
  * "incompPolyhedra(Polyhedron,PolyhedralComplex)" -- see
    incompPolyhedra, -- returns the pairs of incompatible
    polyhedra
  * "inInterior(Matrix,Polyhedron)" -- see inInterior, --
    checks if a point lies in the relative interior of a Cone/Polyhedron
  * "interiorLatticePoints(Polyhedron)" -- see interiorLatticePoints,
    -- computes the lattice points in the relative
    interior of a polytope
  * "interiorPoint(Polyhedron)" -- see interiorPoint, --
    computes a point in the relative interior of the Polyhedron
  * "intersect(Cone,Polyhedron)" -- see intersect, -- computes
    the intersection of cones, and polyhedra
  * "intersect(Polyhedron,Cone)" -- see intersect, -- computes
    the intersection of cones, and polyhedra
  * "intersect(Polyhedron,Polyhedron)" -- see intersect, --
    computes the intersection of cones, and polyhedra
  * "isCompact(Polyhedron)" -- see isCompact, -- checks
    compactness of a Polyhedron
  * "isEmpty(Polyhedron)" -- see isEmpty, -- checks if a
    Polyhedron is empty
  * "isFace(Polyhedron,Polyhedron)" -- see isFace, -- tests if
    the first argument is a face of the second
  * "isLatticePolytope(Polyhedron)" -- see isLatticePolytope,
    -- checks if a polyhedron is a lattice polytope
  * isNormal(Polyhedron) -- checks if a
    polytope is normal in the ambient lattice
  * "isReflexive(Polyhedron)" -- see isReflexive, --  checks
    if a Polytope is reflexive
  * isVeryAmple(Polyhedron) -- checks if
    the Polyhedron is very ample
  * "isWellDefined(Polyhedron)" -- see isWellDefined(Cone),
    -- Checks whether a polyhedral object is
    well-defined.
  * "latticePoints(Polyhedron)" -- see latticePoints, --
    computes the lattice points of a polytope
  * "latticeVolume(Polyhedron)" -- see latticeVolume, --
    Returning the lattice volume of a polyhedron.
  * "linSpace(Polyhedron)" -- see linSpace, -- Deprecated
    version of @TO "linealitySpace"@
  * "maxFace(Matrix,Polyhedron)" -- see maxFace, -- computes the
    face of a Polyhedron or Cone where a weight attains its maximum
  * "minFace(Matrix,Polyhedron)" -- see minFace, -- computes the
    face of a Polyhedron or Cone where a weight attains its minimum
  * "minkowskiSum(Cone,Polyhedron)" -- see minkowskiSum, --
    computes the Minkowski sum of two convex objects
  * "minkowskiSum(Polyhedron,Cone)" -- see minkowskiSum, --
    computes the Minkowski sum of two convex objects
  * "minkowskiSum(Polyhedron,Polyhedron)" -- see minkowskiSum,
    --  computes the Minkowski sum of two convex objects
  * "minkSummandCone(Polyhedron)" -- see minkSummandCone,
    -- computes the Cone of all Minkowski summands and the
    minimal decompositions
  * normalCone(Polyhedron,Polyhedron)
    -- computes the normal cone of a
    face of a polyhedron
  * "normalFan(Polyhedron)" -- see normalFan, -- computes the
    normalFan of a polyhedron
  * "nVertices(Polyhedron)" -- see nVertices, -- Returns the
    number of vertices of a polyhedron
  * "objectiveVector(Polyhedron,Polyhedron)" -- see objectiveVector,
    -- computes an objective vector of a face of a polyhedron
  * "polar(Polyhedron)" -- see polar, --  computes the polar of a
    polyhedron
  * "polarFace(Polyhedron,Polyhedron)" -- see polarFace, --
    computes the dual face of the polar polyhedron
  * "polyhedralComplex(Polyhedron)" -- see polyhedralComplex,
    -- generates a PolyhedralComplex
  * Polyhedron * Cone -- computes the direct
    product of a polyhedron and a cone
  * Polyhedron * Polyhedron -- computes the
    direct product of two polyhedra
  * Polyhedron + Cone -- computes the Minkowski sum
    of a polyhedron and a cone
  * Polyhedron + Polyhedron -- computes the
    Minkowski sum of two polyhedra
  * Polyhedron == Polyhedron -- equality
  * "proximum(Matrix,Polyhedron)" -- see proximum, -- computes
    the proximum of the Polyhedron/Cone to a point in euclidean metric
  * "pyramid(Polyhedron)" -- see pyramid, -- computes the
    pyramid over a polyhedron
  * QQ * Polyhedron -- rescales a polyhedron by a
    given positive factor
  * "ZZ * Polyhedron" -- see QQ * Polyhedron, --
    rescales a polyhedron by a given positive factor
  * "regularSubdivision(Polyhedron,Matrix)" -- see regularSubdivision,
    -- Computes the regular cell decomposition
  * "regularTriangulation(Polyhedron)" -- see regularTriangulation,
    -- Computes a regular triangulation of a given
    polytope.
  * "secondaryPolytope(Polyhedron)" -- see secondaryPolytope,
    -- computes the secondary polytope of a compact
    polyhedron
  * "smallestFace(Matrix,Polyhedron)" -- see smallestFace,
    -- determines the smallest face of the Cone/Polyhedron containing a point
  * "sublatticeBasis(Polyhedron)" -- see sublatticeBasis,
    -- computes a basis for the sublattice generated by
    integral vectors or lattice points of a polytope
  * "tailCone(Polyhedron)" -- see tailCone, -- computes the
    tail/recession cone of a polyhedron
  * "toSublattice(Polyhedron)" -- see toSublattice, --
    calculates the preimage of a polytope in the sublattice generated by its
    lattice points
  * "triangulate(Polyhedron)" -- see triangulate, --
    Deprecated name for {\tt barycentricTriangulation}
  * "vertexEdgeMatrix(Polyhedron)" -- see vertexEdgeMatrix,
    -- computes the vertex-edge-relations matrix
  * "vertexFacetMatrix(Polyhedron)" -- see vertexFacetMatrix,
    -- computes the vertex-facet-relations matrix
  * "vertices(Polyhedron)" -- see vertices, -- displays the
    vertices of a Polyhedron or a PolyhedralComplex
  * "volume(Polyhedron)" -- see volume, -- computes the volume of
    a polytope

For the programmer
==================

The object Polyhedron, is a type (Macaulay2Doc),
with ancestor classes PolyhedralObject, <
MutableHashTable (Macaulay2Doc) < HashTable (Macaulay2Doc)
< Thing (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:224:0.

polyhedron -- Turn a cone into a polyhedron
*******************************************

  * Usage:
        P = polyhedron C
  * Inputs:
      * C, a convex rational cone,
  * Outputs:
      * P, a convex polyhedron,

Description
===========

Every cone is naturally a polyhedron with a single vertex, the origin, and the
rays originating from the origin. This method converts a cone into a
polyhedron.

+-----------------------+
|i1 : C = posOrthant 2  |
|                       |
|o1 = C                 |
|                       |
|o1 : Cone              |
+-----------------------+
|i2 : rays C            |
|                       |
|o2 = | 1 0 |           |
|     | 0 1 |           |
|                       |
|              2       2|
|o2 : Matrix ZZ  <-- ZZ |
+-----------------------+
|i3 : P = polyhedron C  |
|                       |
|o3 = P                 |
|                       |
|o3 : Polyhedron        |
+-----------------------+
|i4 : vertices P        |
|                       |
|o4 = 0                 |
|                       |
|              2       1|
|o4 : Matrix QQ  <-- QQ |
+-----------------------+
|i5 : rays P            |
|                       |
|o5 = | 1 0 |           |
|     | 0 1 |           |
|                       |
|              2       2|
|o5 : Matrix QQ  <-- QQ |
+-----------------------+

Ways to use polyhedron:
=======================

  * "polyhedron(Cone)"

For the programmer
==================

The object polyhedron, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:576:0.

Polyhedron * Cone -- computes the direct product of a polyhedron and a cone
***************************************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        Q = P * C
  * Inputs:
      * P, a convex polyhedron,
      * C, a convex rational cone,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the direct product of P and C. This is the polyhedron {(p,c) | p in P,
x in C}, in the direct product of the ambient spaces.

See also directProduct(Cone,Cone).
+-------------------------------------------+
|i1 : P =convexHull matrix {{1},{-1}}       |
|                                           |
|o1 = P                                     |
|                                           |
|o1 : Polyhedron                            |
+-------------------------------------------+
|i2 : C = coneFromVData matrix {{1,2},{2,1}}|
|                                           |
|o2 = C                                     |
|                                           |
|o2 : Cone                                  |
+-------------------------------------------+
|i3 : Q = P * C                             |
|                                           |
|o3 = Q                                     |
|                                           |
|o3 : Polyhedron                            |
+-------------------------------------------+
|i4 : (vertices Q,rays Q)                   |
|                                           |
|o4 = (| 1  |, | 0 0 |)                     |
|      | -1 |  | 0 0 |                      |
|      | 0  |  | 2 1 |                      |
|      | 0  |  | 1 2 |                      |
|                                           |
|o4 : Sequence                              |
+-------------------------------------------+

Ways to use this method:
========================

  * Polyhedron * Cone -- computes the direct
    product of a polyhedron and a cone
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3203:0.

Polyhedron * Polyhedron -- computes the direct product of two polyhedra
***********************************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        Q = P1 * P2
  * Inputs:
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the direct product of P1 and P2.This is the polyhedron {(x,y) | x in
P1, y in P2}, in the direct product of the ambient spaces.

See also directProduct(Cone,Cone).
+---------------------------------------------------+
|i1 : P1 = convexHull matrix {{1,-1,0,0},{0,0,1,-1}}|
|                                                   |
|o1 = P1                                            |
|                                                   |
|o1 : Polyhedron                                    |
+---------------------------------------------------+
|i2 : P2 = convexHull matrix {{1},{-1}}             |
|                                                   |
|o2 = P2                                            |
|                                                   |
|o2 : Polyhedron                                    |
+---------------------------------------------------+
|i3 : P = P1 * P2                                   |
|                                                   |
|o3 = P                                             |
|                                                   |
|o3 : Polyhedron                                    |
+---------------------------------------------------+
|i4 : vertices P                                    |
|                                                   |
|o4 = | -1 1  0  0  |                               |
|     | 0  0  -1 1  |                               |
|     | 1  1  1  1  |                               |
|     | -1 -1 -1 -1 |                               |
|                                                   |
|              4       4                            |
|o4 : Matrix QQ  <-- QQ                             |
+---------------------------------------------------+

Ways to use this method:
========================

  * Polyhedron * Polyhedron -- computes the
    direct product of two polyhedra
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3229:0.

Polyhedron + Cone -- computes the Minkowski sum of a polyhedron and a cone
**************************************************************************

  * Operator: + (Macaulay2Doc),
  * Usage:
        Q = P + C
  * Inputs:
      * P, a convex polyhedron,
      * C, a convex rational cone,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the Minkowski sum of P and C. This is the polyhedron P + C = {p + c |
p in P, c in C}. Note that P and C have to lie in the same ambient space.

See also minkowskiSum.
+---------------------------------------+
|i1 : P = hypercube 2                   |
|                                       |
|o1 = P                                 |
|                                       |
|o1 : Polyhedron                        |
+---------------------------------------+
|i2 : C = coneFromVData matrix {{1},{2}}|
|                                       |
|o2 = C                                 |
|                                       |
|o2 : Cone                              |
+---------------------------------------+
|i3 : Q = P + C                         |
|                                       |
|o3 = Q                                 |
|                                       |
|o3 : Polyhedron                        |
+---------------------------------------+
|i4 : (vertices Q,rays Q)               |
|                                       |
|o4 = (| -1 1  -1 |, | 1 |)             |
|      | -1 -1 1  |  | 2 |              |
|                                       |
|o4 : Sequence                          |
+---------------------------------------+

Ways to use this method:
========================

  * Polyhedron + Cone -- computes the Minkowski sum
    of a polyhedron and a cone
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3360:0.

Polyhedron + Polyhedron -- computes the Minkowski sum of two polyhedra
**********************************************************************

  * Operator: + (Macaulay2Doc),
  * Usage:
        Q = P1 + P2
  * Inputs:
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Computes the Minkowski sum of P1 and P2.This is the polyhedron P1 + P2 = {x + y
| x in P1, y in P2}. Note that P1 and P2 have to lie in the same ambient space.

See also minkowskiSum.
+-----------------------------------------------+
|i1 : P1 = convexHull matrix {{1,0,0},{0,1,0}}  |
|                                               |
|o1 = P1                                        |
|                                               |
|o1 : Polyhedron                                |
+-----------------------------------------------+
|i2 : P2 = convexHull matrix {{-1,0,0},{0,-1,0}}|
|                                               |
|o2 = P2                                        |
|                                               |
|o2 : Polyhedron                                |
+-----------------------------------------------+
|i3 : P = P1 + P2                               |
|                                               |
|o3 = P                                         |
|                                               |
|o3 : Polyhedron                                |
+-----------------------------------------------+
|i4 : vertices P                                |
|                                               |
|o4 = | -1 1 0  1  0 -1 |                       |
|     | 0  0 -1 -1 1 1  |                       |
|                                               |
|              2       6                        |
|o4 : Matrix QQ  <-- QQ                         |
+-----------------------------------------------+

Ways to use this method:
========================

  * Polyhedron + Polyhedron -- computes the
    Minkowski sum of two polyhedra
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3387:0.

Polyhedron == Polyhedron -- equality
************************************

  * Operator: == (Macaulay2Doc),
  * Usage:
        P1 == P2
  * Inputs:
      * P1, a convex polyhedron,
      * P2, a convex polyhedron,

Ways to use this method:
========================

  * Polyhedron == Polyhedron -- equality
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3420:0.

polyhedronFromHData -- Constructing a polyhedron from its H-representation, i.e. inequalities and equations
***********************************************************************************************************

  * Usage:
        P = polyhedronFromHData(I, v)
        P = polyhedronFromHData(I, v, E, w)
  * Inputs:
      * I, a matrix (Macaulay2Doc), The inequalities
      * v, a matrix (Macaulay2Doc), The right hand side of the
        inequalities
      * E, a matrix (Macaulay2Doc), The equations
      * w, a matrix (Macaulay2Doc), The right hand side of the
        equations
  * Outputs:
      * P, a convex polyhedron,

Description
===========

Constructs a polyhedron from inequalities and equations. Uses the negative
halfspace defined by the equations, the normal vectors of every inequality
point outside the polyhedron.

The polyhedron is defined by $\{x\in\mathbb{R}\ |\ I * x\le v,\ E * x=w\}$.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.

+-----------------------------------------+
|i1 : S = simplex 2                       |
|                                         |
|o1 = S                                   |
|                                         |
|o1 : Polyhedron                          |
+-----------------------------------------+
|i2 : facets S                            |
|                                         |
|o2 = (| -1 0  |, | 0 |)                  |
|      | 0  -1 |  | 0 |                   |
|      | 1  1  |  | 1 |                   |
|                                         |
|o2 : Sequence                            |
+-----------------------------------------+
|i3 : SCopy = polyhedronFromHData facets S|
|                                         |
|o3 = SCopy                               |
|                                         |
|o3 : Polyhedron                          |
+-----------------------------------------+
|i4 : assert(vertices S == vertices SCopy)|
+-----------------------------------------+
+---------------------------------------------------------------+
|i5 : S = stdSimplex 2                                          |
|                                                               |
|o5 = S                                                         |
|                                                               |
|o5 : Polyhedron                                                |
+---------------------------------------------------------------+
|i6 : facets S                                                  |
|                                                               |
|o6 = (| -1 0  0  |, 0)                                         |
|      | 0  -1 0  |                                             |
|      | 0  0  -1 |                                             |
|                                                               |
|o6 : Sequence                                                  |
+---------------------------------------------------------------+
|i7 : hyperplanes S                                             |
|                                                               |
|o7 = (| 1 1 1 |, | 1 |)                                        |
|                                                               |
|o7 : Sequence                                                  |
+---------------------------------------------------------------+
|i8 : SCopy = polyhedronFromHData(join(facets S, hyperplanes S))|
|                                                               |
|o8 = SCopy                                                     |
|                                                               |
|o8 : Polyhedron                                                |
+---------------------------------------------------------------+
|i9 : assert(vertices S == vertices SCopy)                      |
+---------------------------------------------------------------+

Ways to use polyhedronFromHData:
================================

  * "polyhedronFromHData(Matrix,Matrix)"
  * "polyhedronFromHData(Matrix,Matrix,Matrix,Matrix)"

For the programmer
==================

The object polyhedronFromHData, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:468:0.

polytope -- returns a polytope of which the fan is the normal fan if it is polytopal
************************************************************************************

  * Usage:
        P = polytope F
  * Inputs:
      * F, an instance of the type Fan,
  * Outputs:
      * P, a convex polyhedron,

Description
===========

If the fan F is polytopal then polytope returns a polytope P. F is the normal
fan of this polytope. Note that such a polytope is not unique.
+-----------------------------------------------------------------------------+
|i1 : F = fan {coneFromVData matrix {{1,0},{0,1}},coneFromVData matrix        |
|                                                                             |
|o1 = F                                                                       |
|                                                                             |
|o1 : Fan                                                                     |
|-----------------------------------------------------------------------------|
|{{0,-1},{1,1}},coneFromVData matrix {{-1,-1},{0,1}},coneFromVData matrix     |
|-----------------------------------------------------------------------------|
|{{-1,1},{0,-1}},coneFromVData matrix {{1,1},{0,-1}}}                         |
+-----------------------------------------------------------------------------+
|i2 : P = polytope F                                                          |
|                                                                             |
|o2 = P                                                                       |
|                                                                             |
|o2 : Polyhedron                                                              |
+-----------------------------------------------------------------------------+

Ways to use polytope:
=====================

  * "polytope(Fan)"

For the programmer
==================

The object polytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2022:0.

posOrthant -- generates the positive orthant in n-space
*******************************************************

  * Usage:
        C = posOrthant n
  * Inputs:
      * n, an integer (Macaulay2Doc), strictly positive
  * Outputs:
      * C, a convex rational cone,

Description
===========

Generates the positive orthant in the n dimensional space as a cone.
+-----------------------+
|i1 : C = posOrthant 3  |
|                       |
|o1 = C                 |
|                       |
|o1 : Cone              |
+-----------------------+
|i2 : rays C            |
|                       |
|o2 = | 1 0 0 |         |
|     | 0 1 0 |         |
|     | 0 0 1 |         |
|                       |
|              3       3|
|o2 : Matrix ZZ  <-- ZZ |
+-----------------------+

Ways to use posOrthant:
=======================

  * "posOrthant(ZZ)"

For the programmer
==================

The object posOrthant, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3025:0.

proximum -- computes the proximum of the Polyhedron/Cone to a point in euclidean metric
***************************************************************************************

  * Usage:
        q = proximum(p,P)
        q = proximum(p,C)
  * Inputs:
      * p, a matrix (Macaulay2Doc),  over ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), with only one column
        representing a point
      * P, a convex polyhedron,
      * C, a convex rational cone,
  * Outputs:
      * q, a matrix (Macaulay2Doc),  over QQ (Macaulay2Doc),
        with only one column representing the closest point

Description
===========

For a point p and a Polyhedron P or a Cone C, proximum computes the point in P
or C with minimal euclidean distance to p.
+-----------------------------+
|i1 : P = crossPolytope 3     |
|                             |
|o1 = P                       |
|                             |
|o1 : Polyhedron              |
+-----------------------------+
|i2 : p = matrix {{1},{2},{3}}|
|                             |
|o2 = | 1 |                   |
|     | 2 |                   |
|     | 3 |                   |
|                             |
|              3       1      |
|o2 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i3 : q = proximum(p,P)       |
|                             |
|o3 = | 0 |                   |
|     | 0 |                   |
|     | 1 |                   |
|                             |
|              3       1      |
|o3 : Matrix QQ  <-- QQ       |
+-----------------------------+

Ways to use proximum:
=====================

  * "proximum(Matrix,Cone)"
  * "proximum(Matrix,Polyhedron)"

For the programmer
==================

The object proximum, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2046:0.

pyramid -- computes the pyramid over a polyhedron
*************************************************

  * Usage:
        Q = pyramid P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

pyramid takes the polyhedron P with ambient dimension n and embeds it into
QQ (Macaulay2Doc),^(n+1) on height 0 with respect to the new last
variable. Then it computes the convex hull of the embedded P and the point
(0,...,0,1).
+-----------------------+
|i1 : P = hypercube 2   |
|                       |
|o1 = P                 |
|                       |
|o1 : Polyhedron        |
+-----------------------+
|i2 : Q = pyramid P     |
|                       |
|o2 = Q                 |
|                       |
|o2 : Polyhedron        |
+-----------------------+
|i3 : vertices Q        |
|                       |
|o3 = | -1 1  -1 1 0 |  |
|     | -1 -1 1  1 0 |  |
|     | 0  0  0  0 1 |  |
|                       |
|              3       5|
|o3 : Matrix QQ  <-- QQ |
+-----------------------+

Ways to use pyramid:
====================

  * "pyramid(Polyhedron)"

For the programmer
==================

The object pyramid, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2822:0.

QQ * Polyhedron -- rescales a polyhedron by a given positive factor
*******************************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        Q = k * P
  * Inputs:
      * k, a rational number (Macaulay2Doc), ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), strictly positive
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

Rescales the Polyhedron, by the strictly positive factor k.
+------------------------+
|i1 : P = crossPolytope 3|
|                        |
|o1 = P                  |
|                        |
|o1 : Polyhedron         |
+------------------------+
|i2 : k = 3              |
|                        |
|o2 = 3                  |
+------------------------+
|i3 : Q = k * P          |
|                        |
|o3 = Q                  |
|                        |
|o3 : Polyhedron         |
+------------------------+
|i4 : vertices Q         |
|                        |
|o4 = | -3 3 0  0 0  0 | |
|     | 0  0 -3 3 0  0 | |
|     | 0  0 0  0 -3 3 | |
|                        |
|              3       6 |
|o4 : Matrix QQ  <-- QQ  |
+------------------------+

Ways to use this method:
========================

  * QQ * Polyhedron -- rescales a polyhedron by a
    given positive factor
  * "ZZ * Polyhedron"
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3279:0.

rays(PolyhedralObject) -- displays all rays of a Cone, a Fan, or a Polyhedron
*****************************************************************************

  * Function: rays (Macaulay2Doc),
  * Usage:
        R = rays F
        R = rays P
  * Inputs:
      * PO, an instance of the type PolyhedralObject,
  * Outputs:
      * R, a matrix (Macaulay2Doc),

Description
===========

rays returns the rays of the input as the columns of the matrix R.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.
+---------------------------------------------------------------------+
|i1 : P = convexHull(matrix {{1,-1,2,-2},{1,1,2,2}}, matrix {{0},{1}})|
|                                                                     |
|o1 = P                                                               |
|                                                                     |
|o1 : Polyhedron                                                      |
+---------------------------------------------------------------------+
|i2 : rays P                                                          |
|                                                                     |
|o2 = | 0 |                                                           |
|     | 1 |                                                           |
|                                                                     |
|              2       1                                              |
|o2 : Matrix QQ  <-- QQ                                               |
+---------------------------------------------------------------------+
|i3 : C = coneFromVData P                                             |
|                                                                     |
|o3 = C                                                               |
|                                                                     |
|o3 : Cone                                                            |
+---------------------------------------------------------------------+
|i4 : rays C                                                          |
|                                                                     |
|o4 = | -1 1 |                                                        |
|     | 1  1 |                                                        |
|                                                                     |
|              2       2                                              |
|o4 : Matrix ZZ  <-- ZZ                                               |
+---------------------------------------------------------------------+
|i5 : F = normalFan P                                                 |
|                                                                     |
|o5 = F                                                               |
|                                                                     |
|o5 : Fan                                                             |
+---------------------------------------------------------------------+
|i6 : rays F                                                          |
|                                                                     |
|o6 = | -1 1 0 -1 1 |                                                 |
|     | 0  0 1 1  1 |                                                 |
|                                                                     |
|              2       5                                              |
|o6 : Matrix ZZ  <-- ZZ                                               |
+---------------------------------------------------------------------+

Ways to use this method:
========================

  * rays(PolyhedralObject) -- displays all
    rays of a Cone, a Fan, or a Polyhedron
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1007:0.

regularSubdivision -- Computes the regular cell decomposition
*************************************************************

  * Usage:
        L = regularSubdivision(P,w)
        L = regularSubdivision(M,w)
  * Inputs:
      * P, a convex polyhedron,
      * w, a matrix (Macaulay2Doc), Row matrix containing the
        weights.
      * M, a matrix (Macaulay2Doc), Matrix containing the points.
  * Outputs:
      * L, a list (Macaulay2Doc), List of polyhedra or List of
        lists of indices indicated which points form a cell.

Description
===========

This function computes the regular subdivision of P given by the weight vector
w.      This is computed by placing the i-th lattice point of P on height w_i
in n+1 space, taking the convexHull of these with the ray (0,...,0,1), and
projecting the compact faces into n space. Note that the polyhedron must be
compact, i.e. a polytope and the length of the weight vector must be the number
of lattice points.

This function can also be used to compute the regular subdivision given a
matrix M of points and a weight vector w. The points are lifted to the weights
given by the matrix w, and the lower envelope is computed.

+-----------------------------------------------------------------------------+
|i1 : P = crossPolytope 3                                                     |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
+-----------------------------------------------------------------------------+
|i2 : w =  matrix {{1,2,2,2,2,2,1}}                                           |
|                                                                             |
|o2 = | 1 2 2 2 2 2 1 |                                                       |
|                                                                             |
|              1       7                                                      |
|o2 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i3 : L = regularSubdivision(P,w)                                             |
|                                                                             |
|o3 = {Polyhedron{...1...}, Polyhedron{...1...}, Polyhedron{...1...},         |
|     ------------------------------------------------------------------------|
|     Polyhedron{...1...}}                                                    |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : apply(L,vertices)                                                       |
|                                                                             |
|o4 = {| -1 1 0  0  |, | -1 1 0  0 |, | -1 1 0 0  |, | -1 1 0 0 |}            |
|      | 0  0 -1 0  |  | 0  0 -1 0 |  | 0  0 1 0  |  | 0  0 1 0 |             |
|      | 0  0 0  -1 |  | 0  0 0  1 |  | 0  0 0 -1 |  | 0  0 0 1 |             |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
+--------------------------------------+
|i5 : M = matrix {{1,0,1,0},{1,1,0,0}};|
|                                      |
|              2       4               |
|o5 : Matrix ZZ  <-- ZZ                |
+--------------------------------------+
|i6 : w = matrix {{1,0,0,1}};          |
|                                      |
|              1       4               |
|o6 : Matrix ZZ  <-- ZZ                |
+--------------------------------------+
|i7 : S = regularSubdivision (M,w)     |
|                                      |
|o7 = {{0, 1, 2}, {1, 2, 3}}           |
|                                      |
|o7 : List                             |
+--------------------------------------+

Ways to use regularSubdivision:
===============================

  * "regularSubdivision(Matrix,Matrix)"
  * "regularSubdivision(Polyhedron,Matrix)"

For the programmer
==================

The object regularSubdivision, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:376:0.

regularTriangulation -- Computes a regular triangulation of a given polytope.
*****************************************************************************

  * Usage:
        T = regularTriangulation P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * T, a list (Macaulay2Doc),

Description
===========

This method computes a regular triangulation of a polytope using the package
Topcom.m2. The output is a list of list of indices which vertices of P give a
simplex in the triangulation.

+-----------------------------------------+
|i1 : T = regularTriangulation hypercube 2|
|                                         |
|o1 = {{0, 1, 2}, {1, 2, 3}}              |
|                                         |
|o1 : List                                |
+-----------------------------------------+

Ways to use regularTriangulation:
=================================

  * "regularTriangulation(Polyhedron)"

For the programmer
==================

The object regularTriangulation, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:396:0.

saveSession -- save the actual Polyhedra session to a file
**********************************************************

  * Usage:
        saveSession F
  * Inputs:
      * F, a string (Macaulay2Doc),

Description
===========

All convex polyhedral objects (see Cone,Fan,
Polyhedron) that have been assigned to a Symbol (Macaulay2Doc),
will be saved into the file F. If the package PPDivisor
is loaded, then also all PolyhedralDivisors are saved into F. Also every
List (Macaulay2Doc), or Sequence (Macaulay2Doc), containing
any of the above types or lists and sequences of them in arbitrary nested depth
of lists is saved.

To recover the session simply call load F. It is not necessary that Polyhedra
is already loaded (if not, it will be) and also PPDivisor is loaded if it was
loaded when the session had been saved.

Ways to use saveSession:
========================

  * "saveSession(String)"

For the programmer
==================

The object saveSession, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3485:0.

secondaryPolytope -- computes the secondary polytope of a compact polyhedron
****************************************************************************

  * Usage:
        Q = secondaryPolytope P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * Q, a convex polyhedron,

Description
===========

The secondary polytope parametrises the regular subdivisions of a polytope. See
... to be added.
+----------------------------+
|i1 : P = crossPolytope 2    |
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : Q = secondaryPolytope P|
|                            |
|o2 = Q                      |
|                            |
|o2 : Polyhedron             |
+----------------------------+
|i3 : vertices Q             |
|                            |
|o3 = | 1/3 1/6 |            |
|     | 1/3 1/6 |            |
|     | 1/6 1/3 |            |
|     | 1/6 1/3 |            |
|                            |
|              4       2     |
|o3 : Matrix QQ  <-- QQ      |
+----------------------------+

Ways to use secondaryPolytope:
==============================

  * "secondaryPolytope(Polyhedron)"

For the programmer
==================

The object secondaryPolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3046:0.

simplex -- Produces a full-dimensional simplex
**********************************************

  * Usage:
        S = simplex d
        S = simplex(d, a)
  * Inputs:
      * d, an integer (Macaulay2Doc), The dimension
      * a, a rational number (Macaulay2Doc), The dilation factor
  * Outputs:
      * S, a convex polyhedron,

Description
===========

Returns the d-dimensional simplex that is the convex hull of the origin and the
unit vectors in QQ^d.

+---------------------+
|i1 : S = simplex 2   |
|                     |
|o1 = S               |
|                     |
|o1 : Polyhedron      |
+---------------------+
|i2 : S = simplex(2,2)|
|                     |
|o2 = S               |
|                     |
|o2 : Polyhedron      |
+---------------------+

Ways to use simplex:
====================

  * "simplex(ZZ)"
  * "simplex(ZZ,QQ)"
  * "simplex(ZZ,ZZ)"

For the programmer
==================

The object simplex, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:422:0.

skeleton -- computes the k-skeleton of a Fan or PolyhedralComplex
*****************************************************************

  * Usage:
        X = skeleton(k,F)
        X = skeleton(k,PC)
  * Inputs:
      * k, an integer (Macaulay2Doc),
      * F, an instance of the type Fan,
      * PC, an instance of the type PolyhedralComplex,
  * Outputs:
      * X, an instance of the type Fan, or an instance of the type
        PolyhedralComplex,

Description
===========

For a Fan, F and an integer k between 0 and the dimension of F,
skeleton computes the k-skeleton of the Fan, F, i.e. the Fan,
F1 generated by all cones of dimension k in F.

For example, we can look at the 2-skeleton of the fan of projective 3-space:
+--------------------------------------------------------------+
|i1 : P = convexHull matrix{{1,0,0,0},{0,1,0,0},{0,0,1,0}}     |
|                                                              |
|o1 = P                                                        |
|                                                              |
|o1 : Polyhedron                                               |
+--------------------------------------------------------------+
|i2 : F = normalFan P                                          |
|                                                              |
|o2 = F                                                        |
|                                                              |
|o2 : Fan                                                      |
+--------------------------------------------------------------+
|i3 : F1 = skeleton(2,F)                                       |
|                                                              |
|o3 = F1                                                       |
|                                                              |
|o3 : Fan                                                      |
+--------------------------------------------------------------+
|i4 : raysF = rays F                                           |
|                                                              |
|o4 = | 1 0 -1 0 |                                             |
|     | 0 1 -1 0 |                                             |
|     | 0 0 -1 1 |                                             |
|                                                              |
|              3       4                                       |
|o4 : Matrix ZZ  <-- ZZ                                        |
+--------------------------------------------------------------+
|i5 : apply(maxCones F1, mc -> raysF_mc)                       |
|                                                              |
|o5 = {| 1 0 |, | 1 -1 |, | 1 0 |, | 0 -1 |, | 0 0 |, | -1 0 |}|
|      | 0 1 |  | 0 -1 |  | 0 0 |  | 1 -1 |  | 1 0 |  | -1 0 | |
|      | 0 0 |  | 0 -1 |  | 0 1 |  | 0 -1 |  | 0 1 |  | -1 1 | |
|                                                              |
|o5 : List                                                     |
+--------------------------------------------------------------+

For a PolyhedralComplex, PC and an integer k between 0
and the dimension of PC, skeleton computes the k-skeleton of the
PolyhedralComplex, PC, i.e. the PolyhedralComplex,
PC1 generated by all polyhedra of dimension k in PC.
+-----------------------------------------------------------------------------+
|i6 : PC = polyhedralComplex hypercube 3                                      |
|                                                                             |
|o6 = PC                                                                      |
|                                                                             |
|o6 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+
|i7 : PC1 = skeleton(2,PC)                                                    |
|                                                                             |
|o7 = PC1                                                                     |
|                                                                             |
|o7 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+
|i8 : vertPC1 = vertices PC1                                                  |
|                                                                             |
|o8 = | -1 1  -1 1  -1 1  -1 1 |                                              |
|     | -1 -1 1  1  -1 -1 1  1 |                                              |
|     | -1 -1 -1 -1 1  1  1  1 |                                              |
|                                                                             |
|              3       8                                                      |
|o8 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+
|i9 : apply(maxPolyhedra PC1, mp -> vertPC1_(mp#0))                           |
|                                                                             |
|o9 = {| -1 1  |, | -1 -1 |, | -1 -1 |, | 1  1  |, | 1  1  |, | -1 1  |, | -1 |
|      | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 1  |  | -1 -1 |  | 1  1  |  | 1  |
|      | -1 -1 |  | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 1  |  | -1 -1 |  | -1 |
|     ------------------------------------------------------------------------|
|     -1 |, | 1  1 |, | -1 1  |, | -1 -1 |, | 1  1 |, | -1 1 |}               |
|     1  |  | 1  1 |  | -1 -1 |  | -1 1  |  | -1 1 |  | 1  1 |                |
|     1  |  | -1 1 |  | 1  1  |  | 1  1  |  | 1  1 |  | 1  1 |                |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use skeleton:
=====================

  * "skeleton(ZZ,Fan)"
  * "skeleton(ZZ,PolyhedralComplex)"

For the programmer
==================

The object skeleton, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2089:0.

smallestFace -- determines the smallest face of the Cone/Polyhedron containing a point
**************************************************************************************

  * Usage:
        C1 = smallestFace(p,C)
        P1 = smallestFace(p,P)
  * Inputs:
      * p, a matrix (Macaulay2Doc), over ZZ (Macaulay2Doc),
        or QQ (Macaulay2Doc), with only one column
        representing a point
      * C, a convex rational cone,
      * P, a convex polyhedron,
  * Outputs:
      * C1, a convex rational cone,  or
      * P1, a convex polyhedron,

Description
===========

p is considered to be a point in the ambient space of the second argument, so
the number of rows of p must equal the dimension of the ambient space of the
second argument. The function computes the smallest face of the second argument
that contains p. If the second argument is a Polyhedron, the
output is a Polyhedron, and if it is a Cone, the
output is a Cone. In both cases, if the point is not contained in
the second argument then the output is the empty polyhedron.
+-----------------------------+
|i1 : P = hypercube 3         |
|                             |
|o1 = P                       |
|                             |
|o1 : Polyhedron              |
+-----------------------------+
|i2 : p = matrix {{1},{0},{0}}|
|                             |
|o2 = | 1 |                   |
|     | 0 |                   |
|     | 0 |                   |
|                             |
|              3       1      |
|o2 : Matrix ZZ  <-- ZZ       |
+-----------------------------+
|i3 : smallestFace(p,P)       |
|                             |
|o3 = Polyhedron{...1...}     |
|                             |
|o3 : Polyhedron              |
+-----------------------------+

Ways to use smallestFace:
=========================

  * "smallestFace(Matrix,Cone)"
  * "smallestFace(Matrix,Polyhedron)"

For the programmer
==================

The object smallestFace, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2119:0.

smoothSubfan -- computes the subfan of all smooth cones
*******************************************************

  * Usage:
        F1 = smoothSubfan F
  * Inputs:
      * F, an instance of the type Fan,
  * Outputs:
      * F1, an instance of the type Fan,

Description
===========

 For a given Fan, F the function computes the subfan F1 of all
smooth cones.

Let's consider the fan consisting of the following three dimensional cone and
all of its faces:
+---------------------------------------------------------+
|i1 : C = coneFromVData  matrix {{1,-1,0},{1,1,0},{1,1,1}}|
|                                                         |
|o1 = C                                                   |
|                                                         |
|o1 : Cone                                                |
+---------------------------------------------------------+
|i2 : F = fan C                                           |
|                                                         |
|o2 = F                                                   |
|                                                         |
|o2 : Fan                                                 |
+---------------------------------------------------------+

This cone is not smooth, therefore also the fan is not. But if we remove the
interior and one of the two dimensional faces the resulting subfan is smooth.
+----------------------------------------+
|i3 : F1 = smoothSubfan F                |
|                                        |
|o3 = F1                                 |
|                                        |
|o3 : Fan                                |
+----------------------------------------+
|i4 : raysF1 = rays F1                   |
|                                        |
|o4 = | 0 -1 1 |                         |
|     | 0 1  1 |                         |
|     | 1 1  1 |                         |
|                                        |
|              3       3                 |
|o4 : Matrix ZZ  <-- ZZ                  |
+----------------------------------------+
|i5 : apply(maxCones F1, mc -> raysF1_mc)|
|                                        |
|o5 = {| 0 -1 |, | 0 1 |}                |
|      | 0 1  |  | 0 1 |                 |
|      | 1 1  |  | 1 1 |                 |
|                                        |
|o5 : List                               |
+----------------------------------------+

Ways to use smoothSubfan:
=========================

  * "smoothSubfan(Fan)"

For the programmer
==================

The object smoothSubfan, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2152:0.

stanleyReisnerRing
******************

Ways to use stanleyReisnerRing:
===============================

  * stanleyReisnerRing(Fan) -- Give the
    Stanley–Reisner ring of a fan.

For the programmer
==================

The object stanleyReisnerRing (missing documentation) is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in currentString:1:387.

stanleyReisnerRing(Fan) -- Give the Stanley–Reisner ring of a fan.
******************************************************************

  * Function: stanleyReisnerRing (missing documentation)
  * Usage:
        SR = stanleyReisnerRing Phi
  * Inputs:
      * Phi, an instance of the type Fan,
  * Outputs:
      * SR, a ring (Macaulay2Doc), The Stanley–Reisner Ring of Phi

Description
===========

Returns the Stanley–Reisner Ring of a fan, whose variables are indexed by the
rays.

+--------------------------------------------------+
|i1 : SR = stanleyReisnerRing normalFan hypercube 2|
|                                                  |
|o1 = SR                                           |
|                                                  |
|o1 : QuotientRing                                 |
+--------------------------------------------------+

Ways to use this method:
========================

  * stanleyReisnerRing(Fan) -- Give the
    Stanley–Reisner ring of a fan.
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/documentation.m2:72:0.

statePolytope -- computes the state polytope of a homogeneous ideal
*******************************************************************

  * Usage:
        P = statePolytope I
  * Inputs:
      * I, an ideal (Macaulay2Doc), which must be homogeneous
  * Outputs:
      * P, a convex polyhedron,

Description
===========

A statePolytope of an Ideal I has as normalFan the Groebner fan of the ideal.
We use the construction by Sturmfels, see Algorithm 3.2 in Bernd Sturmfels'
(see http://math.berkeley.edu/~bernd/index.html ) Groebner Bases and Convex
Polytopes, volume 8 of University Lecture Series. American Mathematical
Society, first edition, 1995.

Consider the following ideal in a ring with 3 variables:
+--------------------------------+
|i1 : R = QQ[a,b,c]              |
|                                |
|o1 = R                          |
|                                |
|o1 : PolynomialRing             |
+--------------------------------+
|i2 : I = ideal (a-b,a-c,b-c)    |
|                                |
|o2 = ideal (a - b, a - c, b - c)|
|                                |
|o2 : Ideal of R                 |
+--------------------------------+

The state polytope of this ideal is a triangle in 3 space, because the ideal
has three initial ideals:
+-------------------------------------------------------+
|i3 : statePolytope I                                   |
|                                                       |
|o3 = ({| b a |, | c b |, | c a |}, Polyhedron{...1...})|
|                                                       |
|o3 : Sequence                                          |
+-------------------------------------------------------+

The generators of the three initial ideals are given in the first part of the
result.

Ways to use statePolytope:
==========================

  * "statePolytope(Ideal)"

For the programmer
==================

The object statePolytope, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3081:0.

stdSimplex -- generates the d-dimensional standard simplex
**********************************************************

  * Usage:
        P = stdSimplex d
  * Inputs:
      * d, an integer (Macaulay2Doc), strictly positive
  * Outputs:
      * P, a convex polyhedron,

Description
===========

The d-dimensional standard simplex is the convex hull of the standard basis in
QQ (Macaulay2Doc),^(d+1).
+-----------------------+
|i1 : P = stdSimplex 2  |
|                       |
|o1 = P                 |
|                       |
|o1 : Polyhedron        |
+-----------------------+
|i2 : vertices P        |
|                       |
|o2 = | 1 0 0 |         |
|     | 0 1 0 |         |
|     | 0 0 1 |         |
|                       |
|              3       3|
|o2 : Matrix QQ  <-- QQ |
+-----------------------+

Ways to use stdSimplex:
=======================

  * "stdSimplex(ZZ)"

For the programmer
==================

The object stdSimplex, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:3102:0.

stellarSubdivision -- computes the stellar subdivision of the fan by a ray
**************************************************************************

  * Usage:
        F1 = stellarSubdivision(F,r)
  * Inputs:
      * F, an instance of the type Fan,
      * r, a matrix (Macaulay2Doc), with one column in the
        ambient space of the fan
  * Outputs:
      * F1, an instance of the type Fan,

Description
===========

This function computes the stellar subdivision of F by inserting the ray given
by r.
+---------------------------------+
|i1 : F = normalFan hypercube 2   |
|                                 |
|o1 = F                           |
|                                 |
|o1 : Fan                         |
+---------------------------------+
|i2 : r = matrix {{1},{1}}        |
|                                 |
|o2 = | 1 |                       |
|     | 1 |                       |
|                                 |
|              2       1          |
|o2 : Matrix ZZ  <-- ZZ           |
+---------------------------------+
|i3 : F1 = stellarSubdivision(F,r)|
|                                 |
|o3 = F1                          |
|                                 |
|o3 : Fan                         |
+---------------------------------+

Ways to use stellarSubdivision:
===============================

  * "stellarSubdivision(Fan,Matrix)"

For the programmer
==================

The object stellarSubdivision, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2174:0.

sublatticeBasis -- computes a basis for the sublattice generated by integral vectors or lattice points of a polytope
********************************************************************************************************************

  * Usage:
        B = sublatticeBasis M
        B = sublatticeBasis P
  * Inputs:
      * M, a matrix (Macaulay2Doc),  over ZZ (Macaulay2Doc),
        with each column representing a sublattice generator
      * P, a convex polyhedron,
  * Outputs:
      * B, A matrix over ZZ (Macaulay2Doc), containing a sublattice
        basis

Description
===========

sublatticeBasis computes a basis for the sublattice generated by the columns
ofM or by the lattice points ofP.
+----------------------------------------------------------------------+
|i1 : P = convexHull transpose matrix {{0,0,0},{1,0,0},{0,1,0},{1,1,3}}|
|                                                                      |
|o1 = P                                                                |
|                                                                      |
|o1 : Polyhedron                                                       |
+----------------------------------------------------------------------+
|i2 : sublatticeBasis P                                                |
|                                                                      |
|o2 = | 0 1 1 |                                                        |
|     | 1 0 1 |                                                        |
|     | 0 0 3 |                                                        |
|                                                                      |
|              3       3                                               |
|o2 : Matrix ZZ  <-- ZZ                                                |
+----------------------------------------------------------------------+

Ways to use sublatticeBasis:
============================

  * "sublatticeBasis(Matrix)"
  * "sublatticeBasis(Polyhedron)"

For the programmer
==================

The object sublatticeBasis, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2843:0.

tailCone -- computes the tail/recession cone of a polyhedron
************************************************************

  * Usage:
        C = tailCone P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * C, a convex rational cone,

Description
===========

Every polyhedron P can be uniquely decomposed into the sum of a polytope and a
cone, the tail or recession cone of P. Thus, it is the cone generated by the
non-compact part, i.e. the rays and the lineality space of P. If P is a
polytope then the tail cone is the origin in the ambient space of P.
+-----------------------------------------------------------------------------+
|i1 : P = polyhedronFromHData(matrix{{-1,0},{1,0},{0,-1},{-1,-1},{1,-1}},     |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|matrix{{2},{2},{-1},{0},{0}})                                                |
+-----------------------------------------------------------------------------+
|i2 : C = tailCone P                                                          |
|                                                                             |
|o2 = C                                                                       |
|                                                                             |
|o2 : Cone                                                                    |
+-----------------------------------------------------------------------------+
|i3 : rays C                                                                  |
|                                                                             |
|o3 = | 0 |                                                                   |
|     | 1 |                                                                   |
|                                                                             |
|              2       1                                                      |
|o3 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+

Ways to use tailCone:
=====================

  * "tailCone(Polyhedron)"

For the programmer
==================

The object tailCone, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2199:0.

toSublattice -- calculates the preimage of a polytope in the sublattice generated by its lattice points
*******************************************************************************************************

  * Usage:
        Q = toSublattice P
  * Inputs:
      * P, a convex polyhedron, which must be compact
  * Outputs:
      * Q, a convex polyhedron, preimage of P in the
        sublattice generated by its lattice points

Description
===========

toSublattice can only be applied to polytopes, i.e. compact polyhedra. It
calculates a basis of the sublattice generated by its lattice points, and then
takes the affine preimage under the corresponding map.
+----------------------------------------------------------------------+
|i1 : P = convexHull transpose matrix {{0,0,0},{1,0,0},{0,1,0},{1,1,3}}|
|                                                                      |
|o1 = P                                                                |
|                                                                      |
|o1 : Polyhedron                                                       |
+----------------------------------------------------------------------+
|i2 : toSublattice P                                                   |
|                                                                      |
|o2 = Polyhedron{...1...}                                              |
|                                                                      |
|o2 : Polyhedron                                                       |
+----------------------------------------------------------------------+

Ways to use toSublattice:
=========================

  * "toSublattice(Polyhedron)"

For the programmer
==================

The object toSublattice, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2865:0.

triangulate -- Deprecated name for {\tt barycentricTriangulation}
*****************************************************************

Ways to use triangulate:
========================

  * "triangulate(Polyhedron)"

For the programmer
==================

The object triangulate, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/deprecated_documentation.m2:31:0.

V- and H-representation
***********************

Short summary and conventions

Both cones and polyhedra can be described either by giving generators, the
so-called V-representation or by giving inequalities, the so-called
H-representation. We have the following conventions:

1. Rays, vertices, and generators of the lineality space are given as columns
of matrices.

2. Inequalities and hyperplanes are given as rows of matrices.

3. The inequality description of a cone is $A\cdot x\ge 0$.

4. The inequality description of a polyhedron is $A\cdot x\le b$.

Conventions for cones

For cones we have the convention that the scalar product of generators with
inequalities is positive:

+---------------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,0,0},{1,1,0},{1,0,1},{1,1,1}}|
|                                                               |
|o1 = C                                                         |
|                                                               |
|o1 : Cone                                                      |
+---------------------------------------------------------------+
|i2 : rays C                                                    |
|                                                               |
|o2 = | 0 0 1 |                                                 |
|     | 1 0 1 |                                                 |
|     | 0 1 1 |                                                 |
|     | 1 1 1 |                                                 |
|                                                               |
|              4       3                                        |
|o2 : Matrix ZZ  <-- ZZ                                         |
+---------------------------------------------------------------+
|i3 : facets C                                                  |
|                                                               |
|o3 = | 0 -1 0  1  |                                            |
|     | 0 0  -1 1  |                                            |
|     | 0 1  1  -1 |                                            |
|                                                               |
|              3       4                                        |
|o3 : Matrix ZZ  <-- ZZ                                         |
+---------------------------------------------------------------+
|i4 : (facets C) * (rays C)                                     |
|                                                               |
|o4 = | 0 1 0 |                                                 |
|     | 1 0 0 |                                                 |
|     | 0 0 1 |                                                 |
|                                                               |
|              3       3                                        |
|o4 : Matrix ZZ  <-- ZZ                                         |
+---------------------------------------------------------------+

The hyperplanes, of a cone evaluate to zero with the
rays (Macaulay2Doc), of a cone, just like the linealitySpace,
evaluates to zero with the facets.

+------------------------------------+
|i5 : (hyperplanes C) * (rays C)     |
|                                    |
|o5 = 0                              |
|                                    |
|              1       3             |
|o5 : Matrix ZZ  <-- ZZ              |
+------------------------------------+
|i6 : (facets C) * (linealitySpace C)|
|                                    |
|o6 = 0                              |
|                                    |
|              3                     |
|o6 : Matrix ZZ  <-- 0               |
+------------------------------------+

Conventions for polyhedra

For a polyhedron the situation is slightly different, as we have a right hand
side to take into account, since we are dealing with affine hyperplanes instead
of just hyperplanes.

+-------------------------+
|i7 : P = hypercube(2,0,1)|
|                         |
|o7 = P                   |
|                         |
|o7 : Polyhedron          |
+-------------------------+
|i8 : V = vertices P      |
|                         |
|o8 = | 0 1 0 1 |         |
|     | 0 0 1 1 |         |
|                         |
|              2       4  |
|o8 : Matrix QQ  <-- QQ   |
+-------------------------+
|i9 : (A, b) = facets P   |
|                         |
|o9 = (| -1 0  |, | 0 |)  |
|      | 1  0  |  | 1 |   |
|      | 0  -1 |  | 0 |   |
|      | 0  1  |  | 1 |   |
|                         |
|o9 : Sequence            |
+-------------------------+
|i10 : A * V              |
|                         |
|o10 = | 0 -1 0  -1 |     |
|      | 0 1  0  1  |     |
|      | 0 0  -1 -1 |     |
|      | 0 0  1  1  |     |
|                         |
|               4       4 |
|o10 : Matrix QQ  <-- QQ  |
+-------------------------+

The convention is that for any point $p$ in the polyhedron we have $A\cdot p\le
b$. This means we have $0\le b - A\cdot p$. Again, this may be handled
differently elsewhere.

+-----------------------------------------------------------------------------+
|i11 : for i from 0 to numColumns V - 1 do (                                  |
|            test := b - A*V_{i};                                             |
|            << "Vertex " << i << " " << (flatten entries V_{i}) << ": " <<   |
|         )                                                                   |
|Vertex 0 {0, 0}: true                                                        |
|Vertex 1 {1, 0}: true                                                        |
|Vertex 2 {0, 1}: true                                                        |
|Vertex 3 {1, 1}: true                                                        |
|-----------------------------------------------------------------------------|
|all(flatten entries test, e -> e>= 0) << endl;                               |
+-----------------------------------------------------------------------------+

From the above convention it follows that the facets, evaluate
negatively with the rays (Macaulay2Doc), and linealitySpace,
of a polyhedron. Conversely to hyperplanes,
evaluate to constants on the vertices, of a polyhedron.

+---------------------------------------------------------------------+
|i12 : P = convexHull(matrix{{1,0},{0,1},{2,2}}, matrix {{1},{1},{2}})|
|                                                                     |
|o12 = P                                                              |
|                                                                     |
|o12 : Polyhedron                                                     |
+---------------------------------------------------------------------+
|i13 : vertices P                                                     |
|                                                                     |
|o13 = | 1 0 |                                                        |
|      | 0 1 |                                                        |
|      | 2 2 |                                                        |
|                                                                     |
|               3       2                                             |
|o13 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+
|i14 : rays P                                                         |
|                                                                     |
|o14 = | 1 |                                                          |
|      | 1 |                                                          |
|      | 2 |                                                          |
|                                                                     |
|               3       1                                             |
|o14 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+
|i15 : (A, b) = facets P                                              |
|                                                                     |
|o15 = (| 2  0  -1 |, 0)                                              |
|       | 0  2  -1 |                                                  |
|       | -2 -2 1  |                                                  |
|                                                                     |
|o15 : Sequence                                                       |
+---------------------------------------------------------------------+
|i16 : A * (vertices P)                                               |
|                                                                     |
|o16 = | 0  -2 |                                                      |
|      | -2 0  |                                                      |
|      | 0  0  |                                                      |
|                                                                     |
|               3       2                                             |
|o16 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+
|i17 : A * (rays P)                                                   |
|                                                                     |
|o17 = | 0  |                                                         |
|      | 0  |                                                         |
|      | -2 |                                                         |
|                                                                     |
|               3       1                                             |
|o17 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+
|i18 : (E, v) = hyperplanes P                                         |
|                                                                     |
|o18 = (| 1 1 -1 |, | -1 |)                                           |
|                                                                     |
|o18 : Sequence                                                       |
+---------------------------------------------------------------------+
|i19 : E * (rays P)                                                   |
|                                                                     |
|o19 = 0                                                              |
|                                                                     |
|               1       1                                             |
|o19 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+
|i20 : E * (vertices P)                                               |
|                                                                     |
|o20 = | -1 -1 |                                                      |
|                                                                     |
|               1       2                                             |
|o20 : Matrix QQ  <-- QQ                                              |
+---------------------------------------------------------------------+

Full representations

1. The pair (see rays (Macaulay2Doc), linealitySpace)
is a valid V-representation of a cone.

2. The pair (see facets, hyperplanes) is a valid
H-representation of a cone.

3. The triple (see vertices, rays (Macaulay2Doc),
linealitySpace) is a valid V-representation of a
polyhedron.

4. The triple (see facets, hyperplanes) is a
valid H-representation of a polyhedron.

That means we have the following identities:

+------------------------------------------------------------+
|i21 : C == coneFromVData(rays C, linealitySpace C)          |
|                                                            |
|o21 = true                                                  |
+------------------------------------------------------------+
|i22 : C == coneFromRays(rays C, linealitySpace C)           |
|                                                            |
|o22 = true                                                  |
+------------------------------------------------------------+
|i23 : C == coneFromHData(facets C, hyperplanes C)           |
|                                                            |
|o23 = true                                                  |
+------------------------------------------------------------+
|i24 : C == coneFromInequalities(facets C, hyperplanes C)    |
|                                                            |
|o24 = true                                                  |
+------------------------------------------------------------+
|i25 : P == convexHull (vertices P, rays P, linealitySpace P)|
|                                                            |
|o25 = true                                                  |
+------------------------------------------------------------+
|i26 : F = facets P                                          |
|                                                            |
|o26 = (| 2  0  -1 |, 0)                                     |
|       | 0  2  -1 |                                         |
|       | -2 -2 1  |                                         |
|                                                            |
|o26 : Sequence                                              |
+------------------------------------------------------------+
|i27 : H = hyperplanes P                                     |
|                                                            |
|o27 = (| 1 1 -1 |, | -1 |)                                  |
|                                                            |
|o27 : Sequence                                              |
+------------------------------------------------------------+
|i28 : P == polyhedronFromHData(F#0, F#1, H#0, H#1)          |
|                                                            |
|o28 = true                                                  |
+------------------------------------------------------------+
|i29 : P == polyhedronFromInequalities(F#0, F#1, H#0, H#1)   |
|                                                            |
|o29 = true                                                  |
+------------------------------------------------------------+

See also
========

  * coneFromVData -- computes the positive hull of rays,
    cones, and the cone over a polyhedron
  * coneFromHData -- Constructing a polyhedral cone as
    intersection of halfspaces.
  * convexHull -- computing the convex hull of points, rays
    and polyhedra
  * polyhedronFromHData -- Constructing a
    polyhedron from its H-representation, i.e. inequalities and equations
  * facets -- Giving the facet inequalities of a cone or
    polyhedron.
  * hyperplanes -- computes the defining hyperplanes of a
    Cone or a Polyhedron
  * linealitySpace -- computes a basis of the lineality
    space
  * rays(PolyhedralObject) -- displays all
    rays of a Cone, a Fan, or a Polyhedron
  * vertices -- displays the vertices of a Polyhedron or a
    PolyhedralComplex
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/v_h_representation.m2:119:0.

vertexEdgeMatrix -- computes the vertex-edge-relations matrix
*************************************************************

  * Usage:
        M = vertexEdgeMatrix P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * M, a matrix (Macaulay2Doc),

Description
===========

vertexEdgeMatrix computes the matrix M where the columns are indexed by the
edges and the rows are indexed by the vertices of P and has 1 as an entry if
the corresponding edge contains this vertex and 0 otherwise.
+----------------------------+
|i1 : P = cyclicPolytope(3,5)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : vertexEdgeMatrix P     |
|                            |
|o2 = | 0 1 2 3 4 5 6 7 8 9 ||
|     | 1 1 0 1 1 0 0 1 0 0 ||
|     | 2 0 1 1 0 0 0 0 0 1 ||
|     | 3 1 1 0 0 1 0 0 1 0 ||
|     | 4 0 0 0 1 1 1 0 0 0 ||
|     | 5 0 0 0 0 0 1 1 1 1 ||
|                            |
|              6       10    |
|o2 : Matrix ZZ  <-- ZZ      |
+----------------------------+

Ways to use vertexEdgeMatrix:
=============================

  * "vertexEdgeMatrix(Polyhedron)"

For the programmer
==================

The object vertexEdgeMatrix, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2266:0.

vertexFacetMatrix -- computes the vertex-facet-relations matrix
***************************************************************

  * Usage:
        M = vertexFacetMatrix P
  * Inputs:
      * P, a convex polyhedron,
  * Outputs:
      * M, a matrix (Macaulay2Doc),

Description
===========

vertexFacetMatrix computes the matrix M where the columns are indexed by the
facets and the rows are indexed by the vertices of P and has 1 as an entry if
the corresponding facet contains this vertex and 0 otherwise.
+----------------------------+
|i1 : P = cyclicPolytope(3,5)|
|                            |
|o1 = P                      |
|                            |
|o1 : Polyhedron             |
+----------------------------+
|i2 : vertexFacetMatrix P    |
|                            |
|o2 = | 0 1 2 3 4 5 6 |      |
|     | 1 1 1 1 0 0 1 |      |
|     | 2 1 0 0 0 1 1 |      |
|     | 3 1 1 0 1 1 0 |      |
|     | 4 0 1 1 1 0 0 |      |
|     | 5 0 0 1 1 1 1 |      |
|                            |
|              6       7     |
|o2 : Matrix ZZ  <-- ZZ      |
+----------------------------+

Ways to use vertexFacetMatrix:
==============================

  * "vertexFacetMatrix(Polyhedron)"

For the programmer
==================

The object vertexFacetMatrix, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2288:0.

vertices -- displays the vertices of a Polyhedron or a PolyhedralComplex
************************************************************************

  * Usage:
        V = vertices P
  * Inputs:
      * P, a convex polyhedron, or an instance of the type
        PolyhedralComplex,
  * Outputs:
      * V, a matrix (Macaulay2Doc),

Description
===========

vertices returns the vertices of the Polyhedron or PolyhedralComplex P as the
columns of the Matrix V.

Please see V- and H-representation, on the
conventions we use for cones and polyhedra.
+-----------------------------------------------------------------------------+
|i1 : P = polyhedronFromHData(matrix{{1,-1},{0,-1},{-1,-1},{0,1}},            |
|                                                                             |
|o1 = P                                                                       |
|                                                                             |
|o1 : Polyhedron                                                              |
|-----------------------------------------------------------------------------|
|matrix{{0},{-1},{0},{1}})                                                    |
+-----------------------------------------------------------------------------+
|i2 : vertices P                                                              |
|                                                                             |
|o2 = | -1 1 |                                                                |
|     | 1  1 |                                                                |
|                                                                             |
|              2       2                                                      |
|o2 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+
|i3 : PC = skeleton(2,polyhedralComplex hypercube 3)                          |
|                                                                             |
|o3 = PC                                                                      |
|                                                                             |
|o3 : PolyhedralComplex                                                       |
+-----------------------------------------------------------------------------+
|i4 : vertices PC                                                             |
|                                                                             |
|o4 = | -1 1  -1 1  -1 1  -1 1 |                                              |
|     | -1 -1 1  1  -1 -1 1  1 |                                              |
|     | -1 -1 -1 -1 1  1  1  1 |                                              |
|                                                                             |
|              3       8                                                      |
|o4 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+

Ways to use vertices:
=====================

  * "vertices(PolyhedralComplex)"
  * "vertices(Polyhedron)"

For the programmer
==================

The object vertices, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:1033:0.

volume -- computes the volume of a polytope
*******************************************

  * Usage:
        v = volume P
  * Inputs:
      * P, a convex polyhedron, , which must be compact
  * Outputs:
      * v, a rational number (Macaulay2Doc),

Description
===========

volume computes the volume of a polytope. To do this, it triangulates the
polytope first. The volume of a simplex is |det(v_1-v_0,..,v_n-v_0)|/n!, where
v_0,..,v_n are the vertices of the simplex.
+------------------------+
|i1 : P = crossPolytope 3|
|                        |
|o1 = P                  |
|                        |
|o1 : Polyhedron         |
+------------------------+
|i2 : volume P           |
|                        |
|     4                  |
|o2 = -                  |
|     3                  |
|                        |
|o2 : QQ                 |
+------------------------+

Ways to use volume:
===================

  * "volume(Polyhedron)"

For the programmer
==================

The object volume, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:2244:0.

Working with cones
******************

Every cone can be described via generating rays or via inequalities. The
description via rays (or vertices for polyhedra) is often referred to as the
V-representation. The description via inequalities is called the
H-representation. To create a cone in 2-space which is the positive hull of a
given set of rays use coneFromVData,:

+---------------------------------+
|i1 : R = matrix {{1,1,2},{2,1,1}}|
|                                 |
|o1 = | 1 1 2 |                   |
|     | 2 1 1 |                   |
|                                 |
|              2       3          |
|o1 : Matrix ZZ  <-- ZZ           |
+---------------------------------+
|i2 : C = coneFromVData R         |
|                                 |
|o2 = C                           |
|                                 |
|o2 : Cone                        |
+---------------------------------+
|i3 : ambDim C                    |
|                                 |
|o3 = 2                           |
+---------------------------------+

After creating the cone, one can use rays (Macaulay2Doc), to ask for
its minimal rays.

+-----------------------+
|i4 : rays C            |
|                       |
|o4 = | 2 1 |           |
|     | 1 2 |           |
|                       |
|              2       2|
|o4 : Matrix ZZ  <-- ZZ |
+-----------------------+

We see that (1,1) is not an extremal ray of the cone.

+------------------------+
|i5 : HS = facets C      |
|                        |
|o5 = | -1 2  |          |
|     | 2  -1 |          |
|                        |
|              2       2 |
|o5 : Matrix ZZ  <-- ZZ  |
+------------------------+
|i6 : hyperplanes C      |
|                        |
|o6 = 0                  |
|                        |
|                    2   |
|o6 : Matrix 0 <-- ZZ    |
+------------------------+
|i7 : isFullDimensional C|
|                        |
|o7 = true               |
+------------------------+

The function facets, gives the defining linear half-spaces, the
H-representation, i.e.  C is given by all p in the defining linear hyperplanes
that satisfy HS*p >= 0. In this case there are no hyperplanes, so the cone is
of full dimension. The rows of the matrix HS are the inner normals of the cone.
Furthermore, we can construct the positive hull of a set of rays and a linear
subspace.

+-------------------------------+
|i8 : R1 = R || matrix {{0,0,0}}|
|                               |
|o8 = | 1 1 2 |                 |
|     | 2 1 1 |                 |
|     | 0 0 0 |                 |
|                               |
|              3       3        |
|o8 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i9 : LS = matrix {{1},{1},{1}} |
|                               |
|o9 = | 1 |                     |
|     | 1 |                     |
|     | 1 |                     |
|                               |
|              3       1        |
|o9 : Matrix ZZ  <-- ZZ         |
+-------------------------------+
|i10 : C1 = coneFromVData(R1,LS)|
|                               |
|o10 = C1                       |
|                               |
|o10 : Cone                     |
+-------------------------------+
|i11 : rays C1                  |
|                               |
|o11 = | 0  0  |                |
|      | -1 1  |                |
|      | -2 -1 |                |
|                               |
|               3       2       |
|o11 : Matrix ZZ  <-- ZZ        |
+-------------------------------+

Note that the rays are given modulo the lineality space. On the other hand we
can construct cones as the intersection of linear half-spaces and hyperplanes.
The first argument of coneFromHData, takes the
inequalities defining the cone, while the second takes equations.

+--------------------------------------+
|i12 : HS = transpose R1               |
|                                      |
|o12 = | 1 2 0 |                       |
|      | 1 1 0 |                       |
|      | 2 1 0 |                       |
|                                      |
|               3       3              |
|o12 : Matrix ZZ  <-- ZZ               |
+--------------------------------------+
|i13 : equations = matrix {{1,1,1}}    |
|                                      |
|o13 = | 1 1 1 |                       |
|                                      |
|               1       3              |
|o13 : Matrix ZZ  <-- ZZ               |
+--------------------------------------+
|i14 : C2 = coneFromHData(HS,equations)|
|                                      |
|o14 = C2                              |
|                                      |
|o14 : Cone                            |
+--------------------------------------+
|i15 : dim C2                          |
|                                      |
|o15 = 2                               |
+--------------------------------------+
|i16 : ambDim C2                       |
|                                      |
|o16 = 3                               |
+--------------------------------------+

This is a two dimensional cone in 3-space with the following rays:

+------------------------+
|i17 : rays C2           |
|                        |
|o17 = | 2  -1 |         |
|      | -1 2  |         |
|      | -1 -1 |         |
|                        |
|               3       2|
|o17 : Matrix ZZ  <-- ZZ |
+------------------------+

If we don't intersect with the hyperplane we get a full dimensional cone.

+---------------------------+
|i18 : C3 = coneFromHData HS|
|                           |
|o18 = C3                   |
|                           |
|o18 : Cone                 |
+---------------------------+
|i19 : rays C3              |
|                           |
|o19 = | 2  -1 |            |
|      | -1 2  |            |
|      | 0  0  |            |
|                           |
|               3       2   |
|o19 : Matrix ZZ  <-- ZZ    |
+---------------------------+
|i20 : linealitySpace C3    |
|                           |
|o20 = | 0 |                |
|      | 0 |                |
|      | 1 |                |
|                           |
|               3       1   |
|o20 : Matrix ZZ  <-- ZZ    |
+---------------------------+
|i21 : isFullDimensional C3 |
|                           |
|o21 = true                 |
+---------------------------+

Again, the rays are given modulo the lineality space. Also, one can use given
cones, for example the positive orthant (see posOrthant):

+------------------------+
|i22 : C4 = posOrthant 3 |
|                        |
|o22 = C4                |
|                        |
|o22 : Cone              |
+------------------------+
|i23 : rays C4           |
|                        |
|o23 = | 1 0 0 |         |
|      | 0 1 0 |         |
|      | 0 0 1 |         |
|                        |
|               3       3|
|o23 : Matrix ZZ  <-- ZZ |
+------------------------+

Now that we can construct cones, we can turn to the functions that can be
applied to cones. First of all, we can apply the intersect (Macaulay2Doc),
function also to a pair of cones in the same ambient
space:

+------------------------------+
|i24 : C5 = intersection(C1,C2)|
|                              |
|o24 = C5                      |
|                              |
|o24 : Cone                    |
+------------------------------+
|i25 : rays C5                 |
|                              |
|o25 = | 1  0  |               |
|      | 0  1  |               |
|      | -1 -1 |               |
|                              |
|               3       2      |
|o25 : Matrix ZZ  <-- ZZ       |
+------------------------------+
|i26 : dim C5                  |
|                              |
|o26 = 2                       |
+------------------------------+

On the other hand, we can take their positive hull by using
coneFromVData,:

+-------------------------------+
|i27 : C6 = coneFromVData(C1,C2)|
|                               |
|o27 = C6                       |
|                               |
|o27 : Cone                     |
+-------------------------------+
|i28 : rays C6                  |
|                               |
|o28 = | 0 0  |                 |
|      | 1 -1 |                 |
|      | 0 -1 |                 |
|                               |
|               3       2       |
|o28 : Matrix ZZ  <-- ZZ        |
+-------------------------------+
|i29 : linealitySpace C6        |
|                               |
|o29 = | 1 |                    |
|      | 1 |                    |
|      | 1 |                    |
|                               |
|               3       1       |
|o29 : Matrix ZZ  <-- ZZ        |
+-------------------------------+

Furthermore, both functions (see coneFromHData, and
coneFromVData) can be applied to a list containing any number
of cones and matrices defining rays and lineality space or linear half-spaces
and hyperplanes. These must be in the same ambient space. For example:

+-----------------------------------------+
|i30 : R2 = matrix {{2,-1},{-1,2},{-1,-1}}|
|                                         |
|o30 = | 2  -1 |                          |
|      | -1 2  |                          |
|      | -1 -1 |                          |
|                                         |
|               3       2                 |
|o30 : Matrix ZZ  <-- ZZ                  |
+-----------------------------------------+
|i31 : C7 = coneFromVData {R2,C3,C4}      |
|                                         |
|o31 = C7                                 |
|                                         |
|o31 : Cone                               |
+-----------------------------------------+
|i32 : rays C7                            |
|                                         |
|o32 = | 2  -1 |                          |
|      | -1 2  |                          |
|      | 0  0  |                          |
|                                         |
|               3       2                 |
|o32 : Matrix ZZ  <-- ZZ                  |
+-----------------------------------------+
|i33 : linealitySpace C7                  |
|                                         |
|o33 = | 0 |                              |
|      | 0 |                              |
|      | 1 |                              |
|                                         |
|               3       1                 |
|o33 : Matrix ZZ  <-- ZZ                  |
+-----------------------------------------+

Taking the positive hull of several cones is the same as taking their Minkowski
sum, so in fact:

+-------------------+
|i34 : C6 == C1 + C2|
|                   |
|o34 = true         |
+-------------------+

We can also take the Minkowski sum of a cone and a polyhedron. For this, both
objects must lie in the same ambient space and the resulting object is then a
polyhedron:

+---------------------------+
|i35 : P = crossPolytope 3  |
|                           |
|o35 = P                    |
|                           |
|o35 : Polyhedron           |
+---------------------------+
|i36 : P1 = C6 + P          |
|                           |
|o36 = P1                   |
|                           |
|o36 : Polyhedron           |
+---------------------------+
|i37 : (vertices P1,rays P1)|
|                           |
|o37 = (| 0 |, | 0 0  |)    |
|       | 0 |  | 1 -1 |     |
|       | 1 |  | 0 -1 |     |
|                           |
|o37 : Sequence             |
+---------------------------+

Furthermore, we can take the direct product (see directProduct(Cone,Cone))
of two cones.

+------------------------+
|i38 : C8 = C * C1       |
|                        |
|o38 = C8                |
|                        |
|o38 : Cone              |
+------------------------+
|i39 : rays C8           |
|                        |
|o39 = | 2 1 0  0  |     |
|      | 1 2 0  0  |     |
|      | 0 0 0  0  |     |
|      | 0 0 -1 1  |     |
|      | 0 0 -2 -1 |     |
|                        |
|               5       4|
|o39 : Matrix ZZ  <-- ZZ |
+------------------------+
|i40 : linealitySpace C8 |
|                        |
|o40 = | 0 |             |
|      | 0 |             |
|      | 1 |             |
|      | 1 |             |
|      | 1 |             |
|                        |
|               5       1|
|o40 : Matrix ZZ  <-- ZZ |
+------------------------+
|i41 : ambDim C8         |
|                        |
|o41 = 5                 |
+------------------------+

The result is contained in ${\mathbb Q}^5$.

+---------------+
|i42 : ambDim C8|
|               |
|o42 = 5        |
+---------------+

To find out more about this cone use for example fVector,:

+------------------------+
|i43 : fVector C8        |
|                        |
|o43 = {0, 1, 4, 6, 4, 1}|
|                        |
|o43 : List              |
+------------------------+

This function gives the number of faces of each dimension, so it has 1 vertex,
the origin, 1 line, 4 two dimensional faces and so on. We can access the faces
of a certain codimension via faces. The output of faces,
is a list of list of indices that indicate which rays form a face. The
following shows how to get the corresponding rays of the faces.

+--------------------------------------------------------+
|i44 : L = faces(1,C8)                                   |
|                                                        |
|o44 = {{0, 2, 3}, {1, 2, 3}, {0, 1, 2}, {0, 1, 3}}      |
|                                                        |
|o44 : List                                              |
+--------------------------------------------------------+
|i45 : raysC8 = rays C8                                  |
|                                                        |
|o45 = | 2 1 0  0  |                                     |
|      | 1 2 0  0  |                                     |
|      | 0 0 0  0  |                                     |
|      | 0 0 -1 1  |                                     |
|      | 0 0 -2 -1 |                                     |
|                                                        |
|               5       4                                |
|o45 : Matrix ZZ  <-- ZZ                                 |
+--------------------------------------------------------+
|i46 : apply(L, l -> raysC8_l)                           |
|                                                        |
|o46 = {| 2 0  0  |, | 1 0  0  |, | 2 1 0  |, | 2 1 0  |}|
|       | 1 0  0  |  | 2 0  0  |  | 1 2 0  |  | 1 2 0  | |
|       | 0 0  0  |  | 0 0  0  |  | 0 0 0  |  | 0 0 0  | |
|       | 0 -1 1  |  | 0 -1 1  |  | 0 0 -1 |  | 0 0 1  | |
|       | 0 -2 -1 |  | 0 -2 -1 |  | 0 0 -2 |  | 0 0 -1 | |
|                                                        |
|o46 : List                                              |
+--------------------------------------------------------+

We can also check if the cone is smooth:

+-----------------+
|i47 : isSmooth C8|
|                 |
|o47 = false      |
+-----------------+

Finally, there is also a function to compute the dual cone, i.e.  the set of
all points in the dual space that are positive on the cone.

+------------------------+
|i48 : C9 = dualCone C8  |
|                        |
|o48 = C9                |
|                        |
|o48 : Cone              |
+------------------------+
|i49 : rays C9           |
|                        |
|o49 = | -1 2  0  0  |   |
|      | 2  -1 0  0  |   |
|      | 0  0  -1 2  |   |
|      | 0  0  2  -1 |   |
|      | 0  0  -1 -1 |   |
|                        |
|               5       4|
|o49 : Matrix ZZ  <-- ZZ |
+------------------------+
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/working_with_cones.m2:182:0.

Working with fans
*****************

We start by constructing a fan, which consists of a single cone and all of its
faces:
+-------------------------------------------------------+
|i1 : C = coneFromVData matrix {{1,0,0},{0,1,0},{0,0,1}}|
|                                                       |
|o1 = C                                                 |
|                                                       |
|o1 : Cone                                              |
+-------------------------------------------------------+
|i2 : F = fan C                                         |
|                                                       |
|o2 = F                                                 |
|                                                       |
|o2 : Fan                                               |
+-------------------------------------------------------+

By this, we have already constructed the fan consisting of the positive orthant
and all of its faces. The package saves the generating cones of the fan, which
can be accessed by:
+----------------+
|i3 : maxCones F |
|                |
|o3 = {{0, 1, 2}}|
|                |
|o3 : List       |
+----------------+

Now we could expand the fan by adding more cones, for example the following:
+---------------------------------------------------------+
|i4 : C1 = coneFromVData matrix {{1,0,0},{1,1,0},{0,0,-1}}|
|                                                         |
|o4 = C1                                                  |
|                                                         |
|o4 : Cone                                                |
+---------------------------------------------------------+

But in this case we can not, because the two cones are not compatible, i.e.
their intersection is not a face of each. So, when one tries to add a cone to a
fan that is not compatible with one of the generating cones of the fan, the
function addCone, gives an error. For two cones one can check if
their intersection is a common face by using commonFace,:
+---------------------+
|i5 : commonFace(C,C1)|
|                     |
|o5 = false           |
+---------------------+

Since the intersection of both is already computed in this function there is a
different function, which also returns the intersection, to save computation
time when one needs the intersection afterward anyway:
+---------------------------------+
|i6 : (b,C2) = areCompatible(C,C1)|
|                                 |
|o6 = (false, C2)                 |
|                                 |
|o6 : Sequence                    |
+---------------------------------+
|i7 : rays C2                     |
|                                 |
|o7 = | 0 1 |                     |
|     | 1 1 |                     |
|     | 0 0 |                     |
|                                 |
|              3       2          |
|o7 : Matrix ZZ  <-- ZZ           |
+---------------------------------+

So we can make the cone compatible and add it to the fan.
+---------------------------------------------------------+
|i8 : C1 = coneFromVData matrix {{1,0,0},{0,1,0},{0,0,-1}}|
|                                                         |
|o8 = C1                                                  |
|                                                         |
|o8 : Cone                                                |
+---------------------------------------------------------+
|i9 : F = addCone(C1,F)                                   |
|                                                         |
|o9 = F                                                   |
|                                                         |
|o9 : Fan                                                 |
+---------------------------------------------------------+

Instead of creating a fan with one cone and then adding more cones, we can also
make a fan out of a list of cones:
+-------------------------------------------------------------+
|i10 : C2 = coneFromVData matrix {{-1,0,0},{0,1,0},{0,0,1}};  |
+-------------------------------------------------------------+
|i11 : C3 = coneFromVData matrix {{-1,0,0},{0,1,0},{0,0,-1}}; |
+-------------------------------------------------------------+
|i12 : C4 = coneFromVData matrix {{-1,0,0},{0,-1,0},{0,0,1}}; |
+-------------------------------------------------------------+
|i13 : C5 = coneFromVData matrix {{-1,0,0},{0,-1,0},{0,0,-1}};|
+-------------------------------------------------------------+
|i14 : F1 = fan {C2,C3,C4,C5}                                 |
|                                                             |
|o14 = F1                                                     |
|                                                             |
|o14 : Fan                                                    |
+-------------------------------------------------------------+

Furthermore, we could add a list of cones to an existing fan:
+------------------------------------------------------------+
|i15 : C6 = coneFromVData matrix {{1,0,0},{0,-1,0},{0,0,1}}; |
+------------------------------------------------------------+
|i16 : C7 = coneFromVData matrix {{1,0,0},{0,-1,0},{0,0,-1}};|
+------------------------------------------------------------+
|i17 : F1 = addCone( {C6,C7}, F1)                            |
|                                                            |
|o17 = F1                                                    |
|                                                            |
|o17 : Fan                                                   |
+------------------------------------------------------------+

So, see fan, and addCone, are the methods to construct
fans ''from scratch'', but there are also methods to get fans directly, for
example normalFan, which constructs the inner normal fan of a
polytope.
+----------------------+
|i18 : P = hypercube 4 |
|                      |
|o18 = P               |
|                      |
|o18 : Polyhedron      |
+----------------------+
|i19 : F2 = normalFan P|
|                      |
|o19 = F2              |
|                      |
|o19 : Fan             |
+----------------------+

Now we have seen how to construct fans, so we turn to functions on fans, for
example the direct product (see directProduct(Cone,Cone)):
+-----------------------------------------------------------------------+
|i20 : F3 = fan {coneFromVData matrix {{1}},coneFromVData matrix {{-1}}}|
|                                                                       |
|o20 = F3                                                               |
|                                                                       |
|o20 : Fan                                                              |
+-----------------------------------------------------------------------+
|i21 : F1 = F3 * F1                                                     |
|                                                                       |
|o21 = F1                                                               |
|                                                                       |
|o21 : Fan                                                              |
+-----------------------------------------------------------------------+

The result is in the direct product of the ambient spaces.
+---------------+
|i22 : ambDim F1|
|               |
|o22 = 4        |
+---------------+

Of course, we can check if two fans are the same:
+--------------+
|i23 : F1 == F2|
|              |
|o23 = false   |
+--------------+

A bit more on fans can be found in part 2: Working with fans - Part 2.
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:102:0.

Working with fans - Part 2
**************************

Now we construct a new fan to show some other functions.
+-------------------------------------------------------------------+
|i1 : C1 = coneFromVData matrix {{1,1,-1,-1},{1,-1,1,-1},{1,1,1,1}};|
+-------------------------------------------------------------------+
|i2 : C2 = coneFromVData matrix {{1,1,1},{0,1,-1},{-1,1,1}};        |
+-------------------------------------------------------------------+
|i3 : C3 = coneFromVData matrix {{-1,-1,-1},{0,1,-1},{-1,1,1}};     |
+-------------------------------------------------------------------+
|i4 : C4 = coneFromVData matrix {{1,-1},{0,0},{-1,-1}};             |
+-------------------------------------------------------------------+
|i5 : F = fan {C1,C2,C3,C4}                                         |
|                                                                   |
|o5 = F                                                             |
|                                                                   |
|o5 : Fan                                                           |
+-------------------------------------------------------------------+

This is not a ''very nice'' fan, as it is neither complete nor of pure
dimension:
+-----------------+
|i6 : isComplete F|
|                 |
|o6 = false       |
+-----------------+
|i7 : isPure F    |
|                 |
|o7 = false       |
+-----------------+

If we add two more cones the fan becomes complete.
+---------------------------------------------------------------------+
|i8 : C5 = coneFromVData matrix {{1,-1,1,-1},{-1,-1,0,0},{1,1,-1,-1}};|
+---------------------------------------------------------------------+
|i9 : C6 = coneFromVData matrix {{1,-1,1,-1},{1,1,0,0},{1,1,-1,-1}};  |
+---------------------------------------------------------------------+
|i10 : F = addCone({C5,C6},F)                                         |
|                                                                     |
|o10 = F                                                              |
|                                                                     |
|o10 : Fan                                                            |
+---------------------------------------------------------------------+
|i11 : isComplete F                                                   |
|                                                                     |
|o11 = true                                                           |
+---------------------------------------------------------------------+

For a complete fan we can check if it is projective:
+-------------------+
|i12 : isPolytopal F|
|                   |
|o12 = true         |
+-------------------+

If the fan is projective, the function returns a polyhedron such that the fan
is its  normal fan, otherwise it returns the empty polyhedron. This means our
fan is projective.
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/old_documentation.m2:144:0.

Working with polyhedra
**********************

Just like cones, polyhedra have two descriptions. One description as the convex
hull of finitely many points (and optionally rays and lineality), the
V-representation. Another description as the intersection of finitely many
half-spaces, the H-representation. Using the method convexHull,
we can create a polyhedron in 2-space which is the
convexHull, of a given set of points.

+---------------------------------------+
|i1 : V = matrix {{0,2,-2,0},{-1,1,1,1}}|
|                                       |
|o1 = | 0  2 -2 0 |                     |
|     | -1 1 1  1 |                     |
|                                       |
|              2       4                |
|o1 : Matrix ZZ  <-- ZZ                 |
+---------------------------------------+
|i2 : P = convexHull V                  |
|                                       |
|o2 = P                                 |
|                                       |
|o2 : Polyhedron                        |
+---------------------------------------+

See Polyhedra, uses the principle of lazy evaluation: Properties of the
combinatorial objects are only computed on demand and then they are stored with
the object. For example we can ask for the vertices of P using vertices,:

+-----------------------+
|i3 : vertices P        |
|                       |
|o3 = | 0  -2 2 |       |
|     | -1 1  1 |       |
|                       |
|              2       3|
|o3 : Matrix QQ  <-- QQ |
+-----------------------+

Here we see that the point (0,1) is not a vertex and P is actually a triangle.

+-----------------------+
|i4 : (HS,v) = facets P |
|                       |
|o4 = (| -1 -1 |, | 1 |)|
|      | 1  -1 |  | 1 | |
|      | 0  1  |  | 1 | |
|                       |
|o4 : Sequence          |
+-----------------------+

This gives the defining affine half-spaces, i.e. P is given by all p such that
HS*p <= v and that lie in the defining affine hyperplanes. The rows of the
matrix HS are the outer normals of the polyhedron P. To get the defining
hyperplanes we use:

+------------------+
|i5 : hyperplanes P|
|                  |
|o5 = (0, 0)       |
|                  |
|o5 : Sequence     |
+------------------+

There are none, so the polyhedron is of full dimension. It is also compact,
since P has no rays and the lineality space is of dimension zero.

+------------------------+
|i6 : isFullDimensional P|
|                        |
|o6 = true               |
+------------------------+
|i7 : ambDim P           |
|                        |
|o7 = 2                  |
+------------------------+
|i8 : dim P              |
|                        |
|o8 = 2                  |
+------------------------+
|i9 : rays P             |
|                        |
|o9 = 0                  |
|                        |
|              2         |
|o9 : Matrix QQ  <-- 0   |
+------------------------+
|i10 : linealitySpace P  |
|                        |
|o10 = 0                 |
|                        |
|               2        |
|o10 : Matrix QQ  <-- 0  |
+------------------------+

Internally, polyhedra are realized as cones, by embedding the polyhedron at
height one and then taking the positive hull. To get at this cone, use
cone (Macaulay2Doc). The height is the first coordinate of the rays of
the cone, comparing the matrices of rays (Macaulay2Doc), and
vertices, for the example one can see the correspondence:

+------------------------+
|i11 : C = cone P        |
|                        |
|o11 = C                 |
|                        |
|o11 : Cone              |
+------------------------+
|i12 : rays C            |
|                        |
|o12 = | 1  1  1 |       |
|      | 0  -2 2 |       |
|      | -1 1  1 |       |
|                        |
|               3       3|
|o12 : Matrix ZZ  <-- ZZ |
+------------------------+
|i13 : vertices P        |
|                        |
|o13 = | 0  -2 2 |       |
|      | -1 1  1 |       |
|                        |
|               2       3|
|o13 : Matrix QQ  <-- QQ |
+------------------------+

We can also construct the convex hull of a set of points and a set of rays.

+----------------------------------+
|i14 : R = matrix {{1},{0},{0}}    |
|                                  |
|o14 = | 1 |                       |
|      | 0 |                       |
|      | 0 |                       |
|                                  |
|               3       1          |
|o14 : Matrix ZZ  <-- ZZ           |
+----------------------------------+
|i15 : V1 = V || matrix {{1,1,1,1}}|
|                                  |
|o15 = | 0  2 -2 0 |               |
|      | -1 1 1  1 |               |
|      | 1  1 1  1 |               |
|                                  |
|               3       4          |
|o15 : Matrix ZZ  <-- ZZ           |
+----------------------------------+
|i16 : P1 = convexHull(V1,R)       |
|                                  |
|o16 = P1                          |
|                                  |
|o16 : Polyhedron                  |
+----------------------------------+
|i17 : vertices P1                 |
|                                  |
|o17 = | 0  -2 |                   |
|      | -1 1  |                   |
|      | 1  1  |                   |
|                                  |
|               3       2          |
|o17 : Matrix QQ  <-- QQ           |
+----------------------------------+

This polyhedron is not compact anymore and also not of full dimension.

+--------------------------+
|i18 : isCompact P1        |
|                          |
|o18 = false               |
+--------------------------+
|i19 : isFullDimensional P1|
|                          |
|o19 = false               |
+--------------------------+
|i20 : rays P1             |
|                          |
|o20 = | 1 |               |
|      | 0 |               |
|      | 0 |               |
|                          |
|               3       1  |
|o20 : Matrix QQ  <-- QQ   |
+--------------------------+
|i21 : hyperplanes P1      |
|                          |
|o21 = (| 0 0 -1 |, | -1 |)|
|                          |
|o21 : Sequence            |
+--------------------------+

On the other hand we can construct a polyhedron as the intersection of affine
half-spaces and affine hyperplanes, given via inequalities and equations:

+----------------------------------------------------------+
|i22 : inequalities = transpose (V || matrix {{-1,2,0,1}}) |
|                                                          |
|o22 = | 0  -1 -1 |                                        |
|      | 2  1  2  |                                        |
|      | -2 1  0  |                                        |
|      | 0  1  1  |                                        |
|                                                          |
|               4       3                                  |
|o22 : Matrix ZZ  <-- ZZ                                   |
+----------------------------------------------------------+
|i23 : v = matrix {{1},{1},{1},{1}}                        |
|                                                          |
|o23 = | 1 |                                               |
|      | 1 |                                               |
|      | 1 |                                               |
|      | 1 |                                               |
|                                                          |
|               4       1                                  |
|o23 : Matrix ZZ  <-- ZZ                                   |
+----------------------------------------------------------+
|i24 : equations = matrix {{1,1,1}}                        |
|                                                          |
|o24 = | 1 1 1 |                                           |
|                                                          |
|               1       3                                  |
|o24 : Matrix ZZ  <-- ZZ                                   |
+----------------------------------------------------------+
|i25 : w = matrix {{3}}                                    |
|                                                          |
|o25 = | 3 |                                               |
|                                                          |
|               1       1                                  |
|o25 : Matrix ZZ  <-- ZZ                                   |
+----------------------------------------------------------+
|i26 : P2 = polyhedronFromHData(inequalities,v,equations,w)|
|                                                          |
|o26 = P2                                                  |
|                                                          |
|o26 : Polyhedron                                          |
+----------------------------------------------------------+

This is a triangle in 3-space with the following vertices.

+--------------------------+
|i27 : isFullDimensional P2|
|                          |
|o27 = false               |
+--------------------------+
|i28 : vertices P2         |
|                          |
|o28 = | 4   4  2  |       |
|      | 9   5  5  |       |
|      | -10 -6 -4 |       |
|                          |
|               3       3  |
|o28 : Matrix QQ  <-- QQ   |
+--------------------------+

If we don't intersect with the hyperplane we get a full dimensional polyhedron.

+----------------------------------------------+
|i29 : P3 = polyhedronFromHData(inequalities,v)|
|                                              |
|o29 = P3                                      |
|                                              |
|o29 : Polyhedron                              |
+----------------------------------------------+
|i30 : vertices P3                             |
|                                              |
|o30 = | 0 0  0  |                             |
|      | 1 1  -3 |                             |
|      | 0 -2 2  |                             |
|                                              |
|               3       3                      |
|o30 : Matrix QQ  <-- QQ                       |
+----------------------------------------------+
|i31 : linealitySpace P3                       |
|                                              |
|o31 = | 1  |                                  |
|      | 2  |                                  |
|      | -2 |                                  |
|                                              |
|               3       1                      |
|o31 : Matrix QQ  <-- QQ                       |
+----------------------------------------------+
|i32 : isFullDimensional P3                    |
|                                              |
|o32 = true                                    |
+----------------------------------------------+

Note that the vertices are given modulo the lineality space. Besides
constructing polyhedra by hand, there are also some basic polyhedra implemented
such as the hypercube, in this case with edge-length four.

+--------------------------------+
|i33 : P4 = hypercube(3,2)       |
|                                |
|o33 = P4                        |
|                                |
|o33 : Polyhedron                |
+--------------------------------+
|i34 : vertices P4               |
|                                |
|o34 = | -2 2  -2 2  -2 2  -2 2 ||
|      | -2 -2 2  2  -2 -2 2  2 ||
|      | -2 -2 -2 -2 2  2  2  2 ||
|                                |
|               3       8        |
|o34 : Matrix QQ  <-- QQ         |
+--------------------------------+

Another on is the crossPolytope, in this case with
diameter six.

+-----------------------------+
|i35 : P5 = crossPolytope(3,3)|
|                             |
|o35 = P5                     |
|                             |
|o35 : Polyhedron             |
+-----------------------------+
|i36 : vertices P5            |
|                             |
|o36 = | -3 3 0  0 0  0 |     |
|      | 0  0 -3 3 0  0 |     |
|      | 0  0 0  0 -3 3 |     |
|                             |
|               3       6     |
|o36 : Matrix QQ  <-- QQ      |
+-----------------------------+

Furthermore the standard simplex (see stdSimplex).

+------------------------+
|i37 : P6 = stdSimplex 2 |
|                        |
|o37 = P6                |
|                        |
|o37 : Polyhedron        |
+------------------------+
|i38 : vertices P6       |
|                        |
|o38 = | 1 0 0 |         |
|      | 0 1 0 |         |
|      | 0 0 1 |         |
|                        |
|               3       3|
|o38 : Matrix QQ  <-- QQ |
+------------------------+

Now that we can construct polyhedra, we can turn to the functions that can be
applied to polyhedra. First of all, we can apply the convexHull,
function also to a pair of polyhedra:

+-----------------------------------------------+
|i39 : P7 = convexHull(P4,P5)                   |
|                                               |
|o39 = P7                                       |
|                                               |
|o39 : Polyhedron                               |
+-----------------------------------------------+
|i40 : vertices P7                              |
|                                               |
|o40 = | -3 3 0  0 0  -2 2  -2 2  -2 2  -2 2 0 ||
|      | 0  0 -3 3 0  -2 -2 2  2  -2 -2 2  2 0 ||
|      | 0  0 0  0 -3 -2 -2 -2 -2 2  2  2  2 3 ||
|                                               |
|               3       14                      |
|o40 : Matrix QQ  <-- QQ                        |
+-----------------------------------------------+

Or we can intersect them by using intersect (Macaulay2Doc),:

+---------------------------------------------------------------------------+
|i41 : P8 = intersection(P4,P5)                                             |
|                                                                           |
|o41 = P8                                                                   |
|                                                                           |
|o41 : Polyhedron                                                           |
+---------------------------------------------------------------------------+
|i42 : vertices P8                                                          |
|                                                                           |
|o42 = | -1 1  -2 2  -2 2 -1 1 -1 1  0  0  -2 2  0  0  -2 2 0  0 -1 1 0  0 ||
|      | -2 -2 -1 -1 1  1 2  2 0  0  -1 1  0  0  -2 2  0  0 -2 2 0  0 -1 1 ||
|      | 0  0  0  0  0  0 0  0 -2 -2 -2 -2 -1 -1 -1 -1 1  1 1  1 2  2 2  2 ||
|                                                                           |
|               3       24                                                  |
|o42 : Matrix QQ  <-- QQ                                                    |
+---------------------------------------------------------------------------+

Furthermore, both functions can be applied to a list containing any number of
polyhedra and matrices defining vertices/rays or affine
half-spaces/hyperplanes.  All of these must be in the same ambient space. For
example:

+------------------------------------+
|i43 : P9 = convexHull {(V1,R),P2,P6}|
|                                    |
|o43 = P9                            |
|                                    |
|o43 : Polyhedron                    |
+------------------------------------+
|i44 : vertices P9                   |
|                                    |
|o44 = | 4   4  2  0  -2 |           |
|      | 9   5  5  -1 1  |           |
|      | -10 -6 -4 1  1  |           |
|                                    |
|               3       5            |
|o44 : Matrix QQ  <-- QQ             |
+------------------------------------+

Further functions are for example the Minkowski sum (see minkowskiSum)
of two polyhedra.

+-------------------------+
|i45 : Q = convexHull (-V)|
|                         |
|o45 = Q                  |
|                         |
|o45 : Polyhedron         |
+-------------------------+
|i46 : P10 = P + Q        |
|                         |
|o46 = P10                |
|                         |
|o46 : Polyhedron         |
+-------------------------+
|i47 : vertices P10       |
|                         |
|o47 = | -4 4 -2 2  -2 2 ||
|      | 0  0 -2 -2 2  2 ||
|                         |
|               2       6 |
|o47 : Matrix QQ  <-- QQ  |
+-------------------------+

In the other direction, we can also determine all Minkowski summands (see
minkSummandCone) of a polyhedron.

+---------------------------------------------------------+
|i48 : (C,L,M) = minkSummandCone P10                      |
|                                                         |
|o48 = (C, HashTable{0 => Polyhedron{...1...}}, | 1 0 |)  |
|                    1 => Polyhedron{...1...}   | 0 1 |   |
|                    2 => Polyhedron{...1...}   | 1 0 |   |
|                    3 => Polyhedron{...1...}   | 1 0 |   |
|                    4 => Polyhedron{...1...}   | 0 1 |   |
|                                                         |
|o48 : Sequence                                           |
+---------------------------------------------------------+
|i49 : apply(values L, vertices)                          |
|                                                         |
|o49 = {| 0 4 |, | 0 4 2  |, | 0 2 |, | 0 2  |, | 0 4 2 |}|
|       | 0 0 |  | 0 0 -2 |  | 0 2 |  | 0 -2 |  | 0 0 2 | |
|                                                         |
|o49 : List                                               |
+---------------------------------------------------------+

Here the polyhedra in the hash table L are all possible Minkowski summands up
to scalar multiplication and the columns of M give the minimal decompositions.
So the hexagon P10 is not only the sum of two triangles but also the sum of
three lines. Furthermore, we can take the direct product of two polyhedra.

+-----------------------------------+
|i50 : P11 = P * Q                  |
|                                   |
|o50 = P11                          |
|                                   |
|o50 : Polyhedron                   |
+-----------------------------------+
|i51 : vertices P11                 |
|                                   |
|o51 = | 0  -2 2  0  -2 2  0  -2 2 ||
|      | -1 1  1  -1 1  1  -1 1  1 ||
|      | -2 -2 -2 2  2  2  0  0  0 ||
|      | -1 -1 -1 -1 -1 -1 1  1  1 ||
|                                   |
|               4       9           |
|o51 : Matrix QQ  <-- QQ            |
+-----------------------------------+

The result is in QQ^4.

+----------------+
|i52 : ambDim P11|
|                |
|o52 = 4         |
+----------------+

To find out more about this polyhedron use for example.

+-----------------------+
|i53 : fVector P11      |
|                       |
|o53 = {9, 18, 15, 6, 1}|
|                       |
|o53 : List             |
+-----------------------+

The function fVector, gives the number of faces of each
dimension, so it has 9 vertices, 18 edges and so on. We can access the faces of
a certain codimension via:

+-----------------------------------------------------------------------------+
|i54 : L = faces(1,P11)                                                       |
|                                                                             |
|o54 = {({0, 1, 3, 4, 6, 7}, {}), ({0, 2, 3, 5, 6, 8}, {}), ({1, 2, 4, 5, 7,  |
|      -----------------------------------------------------------------------|
|      8}, {}), ({0, 1, 2, 3, 4, 5}, {}), ({0, 1, 2, 6, 7, 8}, {}), ({3, 4, 5,|
|      -----------------------------------------------------------------------|
|      6, 7, 8}, {})}                                                         |
|                                                                             |
|o54 : List                                                                   |
+-----------------------------------------------------------------------------+
|i55 : vertP11 = vertices P11                                                 |
|                                                                             |
|o55 = | 0  -2 2  0  -2 2  0  -2 2 |                                          |
|      | -1 1  1  -1 1  1  -1 1  1 |                                          |
|      | -2 -2 -2 2  2  2  0  0  0 |                                          |
|      | -1 -1 -1 -1 -1 -1 1  1  1 |                                          |
|                                                                             |
|               4       9                                                     |
|o55 : Matrix QQ  <-- QQ                                                      |
+-----------------------------------------------------------------------------+
|i56 : apply(L, l -> vertP11_(l#0))                                           |
|                                                                             |
|o56 = {| 0  -2 0  -2 0  -2 |, | 0  2  0  2  0  2 |, | -2 2  -2 2  -2 2 |, |  |
|       | -1 1  -1 1  -1 1  |  | -1 1  -1 1  -1 1 |  | 1  1  1  1  1  1 |  |  |
|       | -2 -2 2  2  0  0  |  | -2 -2 2  2  0  0 |  | -2 -2 2  2  0  0 |  |  |
|       | -1 -1 -1 -1 1  1  |  | -1 -1 -1 -1 1  1 |  | -1 -1 -1 -1 1  1 |  |  |
|      -----------------------------------------------------------------------|
|      0  -2 2  0  -2 2  |, | 0  -2 2  0  -2 2 |, | 0  -2 2  0  -2 2 |}       |
|      -1 1  1  -1 1  1  |  | -1 1  1  -1 1  1 |  | -1 1  1  -1 1  1 |        |
|      -2 -2 -2 2  2  2  |  | -2 -2 -2 0  0  0 |  | 2  2  2  0  0  0 |        |
|      -1 -1 -1 -1 -1 -1 |  | -1 -1 -1 1  1  1 |  | -1 -1 -1 1  1  1 |        |
|                                                                             |
|o56 : List                                                                   |
+-----------------------------------------------------------------------------+

We can compute all lattice points of the polyhedron with latticePoints.

+-----------------------------------------------------------------------------+
|i57 : L = latticePoints P11                                                  |
|                                                                             |
|o57 = {| -2 |, | -2 |, | -2 |, | -2 |, | -2 |, | -2 |, | -2 |, | -2 |, | -2  |
|       | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1   |
|       | -2 |  | -1 |  | -1 |  | 0  |  | 0  |  | 0  |  | 1  |  | 1  |  | 2   |
|       | -1 |  | -1 |  | 0  |  | -1 |  | 0  |  | 1  |  | -1 |  | 0  |  | -1  |
|      -----------------------------------------------------------------------|
|      |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1|
|      |  | 0  |  | 0  |  | 0  |  | 0  |  | 0  |  | 0  |  | 0  |  | 0  |  | 0 |
|      |  | -2 |  | -1 |  | -1 |  | 0  |  | 0  |  | 0  |  | 1  |  | 1  |  | 2 |
|      |  | -1 |  | -1 |  | 0  |  | -1 |  | 0  |  | 1  |  | -1 |  | 0  |  | -1|
|      -----------------------------------------------------------------------|
|      |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1 |, | -1|
|      |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1  |  | 1 |
|      |  | -2 |  | -1 |  | -1 |  | 0  |  | 0  |  | 0  |  | 1  |  | 1  |  | 2 |
|      |  | -1 |  | -1 |  | 0  |  | -1 |  | 0  |  | 1  |  | -1 |  | 0  |  | -1|
|      -----------------------------------------------------------------------|
|      |, | 0  |, | 0  |, | 0  |, | 0  |, | 0  |, | 0  |, | 0  |, | 0  |, | 0 |
|      |  | -1 |  | -1 |  | -1 |  | -1 |  | -1 |  | -1 |  | -1 |  | -1 |  | -1|
|      |  | -2 |  | -1 |  | -1 |  | 0  |  | 0  |  | 0  |  | 1  |  | 1  |  | 2 |
|      |  | -1 |  | -1 |  | 0  |  | -1 |  | 0  |  | 1  |  | -1 |  | 0  |  | -1|
|      -----------------------------------------------------------------------|
|      |, | 0  |, | 0  |, | 0  |, | 0  |, 0, | 0 |, | 0  |, | 0 |, | 0  |, |  |
|      |  | 0  |  | 0  |  | 0  |  | 0  |     | 0 |  | 0  |  | 0 |  | 0  |  |  |
|      |  | -2 |  | -1 |  | -1 |  | 0  |     | 0 |  | 1  |  | 1 |  | 2  |  |  |
|      |  | -1 |  | -1 |  | 0  |  | -1 |     | 1 |  | -1 |  | 0 |  | -1 |  |  |
|      -----------------------------------------------------------------------|
|      0  |, | 0  |, | 0  |, | 0  |, | 0 |, | 0 |, | 0  |, | 0 |, | 0  |, | 1 |
|      1  |  | 1  |  | 1  |  | 1  |  | 1 |  | 1 |  | 1  |  | 1 |  | 1  |  | 0 |
|      -2 |  | -1 |  | -1 |  | 0  |  | 0 |  | 0 |  | 1  |  | 1 |  | 2  |  | -2|
|      -1 |  | -1 |  | 0  |  | -1 |  | 0 |  | 1 |  | -1 |  | 0 |  | -1 |  | -1|
|      -----------------------------------------------------------------------|
|      |, | 1  |, | 1  |, | 1  |, | 1 |, | 1 |, | 1  |, | 1 |, | 1  |, | 1  |,|
|      |  | 0  |  | 0  |  | 0  |  | 0 |  | 0 |  | 0  |  | 0 |  | 0  |  | 1  | |
|      |  | -1 |  | -1 |  | 0  |  | 0 |  | 0 |  | 1  |  | 1 |  | 2  |  | -2 | |
|      |  | -1 |  | 0  |  | -1 |  | 0 |  | 1 |  | -1 |  | 0 |  | -1 |  | -1 | |
|      -----------------------------------------------------------------------|
|      | 1  |, | 1  |, | 1  |, | 1 |, | 1 |, | 1  |, | 1 |, | 1  |, | 2  |, | |
|      | 1  |  | 1  |  | 1  |  | 1 |  | 1 |  | 1  |  | 1 |  | 1  |  | 1  |  | |
|      | -1 |  | -1 |  | 0  |  | 0 |  | 0 |  | 1  |  | 1 |  | 2  |  | -2 |  | |
|      | -1 |  | 0  |  | -1 |  | 0 |  | 1 |  | -1 |  | 0 |  | -1 |  | -1 |  | |
|      -----------------------------------------------------------------------|
|      2  |, | 2  |, | 2  |, | 2 |, | 2 |, | 2  |, | 2 |, | 2  |}             |
|      1  |  | 1  |  | 1  |  | 1 |  | 1 |  | 1  |  | 1 |  | 1  |              |
|      -1 |  | -1 |  | 0  |  | 0 |  | 0 |  | 1  |  | 1 |  | 2  |              |
|      -1 |  | 0  |  | -1 |  | 0 |  | 1 |  | -1 |  | 0 |  | -1 |              |
|                                                                             |
|o57 : List                                                                   |
+-----------------------------------------------------------------------------+
|i58 : #L                                                                     |
|                                                                             |
|o58 = 81                                                                     |
+-----------------------------------------------------------------------------+

Evenmore the tail/recession cone of a polyhedron with tailCone.

+------------------------+
|i59 : C = tailCone P1   |
|                        |
|o59 = C                 |
|                        |
|o59 : Cone              |
+------------------------+
|i60 : rays C            |
|                        |
|o60 = | 1 |             |
|      | 0 |             |
|      | 0 |             |
|                        |
|               3       1|
|o60 : Matrix ZZ  <-- ZZ |
+------------------------+

Finally, there is also a function to compute the polar of a polyhedron, i.e.
all points in the dual space that are greater than -1 on all points of the
polyhedron:

+-------------------------+
|i61 : P12 = polar P11    |
|                         |
|o61 = P12                |
|                         |
|o61 : Polyhedron         |
+-------------------------+
|i62 : vertices P12       |
|                         |
|o62 = | 1 -1 0  0 0  0  ||
|      | 1 1  -1 0 0  0  ||
|      | 0 0  0  0 1  -1 ||
|      | 0 0  0  1 -1 -1 ||
|                         |
|               4       6 |
|o62 : Matrix QQ  <-- QQ  |
+-------------------------+
-------------------------------------------------------------------------------

The source of this document is in
Polyhedra/documentation/working_with_polyhedra.m2:239:0.