Contents

Types

This page lists all types defined by the Convex package.

Simple Types

vec
`type/vec` := { list(rational), 'vector'(rational), 'Vector'(rational) };

A vec represents a point in rational Euclidean space (which may be zero-dimensional). For simplicity, it is often used to denote the ray generated by this vector. It may be given as list, Vector or vector with rational entries. (Vector is the new Maple type for vectors, and vector the old one.) The unique point in 0-space is given by [], Vector(0) or vector(0).

Whenever a Convex function returns a vec, it is of type list(rational). Moreover, whenever this vec really denotes a ray or line it is of type list(integer), and the entries are relatively prime. Note that this defines the list uniquely for rays and up to sign for lines.

Examples
C := poshull(Vector([1/2, 1/3])); rays(C);
C := CONE(2,1,0,1,1)
[[3, 2]]
C := poshull(line(vector([-6, 4]))); lines(C);
C := CONE(2,1,1,0,0)
[[3, -2]]
ray
`type/ray` := specfunc(vec, 'ray');

The expression ray(v) represents the ray through the vector v. It is not allowed to give more than one argument.

When a ray is defined, the argument v is automatically converted to type list(integer), and the coefficients are made relatively prime:

v := ray(vector([2, 1/3, -1]));
v := ray([6, 1, -3])
Note that this defines v uniquely.

Likewise, whenever a Convex function returns a ray ray(v), the argument v is of the same form as above.

line
`type/line` := specfunc(vec, 'line');

The expression line(v) represents the line through the vector v. It is not allowed to give more than one argument.

When a line is defined, the argument v is automatically converted to type list(integer), and the coefficients are made relatively prime:

v := line(Vector([2/7, 4]));
v := line([1, 14])
Note that this defines v up to sign.

The same applies to expressions of type line returned by Convex functions.

affhspace
`type/affhspace` := {vec <= rational, rational <= vec};

Let v be a vec of length n and c of type rational. The expressions v <= c and c >= v represent the affine halfspace of all points in n-space whose scalar product with v is less or equal to c. Whenever a Convex function returns an affhspace, it is of the form v <= c. See also dotprod.

affhplane
`type/affhplane` := {vec  = rational, rational = vec};

Let v be a vec of length n and c of type rational. The expressions v = c and c = v represent the affine hyperplane of all points in n-space whose scalar product with v is equal to c. Whenever a Convex function returns an affhplane, it is of the form v = c. See also dotprod.

mat
`type/mat` := {[], 'listlist'(rational), 'matrix'(rational), 'Matrix'(rational)};

This type is used for matrices with rational coefficients. It can be a list of (zero or more) lists of equal length and with rational entries, or a Matrix or matrix with rational entries. (Matrix is the new Maple type for matrices, and matrix the old one. The type listlist(rational) is actually subsumed under matrix(rational). One has to test for the empty list because it is not of type listlist - the Maple developers may know why.)

A linear map from d-space to 0-space may given by Matrix(0, d), matrix(0, d) or by the empty list []. For empty lists it is not possible, however, to determine the dimension of the source space. That produces an error in functions that need to know this value, in particular all preimage calculations.

Examples
P := preimage(fullpolyhedron(0), []);
Error, (in POLYHEDRON[preimage]) cannot determine ambient dimension, please use a Matrix
P := preimage(fullpolyhedron(0), Matrix(0, 2)); P &= fullpolyhedron(2);
P := POLYHEDRON(2,2,2,[1, 0],[0])
true

Structured Types

A variable of any of these types contains a huge amount of information. Displaying all these data would not be very helpful for the user, so only a summary of the key properties is shown. See the section for each type for a detailed description of the displayed information.

The only legal way to create an element of any structured Convex type is to use an appropriate function of the Convex package. Never apply to these types a Maple function that changes the operands of a Maple expression like subs or subsop. The result of retrieving an operand of an expression of a structured Convex type is not defined.

A consequence of the reduced information displayed for structured Convex types (and of the way Maple displays results) is that sets of structured Convex types may be displayed incorrectly. The reason is that when displaying a set, Maple forms the set of the displayed information of the elements. Hence, sets may seem to have fewer elements than they actually do:

P1 := convhull([1, 0]); P2 := convhull([0, 1]);
P1 := POLYTOPE(2,0,1,1)
P2 := POLYTOPE(2,0,1,1)
S := {P1, P2}; nops(S);
S := {POLYTOPE(2,0,1,1)}
2

Structured Convex types may represent the same mathematical object without being equal as Maple expression. (See CONE[&=] for an example.) Therefore, always use the comparison operators &= and &<> provided for each type unless you are really interested in the Maple expressions themselves. The latter case may occur for domains of objects, see for example CFACE[domain].

