Union-find data structure for representing disjoint sets of elements with few very quick operations: 1) union of two sets in one, 2) checking whether two elements pertain to the same set, 3) finding representative element (root) of each set by any set's element. Sequential implementation that selects the root of a united pair by set size for best performance. More...
Static Public Member Functions | |
| static meshlib.UnionFind_MR_VertId | staticDowncastFromBaseUnionFind_MR_VertId (meshlib.BaseUnionFind_MR_VertId object) |
Additional Inherited Members | |
| Protected Member Functions inherited from meshlib.CppObject | |
| CppObject (java.lang.foreign.MemorySegment ptr, java.util.function.Consumer< java.lang.foreign.MemorySegment > destroy, java.lang.Object owner) | |
Union-find data structure for representing disjoint sets of elements with few very quick operations: 1) union of two sets in one, 2) checking whether two elements pertain to the same set, 3) finding representative element (root) of each set by any set's element. Sequential implementation that selects the root of a united pair by set size for best performance.
| I | is the identifier of a set's element, e.g. FaceId |
Generated from class MR::UnionFind<MR::VertId>. Base classes: Direct: (non-virtual) MR::BaseUnionFind<MR::VertId>
Instances created here own their C++ objects, see CppObject.
| meshlib.UnionFind_MR_VertId.UnionFind_MR_VertId | ( | java.lang.foreign.MemorySegment | ptr, |
| boolean | owned, | ||
| java.lang.Object | owner ) |
Wraps a pointer from the C bindings. If owned, the object is destroyed when the wrapper dies. owner is kept alive as long as this wrapper is. Not for normal use.
| meshlib.UnionFind_MR_VertId.UnionFind_MR_VertId | ( | ) |
Constructs an empty (default-constructed) instance.
Calls MR_UnionFind_MR_VertId_DefaultConstruct().
| meshlib.UnionFind_MR_VertId.UnionFind_MR_VertId | ( | meshlib.UnionFind_MR_VertId | _other | ) |
Generated from constructor MR::UnionFind<MR::VertId>::UnionFind. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.
Calls MR_UnionFind_MR_VertId_ConstructFromAnother().
| meshlib.UnionFind_MR_VertId.UnionFind_MR_VertId | ( | long | size | ) |
creates union-find with given number of elements, each element is the only one in its disjoint set Generated from constructor MR::UnionFind<MR::VertId>::UnionFind. The reference to the parameter size might be preserved in the constructed object.
Calls MR_UnionFind_MR_VertId_Construct_size_t().
| meshlib.UnionFind_MR_VertId.UnionFind_MR_VertId | ( | meshlib.BaseUnionFind_MR_VertId | base | ) |
adopts the parent forest of a base/parallel union-find and (re)computes set sizes, so the result supports the full sequential interface (e.g. unite, sizeOfComp) Generated from constructor MR::UnionFind<MR::VertId>::UnionFind. The reference to the parameter base might be preserved in the constructed object.
Calls MR_UnionFind_MR_VertId_Construct_MR_BaseUnionFind_MR_VertId().
| meshlib.VertId meshlib.UnionFind_MR_VertId.add | ( | ) |
adds new element in its own disjoint set, returns its identifier Generated from method MR::UnionFind<MR::VertId>::add.
Calls MR_UnionFind_MR_VertId_add().
| meshlib.UnionFind_MR_VertId meshlib.UnionFind_MR_VertId.assignFromAnother | ( | meshlib.UnionFind_MR_VertId | _other | ) |
Generated from method MR::UnionFind<MR::VertId>::operator=. The reference to things referred to by the parameter _other (if any) might be preserved in this object.
Calls MR_UnionFind_MR_VertId_AssignFromAnother().
| meshlib.VertId meshlib.UnionFind_MR_VertId.find | ( | meshlib.VertId | a | ) |
finds the root of the set containing given element with optimizing data structure updates Generated from method MR::UnionFind<MR::VertId>::find.
Calls MR_UnionFind_MR_VertId_find().
| meshlib.VertId meshlib.UnionFind_MR_VertId.findUpdateRange | ( | meshlib.VertId | a, |
| meshlib.VertId | begin, | ||
| meshlib.VertId | end ) |
finds the root of the set containing given element with optimizing data structure in the range [begin, end) Generated from method MR::UnionFind<MR::VertId>::findUpdateRange.
Calls MR_UnionFind_MR_VertId_findUpdateRange().
| boolean meshlib.UnionFind_MR_VertId.isRoot | ( | meshlib.VertId | a | ) |
returns true if given element is the root of some set Generated from method MR::UnionFind<MR::VertId>::isRoot.
Calls MR_UnionFind_MR_VertId_isRoot().
| meshlib.VertId meshlib.UnionFind_MR_VertId.parent | ( | meshlib.VertId | a | ) |
return parent element of this element, which is equal to given element only for set's root Generated from method MR::UnionFind<MR::VertId>::parent.
Calls MR_UnionFind_MR_VertId_parent().
| meshlib.VertMap meshlib.UnionFind_MR_VertId.parents | ( | ) |
gets the parents of all elements as is Generated from method MR::UnionFind<MR::VertId>::parents.
Calls MR_UnionFind_MR_VertId_parents().
| void meshlib.UnionFind_MR_VertId.reset | ( | long | size | ) |
resets union-find to represent given number of elements, each element is the only one in its disjoint set Generated from method MR::UnionFind<MR::VertId>::reset.
Calls MR_UnionFind_MR_VertId_reset().
| meshlib.VertMap meshlib.UnionFind_MR_VertId.roots | ( | ) |
sets the root of corresponding set as the parent of each element, then returns the vector Generated from method MR::UnionFind<MR::VertId>::roots.
Calls MR_UnionFind_MR_VertId_roots().
| long meshlib.UnionFind_MR_VertId.size | ( | ) |
returns the number of elements in union-find Generated from method MR::UnionFind<MR::VertId>::size.
Calls MR_UnionFind_MR_VertId_size().
| int meshlib.UnionFind_MR_VertId.sizeOfComp | ( | meshlib.VertId | a | ) |
returns the number of elements in the set containing given element Generated from method MR::UnionFind<MR::VertId>::sizeOfComp.
Calls MR_UnionFind_MR_VertId_sizeOfComp().
|
static |
Static downcast from the base class MR::BaseUnionFind<MR::VertId>. Undefined behavior if the object isn't actually a UnionFind_MR_VertId. The result refers to object.
Calls MR_UnionFind_MR_VertId_MutableStaticDowncastFrom_MR_BaseUnionFind_MR_VertId().
| meshlib.std_pair_MR_VertId_bool meshlib.UnionFind_MR_VertId.unite | ( | meshlib.VertId | first, |
| meshlib.VertId | second ) |
unite two elements,
Calls MR_UnionFind_MR_VertId_unite().
| boolean meshlib.UnionFind_MR_VertId.united | ( | meshlib.VertId | first, |
| meshlib.VertId | second ) |
returns true if given two elements are from one set Generated from method MR::UnionFind<MR::VertId>::united.
Calls MR_UnionFind_MR_VertId_united().
| meshlib.std_pair_MR_VertId_bool meshlib.UnionFind_MR_VertId.uniteUnbalanced | ( | meshlib.VertId | first, |
| meshlib.VertId | second ) |
unites the two sets containing given elements WITHOUT balancing by set size (BaseUnionFind keeps no sizes): it simply attaches one set's root under the other's, so chained calls can build taller trees. Prefer UnionFind::unite, which selects the new root by set size, when many unions follow one another.
Calls MR_UnionFind_MR_VertId_uniteUnbalanced().
| meshlib.BaseUnionFind_MR_VertId meshlib.UnionFind_MR_VertId.upcastToBaseUnionFind_MR_VertId | ( | ) |
Upcasts to the base class MR::BaseUnionFind<MR::VertId>. The result refers to this object.
Calls MR_UnionFind_MR_VertId_MutableUpcastTo_MR_BaseUnionFind_MR_VertId().