The Conley-Morse Graphs Software
|
A multi-dimensional array with links forward/backward between the entries. More...
#include <matcharr.h>
Classes | |
struct | pair2 |
A small class whose objects store an IntType object and an int value. More... | |
Public Member Functions | |
MatchArray (int _dim, const CoordType *_sizes, const CoordType *_corner=0) | |
The only allowed constructor in which the size of the array and its dimension must be given. More... | |
~MatchArray () | |
The destructor. More... | |
void | join (const CoordType *x, const CoordType *y) |
Joins the chains corresponding to the two parameter n-tuples. More... | |
bool | joined (const CoordType *x, const CoordType *y) const |
Checks if the two parameters have already been joined, that is, if they belong to the same chain. More... | |
template<class CubeType > | |
void | saveClasses (std::vector< std::vector< CubeType > > &matchClasses) const |
Saves the equivalence classes larger than 1 element to the provided vector of vectors (the classes are appended). More... | |
void | saveSets (const char *prefix) const |
Saves the sets to separate files. Sorts the sets by their size. More... | |
Private Member Functions | |
MatchArray (const MatchArray< CoordType, IntType > &a) | |
The copy constructor is not allowed. More... | |
MatchArray & | operator= (const MatchArray< CoordType, IntType > &a) |
The assignment operator is not allowed. More... | |
void | link2coords (IntType link, CoordType *x) const |
Translates a flat offset array into a multidimensional one. More... | |
IntType | coords2link (const CoordType *x) const |
Computes the memory offset that corresponds to the given multidimensional position in the array. More... | |
void | getChains (std::vector< MatchArray< CoordType, IntType >::pair2 > &chains) const |
Retrieves a set of first elements of all the chains which have at least two elements. More... | |
void | saveSet (const char *prefix, int counter, int pos, CoordType *workspace, int ndigits) const |
Saves one set to a file. More... | |
void | join (IntType xpos, IntType ypos) |
Joins two sets, given the offsets in the flat arrays. More... | |
Private Attributes | |
IntType * | link1 |
Backward links for chains. More... | |
IntType * | link2 |
Forward links for chains. More... | |
IntType * | num |
The unique number for each chain. More... | |
CoordType * | sizes |
The size of the multi-dimensional array in each direction. More... | |
CoordType * | corner |
The coordinates of the minimal corner of the array if any. More... | |
int | dim |
The dimension of the array. More... | |
int | length |
The length of the allocated memory arrays. More... | |
A multi-dimensional array with links forward/backward between the entries.
Note that the type of integers provided as template's argument must be large enough to allow indexing of all the entries in a linear array.
Definition at line 59 of file matcharr.h.
|
inline |
The only allowed constructor in which the size of the array and its dimension must be given.
Optionally the coordinates of the minimal corner may be provided.
Definition at line 157 of file matcharr.h.
References MatchArray< CoordType, IntType >::coords2link(), MatchArray< CoordType, IntType >::corner, MatchArray< CoordType, IntType >::dim, MatchArray< CoordType, IntType >::length, MatchArray< CoordType, IntType >::link1, MatchArray< CoordType, IntType >::link2, MatchArray< CoordType, IntType >::num, and MatchArray< CoordType, IntType >::sizes.
|
inline |
The destructor.
Definition at line 226 of file matcharr.h.
|
inlineprivate |
The copy constructor is not allowed.
Definition at line 246 of file matcharr.h.
|
inlineprivate |
Computes the memory offset that corresponds to the given multidimensional position in the array.
Definition at line 270 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
inlineprivate |
Retrieves a set of first elements of all the chains which have at least two elements.
The list is sorted according to the lengths of the chains in the descending order.
Definition at line 376 of file matcharr.h.
|
inline |
Joins the chains corresponding to the two parameter n-tuples.
Definition at line 355 of file matcharr.h.
|
inlineprivate |
Joins two sets, given the offsets in the flat arrays.
Definition at line 283 of file matcharr.h.
|
inline |
Checks if the two parameters have already been joined, that is, if they belong to the same chain.
Returns "true" if yes, "false" if not.
Definition at line 363 of file matcharr.h.
|
inlineprivate |
Translates a flat offset array into a multidimensional one.
Definition at line 256 of file matcharr.h.
|
inlineprivate |
The assignment operator is not allowed.
Definition at line 238 of file matcharr.h.
|
inline |
Saves the equivalence classes larger than 1 element to the provided vector of vectors (the classes are appended).
The type of coordinates of the cube type must match "CoordType".
Definition at line 438 of file matcharr.h.
|
inlineprivate |
Saves one set to a file.
Definition at line 307 of file matcharr.h.
|
inline |
Saves the sets to separate files. Sorts the sets by their size.
Definition at line 404 of file matcharr.h.
|
private |
The coordinates of the minimal corner of the array if any.
Definition at line 110 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
The dimension of the array.
Definition at line 113 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
The length of the allocated memory arrays.
Definition at line 116 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
Backward links for chains.
Definition at line 97 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
Forward links for chains.
Definition at line 100 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
The unique number for each chain.
This is stored here to speed up the verification if two boxes are in the same chain.
Definition at line 104 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().
|
private |
The size of the multi-dimensional array in each direction.
Definition at line 107 of file matcharr.h.
Referenced by MatchArray< CoordType, IntType >::MatchArray().