Methodology Topology for Computing
typedef enum {kAlphaShapeFilter, kGridFilter} filterType;
typedef struct _filterT { simplexT structured;
simplexT simplices; simplexT simplexArray;
int filterLen; int numSimplices;
Topology void topology;
Topology Function Pointers Geometry Functionality
filterType type;
} filterT; Fig. 11.5. An excerpt of the filtration data structure
filterT .
1 2
1
2
5
filterloc link
cIndex link
cIndex next
filterloc link
cIndex next
4 3
simplices
next 3
−1 filterloc
link filterloc
link cIndex
next filterloc
1 7
3 2
9 17
4 −1
2 1
cIndex 1
1 1
2
structured
simplexArray
next
1 2
filterloc link
cIndex next
Fig. 11.6. A diagram of filterT
for a small filtration.
its link
field and its own current location in the filtration in its filterloc
field. This design is very flexible, allowing different topological and geometric
representations for the filtered complex. The simplices are stored in the three arrays:
structured ,
simplices , and
simplexArray . Figure 11.6
shows the filter for a small filtration. The filtration diagrammed has six sim- plices, so
numSimplices is six. The first two simplices arrive at time 0, the
next three at time 1, and the last at time 2. So, the filtration has filterLen
equal to 3. The structured filtration is laid flat in simplexArray
, accord- ing to the filtration ordering. Note that, as of now, the
next pointers of the
simplices in simplexArray
are redundant, as the information they contain is implicit in their order in the array and the pointers in
structured . The
next pointers will be necessary for reordering the filtration, however. Also, if
only a single simplex enters at a time, structured
is not necessary, so it is not used.
A reordering algorithm changes the next
pointers, as well as the point- ers in
simplices to derive a reordered filtration. The algorithm always
recovers the initial filtration before reordering. The recovery is through ac- cessing
structured , or assuming that a single simplex enters at each time
slot whenever structured
is NULL
.
Topology To compute persistence,
filterT requires some topological func-
tionality from the derived ADTs. Recall from Section 7.2.1 that the persistence algorithm searches for the youngest simplex in a list of positive simplices
Γ. Initially,
Γ is a subset of the boundary of a negative simplex. To compute Γ, we need a routine that gives us the faces of a simplex. We also need both the faces
and cofaces of a simplex for the union-find algorithm. To identify simplices, the derived ADTs must assign a unique index to each simplex and store it in
the cIndex
connectivity index field. Each derived ADT will use its own scheme to compute this index.
Geometry To visualize persistent complexes,
filterT also requires some
geometric functionality from the derived ADTs. There are two main routines: an initialization procedure and a routine to draw a simplex. This design has the
drawback that rendering code is included in each derived ADT. However, the design allows each type of filtration to optimize simplex rendering.