CONE
A CONE represents a rational polyhedral cone. It may contain lines or may not be full-dimensional.

A CONE is displayed is the following form:

CONE(ambient_dim, dim, dim_lineality, no_rays, no_facets)
The lineality space is the largest linear subspace contained in the cone. If this is the origin, the cone is called pointed. See CONE[ambientdim], CONE[dim], CONE[lines], CONE[rays], CONE[hplanes] and CONE[hspaces].

Cones admit two descriptions, namely as the positive hull of (lines and) rays or as the intersection of (hyperplanes and) halfspaces. Transforming one representation into the other is known as dualization. This may take a lot of time. In the Convex package, a CONE data structure always contains both description (as well as the incidence matrix). That means that a missing description is computed when the CONE is defined, for example by poshull or intersection. Once a cone has been created, it takes practically no time at all to "compute" its dual with the function CONE[dual] - internally only the operands of the CONE data structure are swapped. As a consequence, only define a CONE when you really need both descriptions. For example, if a cone is given as the positive hull of rays, then you do not need to create a CONE to compute its dimension because this equals the dimension of the linear hull of the rays, and linear algebra is much faster.

Subtypes

CONE0
A pointed cone, that is, a cone not containing any line.
CONE1
A cone with at least one ray. Note that a cone representing a linear subspace has no rays.
CFACE
A CFACE represents a face of a cone. This is of course again a cone, but a CFACE knows which cone it belongs to, its so-called "domain".

A CFACE is displayed in the following form:

CFACE(no_rays, no_facets)
where no_rays is the number of rays contained in the face (this is the numbers of rays of the face), and no_facets is the number of facets of the domain containing the face. This is not the number of facets of the face, considered as a cone by itself. The domain of the CFACE is not displayed. See CFACE[rays], CFACE[raynos], CFACE[hspaces], CFACE[hspacenos] and CFACE[domain].
FAN
A FAN represents a fan. A fan F is a non-empty finite collection of cones such that all faces of a cone in F are again in F, as are the intersection of any two cones in F. Note that we do not require the elements of a fan to be pointed. See also CONE[arecompatible].

A FAN is displayed in the following form:

FAN(ambient_dim, dim_lineality, [no_dim_1, ..., no_dim_max])
where ambient_dim is the dimension of the ambient space and dim_lineality the dimension of the common lineality space of all elements of the fan. The list displayed at the end lists the number of maximal cones in each dimension. Maximal cones in dimension 0 are not listed. (They occur if and only if the fan has this zerocone as only element.) See also FAN[ambientdim], FAN[lines], and FAN[maximal].

Subtypes

FAN0
A pointed fan. See FAN[ispointed].
FANCONE
A FANCONE is a CONE that belongs to some FAN. This FAN is called the domain of the FANCONE. The relation between FANCONE and FAN is very much like that between CFACE and CONE. Note that any FANCONE is also of type CONE. Hence, any function defined for a CONE can be applied to a FANCONE. See also FANCONE[domain].

A FANCONE is displayed the same way a CONE is, apart from the leading word FANCONE instead of CONE.

POLYHEDRON
A POLYHEDRON represents a rational polyhedron. (We always assume that polyhedra are convex.) It may be empty or unbounded, may contain lines or not be full-dimensional. Bounded polyhedra are called polytopes.

The displayed information of a POLYHEDRON depends on whether it is bounded or not. See the POLYTOPE section for the bounded case (which is easier). An unbounded polyhedron P is displayed in the following form:

POLYHEDRON(ambient_dim, dim, dim_lineality, [no_vertices, no_rays], no_facets)
The lineality space is the largest affine subspace contained in P. The polyhedron is called pointed if this space is 0-dimensional. The vertices of a pointed polyhedron P are its 0-dimensional faces, and the rays of P the unbounded edges, i.e., the unbounded 1-faces. If P is not pointed, then one divides out the lineality space before counting. If the last argument, the number of facets, is given in brackets, then P has a "facet at infinity". This means that the homogenization of P has a (not 0-dimensional) facet spanned entirely by rays of P. In other words, this means that the lines and rays of P span a cone of the same positive dimension as P. See POLYHEDRON[ambientdim], POLYHEDRON[dim], POLYHEDRON[lines], POLYHEDRON[vertices], POLYHEDRON[rays], POLYHEDRON[hplanes], POLYHEDRON[hspaces] and POLYHEDRON[recession].

Analogous to cones, polyhedra can be described as the intersection of affine (hyperplanes and) halfspaces, or as the convex hull of (lines and) points and rays. Internally, both description are stored in a POLYHEDRON data structure, cf. the discussion in the CONE section. A difference to cones is that dualization of polyhedra involves intersection with the "halfspace at infinity". This is almost for free if the origin is contained in the polyhedron, but can be time-consuming otherwise.

