Public Member Functions | |
| None | __init__ (self) |
| None | __init__ (self, BaseUnionFind_VertId arg0) |
| VertId | find (self, VertId a) |
| VertId | findUpdateRange (self, VertId a, VertId begin, VertId end) |
| bool | isRoot (self, VertId a) |
| VertId | parent (self, VertId a) |
| VertMap | parents (self) |
| None | reset (self, int size) |
| VertMap | roots (self) |
| int | size (self) |
| tuple[VertId, bool] | uniteUnbalanced (self, VertId first, VertId second) |
| bool | united (self, VertId first, VertId second) |
Static Public Member Functions | |
| None | __init__ (*args, **kwargs) |
| BaseUnionFind_VertId | operator (*args, **kwargs) |
| BaseUnionFind_VertId | operator (*args, **kwargs) |
Generated from: MR::BaseUnionFind<MR::VertId> \\brief base of union-find data structures: stores only the parent forest and the operations that depend on it alone, so it is shared by the sequential UnionFind and the ParallelUnionFind \\tparam I is the identifier of a set's element, e.g. FaceId
|
static |
| None mrmeshpy.BaseUnionFind_VertId.__init__ | ( | self | ) |
| None mrmeshpy.BaseUnionFind_VertId.__init__ | ( | self, | |
| BaseUnionFind_VertId | arg0 ) |
Implicit copy constructor.
finds the root of the set containing given element with optimizing data structure updates
finds the root of the set containing given element with optimizing data structure in the range [begin, end)
| bool mrmeshpy.BaseUnionFind_VertId.isRoot | ( | self, | |
| VertId | a ) |
returns true if given element is the root of some set
|
static |
Reimplemented in mrmeshpy.UnionFind_VertId, and mrmeshpy.UnionFind_VertId.
|
static |
Reimplemented in mrmeshpy.UnionFind_VertId, and mrmeshpy.UnionFind_VertId.
return parent element of this element, which is equal to given element only for set's root
| VertMap mrmeshpy.BaseUnionFind_VertId.parents | ( | self | ) |
gets the parents of all elements as is
| None mrmeshpy.BaseUnionFind_VertId.reset | ( | self, | |
| int | size ) |
resets union-find to represent given number of elements, each element is the only one in its disjoint set
Reimplemented in mrmeshpy.UnionFind_VertId.
| VertMap mrmeshpy.BaseUnionFind_VertId.roots | ( | self | ) |
sets the root of corresponding set as the parent of each element, then returns the vector
| int mrmeshpy.BaseUnionFind_VertId.size | ( | self | ) |
returns the number of elements in union-find
returns true if given two elements are from one set
| tuple[VertId, bool] mrmeshpy.BaseUnionFind_VertId.uniteUnbalanced | ( | self, | |
| VertId | first, | ||
| 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. \\return first: new common root, second: true if the union was done (false if already in one set)