#include <UnionFind.h>
Public Member Functions | |
std::size_t | find (std::size_t x) |
void | grow (const std::size_t n=1) |
Enlarges the data structure by n elements. More... | |
void | merge (std::size_t x, std::size_t y) |
std::size_t | size () const |
UnionFind (const std::size_t n) | |
Private Attributes | |
std::vector< std::size_t > | m_parent |
std::vector< std::size_t > | m_rank |
A very simple union-find data structure for clustering on the set of indices 0..(n-1).
Definition at line 34 of file UnionFind.h.
|
inline |
Definition at line 37 of file UnionFind.h.
|
inline |
Definition at line 88 of file UnionFind.h.
|
inline |
Enlarges the data structure by n elements.
Definition at line 47 of file UnionFind.h.
|
inline |
Not calling this "union" because of the obvious clash with the C++ keyword.
Definition at line 61 of file UnionFind.h.
|
inline |
Definition at line 101 of file UnionFind.h.
|
private |
Definition at line 104 of file UnionFind.h.
|
private |
Definition at line 105 of file UnionFind.h.