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...
|
| unsafe | UnionFind_MRUndirectedEdgeId () |
| | Constructs an empty (default-constructed) instance.
|
| unsafe | UnionFind_MRUndirectedEdgeId (MR._ByValue_UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| | UnionFind_MRUndirectedEdgeId (Const_UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| | UnionFind_MRUndirectedEdgeId (UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| unsafe | UnionFind_MRUndirectedEdgeId (nuint 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.UndirectedEdgeId>::UnionFind.
|
| unsafe | UnionFind_MRUndirectedEdgeId (MR.Misc._Moved< MR.BaseUnionFind_MRUndirectedEdgeId > 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.UndirectedEdgeId>::UnionFind.
|
| unsafe MR.UnionFind_MRUndirectedEdgeId | assign (MR._ByValue_UnionFind_MRUndirectedEdgeId _other) |
| | Generated from method MR::UnionFind<MR.UndirectedEdgeId>::operator=.
|
| unsafe void | reset (nuint 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.UndirectedEdgeId>reset.
|
| unsafe MR.Std.Pair_MRUndirectedEdgeId_Bool | unite (MR.UndirectedEdgeId first, MR.UndirectedEdgeId second) |
| | unite two elements,
|
| unsafe int | sizeOfComp (MR.UndirectedEdgeId a) |
| | returns the number of elements in the set containing given element Generated from method MR::UnionFind<MR.UndirectedEdgeId>sizeOfComp.
|
| unsafe MR.Std.Pair_MRUndirectedEdgeId_Bool | uniteUnbalanced (MR.UndirectedEdgeId first, MR.UndirectedEdgeId 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.
|
| unsafe bool | united (MR.UndirectedEdgeId first, MR.UndirectedEdgeId second) |
| | returns true if given two elements are from one set Generated from method MR::UnionFind<MR.UndirectedEdgeId>united.
|
| unsafe MR.UndirectedEdgeId | find (MR.UndirectedEdgeId a) |
| | finds the root of the set containing given element with optimizing data structure updates Generated from method MR::UnionFind<MR.UndirectedEdgeId>find.
|
| unsafe MR.UndirectedEdgeId | findUpdateRange (MR.UndirectedEdgeId a, MR.UndirectedEdgeId begin, MR.UndirectedEdgeId 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.UndirectedEdgeId>findUpdateRange.
|
| unsafe MR.Const_UndirectedEdgeMap | roots () |
| | sets the root of corresponding set as the parent of each element, then returns the vector Generated from method MR::UnionFind<MR.UndirectedEdgeId>roots.
|
| virtual void | Dispose () |
| unsafe | Const_UnionFind_MRUndirectedEdgeId () |
| | Constructs an empty (default-constructed) instance.
|
| unsafe | Const_UnionFind_MRUndirectedEdgeId (MR._ByValue_UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| | Const_UnionFind_MRUndirectedEdgeId (Const_UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| | Const_UnionFind_MRUndirectedEdgeId (UnionFind_MRUndirectedEdgeId _other) |
| | Generated from constructor MR::UnionFind<MR.UndirectedEdgeId>::UnionFind.
|
| unsafe | Const_UnionFind_MRUndirectedEdgeId (nuint 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.UndirectedEdgeId>::UnionFind.
|
| unsafe | Const_UnionFind_MRUndirectedEdgeId (MR.Misc._Moved< MR.BaseUnionFind_MRUndirectedEdgeId > 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.UndirectedEdgeId>::UnionFind.
|
| unsafe nuint | size () |
| | returns the number of elements in union-find Generated from method MR::UnionFind<MR.UndirectedEdgeId>size.
|
| unsafe bool | isRoot (MR.UndirectedEdgeId a) |
| | returns true if given element is the root of some set Generated from method MR::UnionFind<MR.UndirectedEdgeId>isRoot.
|
| unsafe MR.UndirectedEdgeId | parent (MR.UndirectedEdgeId a) |
| | return parent element of this element, which is equal to given element only for set's root Generated from method MR::UnionFind<MR.UndirectedEdgeId>parent.
|
| unsafe MR.Const_UndirectedEdgeMap | parents () |
| | gets the parents of all elements as is Generated from method MR::UnionFind<MR.UndirectedEdgeId>parents.
|
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.
- Template Parameters
-
| I | is the identifier of a set's element, e.g. FaceId Generated from class MR::UnionFind<MR.UndirectedEdgeId>. Base classes: Direct: (non-virtual) MR::BaseUnionFind<MR.UndirectedEdgeId> This is the non-const half of the class. |