#include <disjoint_set.h>
Classes | |
struct | DisjointSetNode |
struct | SimpleObjHashFunc |
Public Member Functions | |
DisjointSet () | |
OBJECT_TYPE * | FindSet (OBJECT_TYPE *x) |
void | MakeSet (OBJECT_TYPE *x) |
void | Union (OBJECT_TYPE *x, OBJECT_TYPE *y) |
Protected Attributes | |
std::vector< DisjointSetNode > | nodes |
Private Types | |
typedef std::pair< hIterator, bool > | hInsertResult |
typedef STDEXT::hash_map < ObjectPointer, int, SimpleObjHashFunc >::iterator | hIterator |
typedef std::pair < ObjectPointer, int > | hPair |
typedef OBJECT_TYPE * | ObjectPointer |
Private Member Functions | |
void | Link (OBJECT_TYPE *x, OBJECT_TYPE *y) |
Private Attributes | |
STDEXT::hash_map< OBJECT_TYPE *, int, SimpleObjHashFunc > | inserted_objects |
Given a set of elements, it is often useful to break them up or partition them into a number of separate, nonoverlapping groups. A disjoint-set data structure is a data structure that keeps track of such a partitioning. See Diskoint-set data structure on Wikipedia for more details.
Definition at line 66 of file disjoint_set.h.
typedef std::pair< hIterator, bool > vcg::DisjointSet< OBJECT_TYPE >::hInsertResult [private] |
Definition at line 94 of file disjoint_set.h.
typedef STDEXT::hash_map< ObjectPointer, int, SimpleObjHashFunc >::iterator vcg::DisjointSet< OBJECT_TYPE >::hIterator [private] |
Definition at line 91 of file disjoint_set.h.
typedef std::pair< ObjectPointer, int > vcg::DisjointSet< OBJECT_TYPE >::hPair [private] |
Definition at line 80 of file disjoint_set.h.
typedef OBJECT_TYPE* vcg::DisjointSet< OBJECT_TYPE >::ObjectPointer [private] |
Definition at line 79 of file disjoint_set.h.
vcg::DisjointSet< OBJECT_TYPE >::DisjointSet | ( | ) | [inline] |
Default constructor
Definition at line 105 of file disjoint_set.h.
OBJECT_TYPE* vcg::DisjointSet< OBJECT_TYPE >::FindSet | ( | OBJECT_TYPE * | x | ) | [inline] |
Determine which group a particular element is in.
Definition at line 131 of file disjoint_set.h.
void vcg::DisjointSet< OBJECT_TYPE >::Link | ( | OBJECT_TYPE * | x, | |
OBJECT_TYPE * | y | |||
) | [inline, private] |
Definition at line 144 of file disjoint_set.h.
void vcg::DisjointSet< OBJECT_TYPE >::MakeSet | ( | OBJECT_TYPE * | x | ) | [inline] |
Makes a group containing only a given element (a singleton).
Definition at line 110 of file disjoint_set.h.
void vcg::DisjointSet< OBJECT_TYPE >::Union | ( | OBJECT_TYPE * | x, | |
OBJECT_TYPE * | y | |||
) | [inline] |
Combine or merge two groups into a single group.
Definition at line 121 of file disjoint_set.h.
STDEXT::hash_map< OBJECT_TYPE*, int, SimpleObjHashFunc > vcg::DisjointSet< OBJECT_TYPE >::inserted_objects [private] |
Definition at line 90 of file disjoint_set.h.
std::vector< DisjointSetNode > vcg::DisjointSet< OBJECT_TYPE >::nodes [protected] |
Definition at line 162 of file disjoint_set.h.