`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.
C := poshull(Vector([1/2, 1/3])); rays(C); |
C := poshull(line(vector([-6, 4]))); lines(C); |
`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])); |
Likewise, whenever a Convex function returns a ray ray(v), the argument v is of the same form as above.
`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])); |
The same applies to expressions of type line returned by Convex functions.
`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.
`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.
`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.
P := preimage(fullpolyhedron(0), []); |
P := preimage(fullpolyhedron(0), Matrix(0, 2)); P &= fullpolyhedron(2); |
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]); |
S := {P1, P2}; nops(S); |
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].
A CONE is displayed is the following form:
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.
A CFACE is displayed in the following form:
A FAN is displayed in the following form:
A FANCONE is displayed the same way a CONE is, apart from the leading word FANCONE instead of CONE.
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:
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.
A POLYTOPE is displayed in the following form:
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).
A PFACE is displayed in the following form:
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:
An unbounded PCOMPLEX is displayed as
Maximal polyhedra in dimension -1 are not listed. (They occur if and only if the polyhedral complex is empty.)
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)); |
support(PC, [1, 3]); |
support(PC, [0, 0]); |
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