Public Member Functions | |
None | __init__ (self) |
None | __init__ (self, int size) |
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) |
int | sizeOfComp (self, UndirectedEdgeId a) |
tuple[UndirectedEdgeId, bool] | unite (self, UndirectedEdgeId first, UndirectedEdgeId second) |
bool | united (self, UndirectedEdgeId first, UndirectedEdgeId second) |
Static Public Member Functions | |
None | __init__ (*args, **kwargs) |
UnionFind_UndirectedEdgeId | operator (*args, **kwargs) |
UnionFind_UndirectedEdgeId | operator (*args, **kwargs) |
Generated from: MR::UnionFind<MR::UndirectedEdgeId> \\brief Union-find data structure for representing disjoin 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 \\tparam I is the identifier of a set's element, e.g. FaceId \\ingroup BasicGroup
|
static |
None mrmeshpy.UnionFind_UndirectedEdgeId.__init__ | ( | self | ) |
None mrmeshpy.UnionFind_UndirectedEdgeId.__init__ | ( | self, | |
int | size ) |
creates union-find with given number of elements, each element is the only one in its disjoint set
UndirectedEdgeId mrmeshpy.UnionFind_UndirectedEdgeId.find | ( | self, | |
UndirectedEdgeId | a ) |
finds the root of the set containing given element with optimizing data structure updates
UndirectedEdgeId mrmeshpy.UnionFind_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.UnionFind_UndirectedEdgeId.isRoot | ( | self, | |
UndirectedEdgeId | a ) |
returns true if given element is the root of some set
|
static |
|
static |
UndirectedEdgeId mrmeshpy.UnionFind_UndirectedEdgeId.parent | ( | self, | |
UndirectedEdgeId | a ) |
return parent element of this element, which is equal to given element only for set's root
UndirectedEdgeMap mrmeshpy.UnionFind_UndirectedEdgeId.parents | ( | self | ) |
gets the parents of all elements as is
None mrmeshpy.UnionFind_UndirectedEdgeId.reset | ( | self, | |
int | size ) |
resets union-find to represent given number of elements, each element is the only one in its disjoint set
UndirectedEdgeMap mrmeshpy.UnionFind_UndirectedEdgeId.roots | ( | self | ) |
sets the root of corresponding set as the parent of each element, then returns the vector
int mrmeshpy.UnionFind_UndirectedEdgeId.size | ( | self | ) |
returns the number of elements in union-find
int mrmeshpy.UnionFind_UndirectedEdgeId.sizeOfComp | ( | self, | |
UndirectedEdgeId | a ) |
returns the number of elements in the set containing given element
tuple[UndirectedEdgeId, bool] mrmeshpy.UnionFind_UndirectedEdgeId.unite | ( | self, | |
UndirectedEdgeId | first, | ||
UndirectedEdgeId | second ) |
unite two elements, \\return first: new common root, second: true = union was done, false = first and second were already united
bool mrmeshpy.UnionFind_UndirectedEdgeId.united | ( | self, | |
UndirectedEdgeId | first, | ||
UndirectedEdgeId | second ) |
returns true if given two elements are from one set