Subtypes

POLYTOPE
A bounded (or equivalently, compact) polyhedron. (Recall that we assume all polyhedra to be convex.)

A POLYTOPE is displayed in the following form:

POLYTOPE(ambient_dim, dim, no_vertices, no_facets)
See POLYHEDRON[ambientdim], POLYHEDRON[dim], POLYHEDRON[vertices] and POLYHEDRON[hspaces].

POLYTOPE is really a subtype of POLYHEDRON, although polytopes are displayed differently from unbounded polyhedra. In particular, it is not possible to replace function calls of the form POLYHEDRON[function](P) by POLYTOPE[function](P).

POLYHEDRON1
A non-empty polyhedron.
POLYTOPE1
A non-empty polytope.
POLYHEDRON0
A polyhedron containing the origin.
POLYTOPE0
A polytope containing the origin.
POLYHEDRON_0
A polyhedron containing the origin in its relative interior.
POLYTOPE_0
A polytope containing the origin in its relative interior.
POLYHEDRON__0
A polyhedron containing the origin in its interior.
POLYTOPE__0
A polytope containing the origin in its interior.
PFACE
A PFACE represents a face of a polyhedron. This is of course again a polyhedron, but a PFACE knows which polyhedron it belongs to, its so-called "domain".

A PFACE is displayed in the following form:

PFACE(no_vertices_rays, no_facets)
where no_vertices_rays is the number of vertices and rays contained in the face (this is the numbers of vertices and rays of the face), and no_facets is the number of facets of the domain containing the face (including a possible "facet at infinity"). This is not the number of facets of the face, considered as a polyhedron by itself. The domain of the PFACE is not displayed. See PFACE[vertices], PFACE[rays] and PFACE[domain].

Subtypes

PFACE1
A non-empty PFACE.
PCOMPLEX
A PCOMPLEX represents a polyhedral complex. A polyhedral complex PC is a non-empty finite collection of polyhedra such that all faces of a polyhedron in PC are again in PC, as are the intersection of any two polyhedra in PC. (This is a generalization of simplicial complexes.) Note that we do not require elements of a polyhedral complex to be pointed. See also POLYHEDRON[arecompatible] and PCOMPLEX[ispointed].

The way a PCOMPLEX is displayed depends on whether it is bounded or not, that is, whether it only contains polytopes or not. (See PCOMPLEX[isbounded].) A bounded PCOMPLEX is displayed in the following form:

PCOMPLEX(ambient_dim, [no_dim_0, ..., no_dim_max])
where ambient_dim is the dimension of the ambient space, and the list shows the number of maximal polytopes in each dimension.

An unbounded PCOMPLEX is displayed as

PCOMPLEX(ambient_dim, dim_lineality, [no_dim_0, ..., no_dim_max])
where dim_lineality is the dimension of the common lineality of the polyhedra if it exists, and FAIL otherwise (see PCOMPLEX[lines] for an example).

Maximal polyhedra in dimension -1 are not listed. (They occur if and only if the polyhedral complex is empty.)

CELL
A CELL is a POLYHEDRON that belongs to some PCOMPLEX. This PCOMPLEX is called the domain of the CELL. The relation between CELL and PCOMPLEX is very much like that between PFACE and POLYHEDRON. Note that any CELL is also of type POLYHEDRON. Hence, any function defined for a POLYHEDRON can be applied to a CELL. See also CELL[domain].

A CELL is displayed the same way a POLYTOPE or POLYHEDRON is. Hence bounded cells differ from unbounded ones by the shorter list of displayed arguments:

PC := pcomplex(convert(posorthant(2), affine));
PC := PCOMPLEX(2,[0, 0, 1])
We select an unbounded polyhedron:
support(PC, [1, 3]);
CELL(2,2,0,[1, 2],[2])
And a polytope:
support(PC, [0, 0]);
CELL(2,0,1,1)
MODZ
A MODZ represents an Abelian group (or finitely generated Z-module). They appear as the result of an integral homology computation, see for example PCOMPLEX[homology].

A MODZ is displayed more or less as usual in mathematics. The only difference might be that the Convex package uses linear combinations to denote multiplicities. For instance, the output

3Z+2Z[2]+Z[6]
means the direct sum of 3 copies of Z, 2 copies of Z/2Z and one copy of Z/6Z. (Recall that the graphical versions of Maple display indices as subscripts.) The torsion part is always given by a chain of elementary divisors. In particular, two MODZs are equal if and only if they have the same displayed information (up to order of the summands).