Implements the Union Find Datastructure to maintain disjoint sets efficiently.
More...
#include <ogdf/geometric/cr_min/datastructure/UnionFind.h>
|
| UnionFind (unsigned int max_element) |
| Create a new set representation with not more than max_element elements. More...
|
|
void | all_to_singletons () |
| Assigns every element to a singleton set. More...
|
|
unsigned int | find (unsigned int u) |
| Find the representative to element u . More...
|
|
void | merge (unsigned int u, unsigned int v) |
| Merge the two sets containing u and v . More...
|
|
unsigned int | operator[] (unsigned int u) |
|
Implements the Union Find Datastructure to maintain disjoint sets efficiently.
Definition at line 45 of file UnionFind.h.
◆ UnionFind()
ogdf::internal::gcm::datastructure::UnionFind::UnionFind |
( |
unsigned int |
max_element | ) |
|
|
inline |
Create a new set representation with not more than max_element
elements.
Initialy every element is in its own set.
- Parameters
-
max_element | maximum number of elements |
Definition at line 55 of file UnionFind.h.
◆ all_to_singletons()
void ogdf::internal::gcm::datastructure::UnionFind::all_to_singletons |
( |
| ) |
|
|
inline |
Assigns every element to a singleton set.
Set id is equal to element id.
Definition at line 63 of file UnionFind.h.
◆ find()
unsigned int ogdf::internal::gcm::datastructure::UnionFind::find |
( |
unsigned int |
u | ) |
|
|
inline |
Find the representative to element u
.
- Parameters
-
- Returns
- representative of set containing
u
Definition at line 70 of file UnionFind.h.
◆ merge()
void ogdf::internal::gcm::datastructure::UnionFind::merge |
( |
unsigned int |
u, |
|
|
unsigned int |
v |
|
) |
| |
|
inline |
Merge the two sets containing u
and v
.
- Parameters
-
Definition at line 87 of file UnionFind.h.
◆ operator[]()
unsigned int ogdf::internal::gcm::datastructure::UnionFind::operator[] |
( |
unsigned int |
u | ) |
|
|
inline |
◆ data
std::vector<int> ogdf::internal::gcm::datastructure::UnionFind::data |
|
private |
The documentation for this class was generated from the following file:
- include/ogdf/geometric/cr_min/datastructure/UnionFind.h