Public Member Functions | |
| None | __init__ (self) |
| None | __init__ (self, BaseUnionFind_UndirectedEdgeId arg0) |
| UndirectedEdgeId | find (self, UndirectedEdgeId a) |
| UndirectedEdgeId | findUpdateRange (self, UndirectedEdgeId a, UndirectedEdgeId begin, UndirectedEdgeId end) |
| bool | isRoot (self, UndirectedEdgeId a) |
| UndirectedEdgeId | parent (self, UndirectedEdgeId a) |
| UndirectedEdgeMap | parents (self) |
| None | reset (self, int size) |
| UndirectedEdgeMap | roots (self) |
| int | size (self) |
| tuple[UndirectedEdgeId, bool] | uniteUnbalanced (self, UndirectedEdgeId first, UndirectedEdgeId second) |
| bool | united (self, UndirectedEdgeId first, UndirectedEdgeId second) |
Static Public Member Functions | |
| None | __init__ (*args, **kwargs) |
| BaseUnionFind_UndirectedEdgeId | operator (*args, **kwargs) |
| BaseUnionFind_UndirectedEdgeId | operator (*args, **kwargs) |
Generated from: MR::BaseUnionFind<MR::UndirectedEdgeId> \\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_UndirectedEdgeId.__init__ | ( | self | ) |
| None mrmeshpy.BaseUnionFind_UndirectedEdgeId.__init__ | ( | self, | |
| BaseUnionFind_UndirectedEdgeId | arg0 ) |
Implicit copy constructor.
| UndirectedEdgeId mrmeshpy.BaseUnionFind_UndirectedEdgeId.find | ( | self, | |
| UndirectedEdgeId | a ) |
finds the root of the set containing given element with optimizing data structure updates
| UndirectedEdgeId mrmeshpy.BaseUnionFind_UndirectedEdgeId.findUpdateRange | ( | self, | |
| UndirectedEdgeId | a, | ||
| UndirectedEdgeId | begin, | ||
| UndirectedEdgeId | end ) |
finds the root of the set containing given element with optimizing data structure in the range [begin, end)
| bool mrmeshpy.BaseUnionFind_UndirectedEdgeId.isRoot | ( | self, | |
| UndirectedEdgeId | a ) |
returns true if given element is the root of some set
|
static |
Reimplemented in mrmeshpy.UnionFind_UndirectedEdgeId, and mrmeshpy.UnionFind_UndirectedEdgeId.
|
static |
Reimplemented in mrmeshpy.UnionFind_UndirectedEdgeId, and mrmeshpy.UnionFind_UndirectedEdgeId.
| UndirectedEdgeId mrmeshpy.BaseUnionFind_UndirectedEdgeId.parent | ( | self, | |
| UndirectedEdgeId | a ) |
return parent element of this element, which is equal to given element only for set's root
| UndirectedEdgeMap mrmeshpy.BaseUnionFind_UndirectedEdgeId.parents | ( | self | ) |
gets the parents of all elements as is
| None mrmeshpy.BaseUnionFind_UndirectedEdgeId.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_UndirectedEdgeId.
| UndirectedEdgeMap mrmeshpy.BaseUnionFind_UndirectedEdgeId.roots | ( | self | ) |
sets the root of corresponding set as the parent of each element, then returns the vector
| int mrmeshpy.BaseUnionFind_UndirectedEdgeId.size | ( | self | ) |
returns the number of elements in union-find
| bool mrmeshpy.BaseUnionFind_UndirectedEdgeId.united | ( | self, | |
| UndirectedEdgeId | first, | ||
| UndirectedEdgeId | second ) |
returns true if given two elements are from one set
| tuple[UndirectedEdgeId, bool] mrmeshpy.BaseUnionFind_UndirectedEdgeId.uniteUnbalanced | ( | self, | |
| UndirectedEdgeId | first, | ||
| 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. \\return first: new common root, second: true if the union was done (false if already in one set)