# 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 : posHull matrix {{0,0,-1,-1,1},{2,-2,1,-1,0},{1,1,1,1,0}} o1 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of the cone => 3 number of facets => 5 number of rays => 5 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 (posHull)of a set of rays or as the intersection (intersection) 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 = posHull R o3 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of the cone => 3 number of facets => 3 number of rays => 3 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 = posHull(R,LS) o6 = {ambient dimension => 3 } dimension of lineality space => 1 dimension of the cone => 3 number of facets => 2 number of rays => 2 o6 : Cone i7 : rays C o7 = | 3 3 | | 1 5 | | 2 4 | 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 = intersection HS o9 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of the cone => 3 number of facets => 3 number of rays => 3 o9 : Cone i10 : rays C o10 = | 1 7 -5 | | 7 -5 1 | | -5 1 7 | 3 3 o10 : Matrix ZZ <--- ZZ i11 : HP = transpose LS o11 = | 1 1 -2 | 1 3 o11 : Matrix ZZ <--- ZZ i12 : C = intersection(HS,HP) o12 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of the cone => 2 number of facets => 2 number of rays => 2 o12 : Cone i13 : rays C o13 = | 7 -2 | | -5 4 | | 1 1 | 3 2 o13 : Matrix ZZ <--- ZZ

See alsoWorking with cones.

## Methods that use a convex rational cone :

• "addCone(Cone,Fan)" -- see addCone -- adds cones to a Fan
• "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
• "coneToPolyhedron(Cone)" -- see coneToPolyhedron -- converts a cone to class 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
• dim(Cone) -- computes the dimension of a cone
• 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
• "dualFaceLattice(Cone)" -- see dualFaceLattice(ZZ,Cone) -- computes the dual face lattice of a cone
• dualFaceLattice(ZZ,Cone) -- computes the dual face lattice of a cone
• "faceLattice(Cone)" -- see faceLattice(ZZ,Cone) -- computes the face lattice of a cone
• faceLattice(ZZ,Cone) -- computes the face lattice of a cone
• "faces(ZZ,Cone)" -- see faces -- computes all faces of a certain codimension of a Cone or Polyhedron
• "fan(Cone)" -- see fan -- generates a Fan
• "fVector(Cone)" -- see fVector -- computes the f-vector of a Cone or Polyhedron
• "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
• "intersection(Cone,Cone)" -- see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
• "intersection(Cone,Polyhedron)" -- see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
• "intersection(Polyhedron,Cone)" -- see intersection -- computes the intersection of half-spaces, hyperplanes, 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)" -- see isSmooth -- checks if a Cone or Fan is smooth
• "linSpace(Cone)" -- see linSpace -- computes a basis of the lineality space
• "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
• net(Cone) -- displays characteristics of a cone
• Polyhedron * Cone -- computes the direct product of a polyhedron and a cone
• Polyhedron + Cone -- computes the Minkowski sum of a polyhedron and a cone
• "posHull(Cone,Cone)" -- see posHull -- computes the positive hull of rays, cones, and the cone over a polyhedron
• "proximum(Matrix,Cone)" -- see proximum -- computes the proximum of the Polyhedron/Cone to a point in euclidian metric
• "rays(Cone)" -- see rays -- displays all rays of a Cone, a Fan, or a Polyhedron
• "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, with ancestor classes PolyhedralObject < HashTable < Thing.