Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

3 The new GAP object types of simpcomp
 3.1 Accessing properties of a SCPolyhedralComplex object

3 The new GAP object types of simpcomp

In order to meet the particular requirements of piecewise linear geometric objects and their invariants, simpcomp defines a number of new GAP object types.

All new object types are derived from the object type SCPropertyObject which is a subtype of Record. It is a GAP object consisting of permanent and temporary attributes. While simpcomp makes use of GAP's internal attribute caching mechanism for permanent attributes (see below), this is not the case for temporary ones.

The temporary properties of a SCPropertyObject can be accessed directly with the functions SCPropertyTmpByName and changed with SCPropertyTmpSet. But this direct access to property objects is discouraged when working with simpcomp, as the internal consistency of the objects cannot be guaranteed when the properties of the objects are modified in this way.

Important note: The temporary properties of SCPropertyObject are not used to hold properties (in the GAP sense) of simplicial complexes or other geometric objects. This is done by the GAP4 type system [BL98]. Instead, the properties handled by simpcomp's own caching mechanism are used to store changing information, e.g. the complex library (see Section 13) of the package or any other data which possibly is subject to changes (and thus not suited to be stored by the GAP type system).

To realize its complex library (see Section 13), simpcomp defines a GAP object type SCLibRepository which provides the possibility to store, load, etc. any defined geometric object to and from the build-in complex library as well as customized user libraries. In addition, a searching mechanism is provided.

Geometric objects are represented by the GAP object type SCPolyhedralComplex, which as well is a subtype of SCPropertyObject. SCPolyhedralComplex is designed to represent any kind of piecewise linear geometric object given by a certain cell decomposition. Here, as already mentioned, the GAP4 type system [BL98] is used to cache properties of the object. In this way, a property is not calculated multiple times in case the object is not altered (see SCPropertiesDropped (5.1-4) for a way of dropping previously calculated properties).

As of Version 1.4, simpcomp makes use of two different subtypes of SCPolyhedralComplex: SCSimplicialComplex to handle simplicial complexes and SCNormalSurface to deal with discrete normal surfaces (slicings of dimension 2). Whenever possible, only one method per operations is implemented to deal with all subtypes of SCPolyhedralComplex, these functions are described in Chapter 4. For all other operations, the different methods for SCSimplicialComplex and SCNormalSurface are documented separately.

3.1 Accessing properties of a SCPolyhedralComplex object

As described above the object type SCPolyhedralComplex (and thus also the GAP object types SCSimplicialComplex and SCNormalSurface) has properties that are handled by the GAP4 type system. Hence, GAP takes care of the internal consistency of objects of type SCSimplicialComplex.

There are two ways of accessing properties of a SCPolyhedralComplex object. The first is to call a property handler function of the property one wishes to calculate. The first argument of such a property handler function is always the simplicial complex for which the property should be calculated, in some cases followed by further arguments of the property handler function. An example would be:

gap> c:=SCBdSimplex(3);; # create a SCSimplicialComplex object

gap> SCFVector(c);

[ 4, 6, 4 ]
gap> SCSkel(c,0);

[ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]

Here the functions SCFVector and SCSkel are the property handler functions, see Chapter 16 for a list of all property handlers of a SCPolyhedralComplex, SCSimplicialComplex or SCNormalSurface object. Apart from this (standard) method of calling the property handlers directly with a SCPolyhedralComplex object, simpcomp provides the user with another more object oriented method which calls property handlers of a SCPolyhedralComplex object indirectly and more conveniently:

gap> c:=SCBdSimplex(3);; # create a SCSimplicialComplex object

gap> c.F;

[ 4, 6, 4 ]
gap> c.Skel(0);

[ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ]

Note that the code in this example calculates the same properties as in the first example above, but the properties of a SCPolyhedralComplex object are accessed via the . operator (the record access operator).

For each property handler of a SCPolyhedralComplex object the object oriented form of this property handler equals the name of the corresponding operation. However, in most cases abbreviations are available: Usually the prefix ``SC'' can be dropped, in other cases even shorter names are available. See Chapter 16 for a complete list of all abbreviations available.

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Bib Ind

generated by GAPDoc2HTML