There are also functions to deal with the faces of a cone. They are of type CFACE. Moreover, cones may be grouped together to give a FAN.
&<(C1::CONE, C2::CONE)::boolean &>(C2::CONE, C1::CONE)::boolean C1 &< C2 C2 &> C1
Test whether C1 is strictly contained C2. Both cones must lie in the same ambient space.
Contrary to the Maple comparison operators, this functions directly returns a boolean value. Hence there is no need to apply evalb.
fullcone(1) &< fullcone(2); |
&<=(C1::CONE, C2::CONE)::boolean &>=(C2::CONE, C1::CONE)::boolean C1 &<= C2 C2 &>= C1
Test whether C1 is contained in C2. Both cones must lie in the same ambient space.
Contrary to the Maple comparison operators, this functions directly returns a boolean value. Hence there is no need to apply evalb.
&<>(C1::CONE, C2::CONE)::boolean C1 &<> C2
Test whether C1 and C2 represent different cones, considered as subsets of Euclidean space. This is not the same as comparing C1 and C2 as Maple expressions, see the discussion under &=.
One can compare cones lying in different ambient spaces. The result is always true.
Contrary to the Maple comparison operators, this functions directly returns a boolean value. Hence there is no need to apply evalb.
&=(C1::CONE, C2::CONE)::boolean C1 &= C2
Test whether C1 and C2 represent the same cone, considered as subset of Euclidean space. Note that two CONEs may be equal in this sense without being equal as Maple expressions. The reason is that some details of the CONE data structure depend on the way the CONE was defined.
One can compare cones lying in different ambient spaces. The result is always false.
Contrary to the Maple comparison operators, this functions directly returns a boolean value. Hence there is no need to apply evalb.
C1 := poshull([1, 2], [2, 1]); C2 := poshull([2, 1], [1, 2]); |
C1 &= C2; |
evalb(C1 = C2); |
zerocone(1) &= zerocone(2); |
&x(C1::CONE, ...)::CONE C1 &x C2
The Cartesian product of the given cones, lying in the Cartesian product of their ambient spaces.
C := posorthant(1) &x posorthant(2); |
C &= posorthant(3); |
&x(posorthant(1)$4) &= posorthant(4); |
CONE[`&x`](); |
ambientdim(C::CONE)::nonnegint
The dimension of the space in which C lies.
arecompatible(C1::CONE, C2::CONE)::boolean arecompatible(C1::CONE, C2::CONE, C::name)::boolean
Two cones are compatible if their intersection is a common face of both. If C1 and C2 are compatible and a third argument C is given, it receives the intersection (of type CONE).
boundary(C::CONE1)::FAN
The fan of all proper faces of the non-zero cone C.
codim(C::CONE)::nonnegint
The codimension of C is that of its linear hull.
contains(C::CONE, arg2::{vec, line, CONE})::boolean contains(arg1::{vec, line, CONE}, C::CONE)::boolean
The first form returns true if C contains the vector, line or cone arg2, and false otherwise. The second form yields true if C is contained in the halfspace resp. hyperplane determined by the vector or line arg1, or in the cone arg1, and false otherwise. If both arguments are cones, one may also use the relational operators &<= and &>=.
containsrelint(C::CONE, r::vec)::boolean
Decides whether the vector r is contained in the relative interior of C.
convert(C::CONE, CONE)::CONE
This function transforms its argument to be strictly of type CONE. For true CONEs, this is the identity operation. But if C is a FANCONE, then all additional information is lost.
convert(C::CONE, POLYHEDRON)::POLYHEDRON
Internally, a POLYHEDRON is stored as the CONE given by its homogenization. This function returns the POLYHEDRON whose internal representation is C (or rather the intersection of C with the halfspace at infinity). Accordingly, the ambient dimension goes down by one, and the dimension of C by at least one.
Note that the precise result depends on which coordinate is the additional one used for the homogenization.
convert(C::CONE, affine)::POLYHEDRON1 convert(C::CONE, v::vec, affine)::POLYHEDRON1
This function converts the cone C into a polyhedron representing the same point set. If a second argument v is given, the origin of the cone is translated to v.
dim(C::CONE)::nonnegint
The dimension of C is that of its linear hull.
dual(C::CONE)::CONE
The dual of C is the polyhedral cone of all vectors whose inner product with all vectors in C is non-negative. This operation interchanges lines and hplanes, and rays and hspaces.
edges(C::CONE)::list(CFACE)
The list of rankĀ 1 faces of C. They correspond to the entries of rays(C) (in the same order), but are of type CFACE. This function is similar to facets. See also rays and CFACE[rank].
faces(C::CONE)::Array(list(CFACE))
An Array indexed from 0 to ambientdim(C). The k-th entry is a list of all k-dimensional faces of C. Warning: cones may have a huge number of faces! See also ambientdim.
faces(posorthant(3)); |
facets(C::CONE)::list(CFACE)
A list of the facets of C. The order corresponds to that of hspaces(C), i.e., facets(C)[i] is the facet induced by intersecting C with the hyperplane defined by hspaces(C)[i]. See hspaces.
C := posorthant(2); rays(C); hspaces(C); |
L := facets(C); |
rays(L[1]); hspaces(L[1]); |
flagf(C::CONE, S::set(integer))::nonnegint
The entry of the flag f-vector of C corresponding to S. See FAN[flagf].
flagf(C::CONE, S::set(integer))::integer
The entry of the flag h-vector of C corresponding to S. See FAN[flagh].
fullcone(n::integer)::CONE
The whole space as full-dimensional cone in n-space.
fullcone(0) &= zerocone(0); |
fvector(C::CONE)::Array(nonnegint)
The f-vector of C counts the number of faces of C of the various dimensions. See FAN[fvector].
genhvector(F::)::Array
Stanley's generalized h-vector. See FAN[genhvector] for details.
hilbertbasis(C::CONE)::list(vec) hilbertbasis(C::CONE, B::name)::list(vec)
If C is pointed, this function computes the Hilbert basis of the additive monoid of integral points in C. For general C, such a basis is computed for the intersection of C with a lattice complement of the lineality space of C (in the linear hull of C). In order to obtain a complete Hilbert basis of C, one must add a lattice basis (and its negative) of the lineality space of C. Such a basis (of type list(vec)) is stored in the optional argument B.
C := poshull([1, 2], [2, 1]); hilbertbasis(C); |
C := poshull([1, 2, 0], [2, 1, 0], line([3, -4, -1])); hilbertbasis(C, 'B'); B; |
hplanes(C::CONE)::list(vec)
A basis of the linear subspace of all vectors whose scalar product with all vectors of C vanish. The normalization is as for lineality spaces, see lines.
hspaces(C::CONE)::list(vec)
This list contains, for each facet f of C, a vector normal to f. The normalization (with respect to hyperplanes in this case) is as for rays. See hplanes and rays.
hvector(C::CONE)::Array(nonnegint)
image(C::CONE, A::{mat, rational, real_infinity})::CONE
This gives the image of C under the linear map defined by A. A rational number is interpreted as homothety. If A equals real_infinity, then the result is the whole ambient space.
incidencematrix(C::CONE)::matrix({0,1})
The incidence matrix of C. It has one row for each facet of C and one column for each ray. The ordering is that of hspaces and rays, respectively. The entry in row i and column j is 1 if the j-th ray is incident to the i-th facet, and 0 otherwise.
C := posorthant(2); rays(C); hspaces(C); |
incidencematrix(C); |
incidencematrix(posorthant(0)); |
incidentfacets(C::CONE)::list(set(posint))
The i-th entry of this list is the set of indices of all facets of C incident to the i-th ray of C. The ordering is that of hspaces and rays, respectively. This corresponds to all facets normals whose scalar product with rays(C)[i] is zero. See also incidentrays.
incidentrays(C::CONE)::list(set(posint))
The i-th entry of this list is the set of indices of all rays of C incident to the i-th facet of C. The ordering is that of rays and hspaces, respectively. This corresponds to all rays whose scalar product with the i-th facet normal hspaces(C)[i] is zero.
C := convert(cube(3), CONE); incidentrays(C); |
for v in hspaces(C) do map(dotprod, rays(C), v) od; |
intersection(arg1::{vec, line, CONE}, ...)::CONE
The intersection of the given arguments. A vec is interpreted as the positive halfspace defined by it, and analogously a line as a hyperplane. In order to determine the ambient dimension, at least one argument must be given. If you have a possibly empty sequence of arguments in d-space, simply add fullcone(d).
isface(C1::CONE, C2::CONE)::boolean isface(C1::CONE, C2::CONE, f::name)::boolean
Test whether C1 is a face of C2. If this is the case and a third argument is given, it receives the CFACE with domain C2 representing this face. C1 and C2 must lie in the same ambient space.
isfulldim(C::CONE)::boolean
A full-dimensional cone is one of codimension 0.
islinear(C::CONE)::boolean
Test whether C is a linear subspace.
ispointed(C::CONE)::boolean
A cone is pointed if it contains no line, i.e., if its smallest face is the origin. See also lines.
isregular(C::CONE)::boolean isregular(C::CONE, B::name)::boolean
A cone is regular if it is pointed and its rays can be extended to a basis of the lattice of integral points of its ambient space. If this is true and a second argument is given, it receives such a basis (of type list(vec)) starting with the rays of C.
C := poshull([1, 2, 3], [3, 1, 2]); |
isregular(C, 'B'); B; |
issimple(C::CONE)::boolean
Test whether C is simple. A cone is simple if it is full-dimensional and each proper face f is the intersection of exactly dim(f) facets. This is dual to issimplicial1.
issimplicial(C::CONE)::boolean
Test whether C is simplicial. A cone is simplicial if it is pointed and has exactly dim(C) rays. See ispointed.
issimplicial1(C::CONE)::boolean
Test whether C is simplicial in codimension 1, that is, whether C is pointed and all its facets are simplicial. (The second condition implies the first unless C is a linear subspace.) See ispointed, issimple and issimplicial.
lensspace(p::posint, w1::integer, ..., wn::integer)::CONE
The cone whose associated toric variety is the unbounded cone (in the sense of topology) over the lens space of order p with weights w1, ..., wn. See also wprojspace.
lineality(C::CONE)::CONE
The lineality space of a cone is the largest linear subspace contained in it. It is returned as a CONE.
linearhull(arg1::{vec, ray, line, CONE}, ...)::CONE
The linear hull of the given arguments, considered as CONE.
lines(C::CONE)::list(vec)
A basis of the lineality space of C, which is the largest linear subspace contained in C. The basis is in row echelon form with each row multiplied by a positive integer so that the coefficients of each row are relatively prime integers. Note that this determines the resulting basis completely. In other words, two cones C1 and C2 have the same lineality space if and only lines(C1) and lines(C2) are identical.
lines(posorthant(2)); |
lines(fullcone(2)); |
C := poshull(line([-2, -6, 10]), line([1/3, 1, 1/5]), [-7, 8, -9]); lines(C); |
maximal(C::CONE)::CFACE
This function returns the maximal element of the face lattice of C, i.e., C itself, considered as an element of its face lattice.
minimal(C::CONE)::CFACE
This function returns the minimal element of the face lattice of C, i.e., its lineality space, considered as an element of the face lattice of C. See lines.
polar(C::CONE)::CONE
The polar cone of C is the negative of its dual.
poshull(arg1::{vec, ray, line, CONE, POLYHEDRON}, ...)::CONE
The cone generated by the given arguments, i.e., the smallest cone containing all the arguments ("their positive hull"). Note that giving a ray ray(v) is equivalent to giving the vec v defining it. The cone generated by a polyhedron is the cone generated by its vertices, rays and lines. In order to determine the ambient dimension, at least one argument must be given. If you have a possibly empty sequence of arguments in d-space, simply add zerocone(d).
C1 := poshull([1, 0]); C2 := poshull(C1, [1, 1]); rays(C2); |
C3 := poshull([1, 0], [1, 1]); C2 &= C3; |
C := poshull(convhull([2, 0], ray([0, 1]))); |
rays(C); |
posorthant(n::integer)::CONE
The positive orthant in n-space. This is the cone containing all points with non-negative coordinates. It is a simplicial cone spanned by the canonical basis vectors.
preimage(C::CONE, A::{mat, rational, real_infinity})::CONE
This gives the preimage of C under the linear map defined by A. A rational number is interpreted as homothety. If A equals real_infinity, then the result is the zero cone. See the description of the type mat on how to specify maps to 0-space.
rays(C::CONE)::list(vec)
If C is pointed, then its rays are its 1-dimensional faces, and for each ray r the minimal point with integral coordinates in r is returned. In the general case, the extremal rays are only defined modulo the lineality space of C. Here representative vectors of the rays are chosen such that the coordinates corresponding to the pivot columns of lines(C) are zero and the other coordinates relatively prime integers. (The pivot columns of lines(C) are those which are linearly independent from the preceding columns.) Note that this determines rays(C) up to order of the rows. In other words, two cones C1 and C2 with the same lineality space have the same rays (hence, are equal in the sense of &=) if and only convert(rays(C1), set) and convert(rays(C2), set) are identical. See also lines.
rays(posorthant(2)); |
C := poshull(line([-2, -6, 10]), line([1/3, 1, 1/5]), [-7, 8, -9]); |
lines(C); rays(C); |
rays(zerocone(2)); |
rays(fullcone(2)); |
relint(C::CONE)::vec
This function returns a vector in the relative interior of C. More precisely, it returns the sum of the rays in reduced form.
Example
relint(poshull([1, 2], [2, 1])); |
skeleton(C::CONE, k::nonnegint)::FAN
This is the same as FAN[skeleton](fan(C), k).
support(C::CONE, v1::vec, ...)::CFACE
This function returns the supporting face in C of the rays v1, etc. This is the smallest face of C containing of these rays. If such a face does not exist, FAIL is returned.
C := posorthant(2); |
f := support(C, [1, 1]); rays(f); |
f := support(C, [1, 0]); rays(f); |
f := support(C, [1, -1]); |
f := support(C, [1, 0], [0, 1]); rays(f); |
support(C) &= minimal(C); |
traverse(C::CONE, g::procedure)
This is the same as traverse(fan(C), g), see FAN[traverse].
traverse2(C::CONE, g::procedure, g2::procedure)
This is the same as traverse2(fan(C), g, g2), see FAN[traverse2].
zerocone(n::integer)::CONE
The origin as 0-dimensional cone in n-space.