25 #ifndef __MLPACK_METHODS_EMST_UNION_FIND_HPP
26 #define __MLPACK_METHODS_EMST_UNION_FIND_HPP
50 for (
size_t i = 0; i < size; ++i)
66 size_t Find(
const size_t x)
86 void Union(
const size_t x,
const size_t y)
88 const size_t xRoot =
Find(x);
89 const size_t yRoot =
Find(y);
114 #endif // __MLPACK_METHODS_EMST_UNION_FIND_HPP
UnionFind(const size_t size)
Construct the object with the given size.
A Union-Find data structure.
arma::Col< size_t > parent
void Union(const size_t x, const size_t y)
Union the components containing x and y.
size_t Find(const size_t x)
Returns the component containing an element.
~UnionFind()
Destroy the object (nothing to do).