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:
|
|
|
After creating the cone, one can use rays to ask for its minimal rays.
|
We see that (1,1) is not an extremal ray of the cone.
|
|
|
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.
|
|
|
|
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.
|
|
|
|
|
This is a two dimensional cone in 3-space with the following rays:
|
If we don't intersect with the hyperplane we get a full dimensional cone.
|
|
|
|
Again, the rays are given modulo the lineality space. Also, one can use given cones, for example the positive orthant (posOrthant):
|
|
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 intersection function also to a pair of cones in the same ambient space:
|
|
|
On the other hand, we can take their positive hull by using coneFromVData:
|
|
|
Furthermore, both functions (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:
|
|
|
|
Taking the positive hull of several cones is the same as taking their Minkowski sum, so in fact:
|
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:
|
|
|
Furthermore, we can take the direct product (directProduct) of two cones.
|
|
|
|
The result is contained in ${\mathbb Q}^5$.
|
To find out more about this cone use for example fVector:
|
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.
|
|
|
We can also check if the cone is smooth:
|
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.
|
|