cgv
|
A union find data structure. More...
#include <union_find.h>
Public Member Functions | |
union_find (int N) | |
N number of all elements. | |
~union_find () | |
destructor | |
int | num_of_components () |
number of sets (initially number of all elements) | |
int | num_in_set (int x) |
int | first_set () |
int | next_set (int x) |
int | find (int x) |
return label number of element x | |
void | unite (int p, int q) |
unite the set containing p with the set containing q (if p and q are in the same set, nothing is done) | |
bool | find (int p, int q) |
check wether p and q are in the same set | |
Public Attributes | |
int * | sz |
int * | id |
int | components |
int | N |
A union find data structure.
Definition at line 8 of file union_find.h.
|
inline |
N number of all elements.
Definition at line 16 of file union_find.h.
|
inline |
destructor
Definition at line 29 of file union_find.h.
|
inline |
check wether p and q are in the same set
Definition at line 94 of file union_find.h.
References find().
|
inline |
return label number of element x
Definition at line 70 of file union_find.h.
|
inline |
Definition at line 49 of file union_find.h.
|
inline |
Definition at line 57 of file union_find.h.
|
inline |
Definition at line 42 of file union_find.h.
|
inline |
number of sets (initially number of all elements)
Definition at line 36 of file union_find.h.
|
inline |
unite the set containing p with the set containing q (if p and q are in the same set, nothing is done)
Definition at line 83 of file union_find.h.
References find().
int cgv::math::union_find::components |
Definition at line 12 of file union_find.h.
int* cgv::math::union_find::id |
Definition at line 11 of file union_find.h.
int cgv::math::union_find::N |
Definition at line 13 of file union_find.h.
int* cgv::math::union_find::sz |
Definition at line 10 of file union_find.h.