|
Blender V5.3
|
#include <BLI_disjoint_set.hh>
Public Member Functions | |
| DisjointSet (const int64_t size) | |
| T | join (const T x, const T y) |
| bool | in_same_set (const T x, const T y) |
| T | find_root (const T x) |
| T | find_root (const T x) const |
Definition at line 18 of file BLI_disjoint_set.hh.
|
inline |
Create a new disjoint set with the given size. Initially, every element is in a separate set.
Definition at line 27 of file BLI_disjoint_set.hh.
References blender::BLI_assert(), blender::IndexRange::IndexRange(), and T.
|
inline |
Find the element that represents the set containing x currently.
Definition at line 75 of file BLI_disjoint_set.hh.
References T, and blender::x.
Referenced by in_same_set(), join(), blender::ntree_update_reroute_nodes(), and blender::tests::TEST().
|
inline |
Same as above but intended to be threadsafe. Better to use even if this is expected to be not an issue.
Definition at line 98 of file BLI_disjoint_set.hh.
References T, and blender::x.
|
inline |
Return true when x and y are in the same set.
Definition at line 65 of file BLI_disjoint_set.hh.
References find_root(), T, blender::x, and y.
Referenced by blender::tests::TEST().
Join the sets containing elements x and y. Nothing happens when they have been in the same set before. Shared root is returned.
Definition at line 39 of file BLI_disjoint_set.hh.
References find_root(), T, blender::x, and y.
Referenced by blender::ntree_update_reroute_nodes(), and blender::tests::TEST().