MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.BaseUnionFind_FaceId Class Reference

Public Member Functions

None __init__ (self)
None __init__ (self, BaseUnionFind_FaceId arg0)
FaceId find (self, FaceId a)
FaceId findUpdateRange (self, FaceId a, FaceId begin, FaceId end)
bool isRoot (self, FaceId a)
FaceId parent (self, FaceId a)
FaceMap parents (self)
None reset (self, int size)
FaceMap roots (self)
int size (self)
tuple[FaceId, bool] uniteUnbalanced (self, FaceId first, FaceId second)
bool united (self, FaceId first, FaceId second)

Static Public Member Functions

None __init__ (*args, **kwargs)
BaseUnionFind_FaceId operator (*args, **kwargs)
BaseUnionFind_FaceId operator (*args, **kwargs)

Detailed Description

Generated from:  MR::BaseUnionFind<MR::FaceId>


 \\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

Constructor & Destructor Documentation

◆ __init__() [1/3]

None mrmeshpy.BaseUnionFind_FaceId.__init__ ( * args,
** kwargs )
static

◆ __init__() [2/3]

None mrmeshpy.BaseUnionFind_FaceId.__init__ ( self)

◆ __init__() [3/3]

None mrmeshpy.BaseUnionFind_FaceId.__init__ ( self,
BaseUnionFind_FaceId arg0 )
Implicit copy constructor.

Member Function Documentation

◆ find()

FaceId mrmeshpy.BaseUnionFind_FaceId.find ( self,
FaceId a )
finds the root of the set containing given element with optimizing data structure updates

◆ findUpdateRange()

FaceId mrmeshpy.BaseUnionFind_FaceId.findUpdateRange ( self,
FaceId a,
FaceId begin,
FaceId end )
finds the root of the set containing given element with optimizing data structure in the range [begin, end)

◆ isRoot()

bool mrmeshpy.BaseUnionFind_FaceId.isRoot ( self,
FaceId a )
returns true if given element is the root of some set

◆ operator() [1/2]

BaseUnionFind_FaceId mrmeshpy.BaseUnionFind_FaceId.operator ( * args,
** kwargs )
static

◆ operator() [2/2]

BaseUnionFind_FaceId mrmeshpy.BaseUnionFind_FaceId.operator ( * args,
** kwargs )
static

◆ parent()

FaceId mrmeshpy.BaseUnionFind_FaceId.parent ( self,
FaceId a )
return parent element of this element, which is equal to given element only for set's root

◆ parents()

FaceMap mrmeshpy.BaseUnionFind_FaceId.parents ( self)
gets the parents of all elements as is

◆ reset()

None mrmeshpy.BaseUnionFind_FaceId.reset ( self,
int size )
resets union-find to represent given number of elements, each element is the only one in its disjoint set

◆ roots()

FaceMap mrmeshpy.BaseUnionFind_FaceId.roots ( self)
sets the root of corresponding set as the parent of each element, then returns the vector

◆ size()

int mrmeshpy.BaseUnionFind_FaceId.size ( self)
returns the number of elements in union-find

◆ united()

bool mrmeshpy.BaseUnionFind_FaceId.united ( self,
FaceId first,
FaceId second )
returns true if given two elements are from one set

◆ uniteUnbalanced()

tuple[FaceId, bool] mrmeshpy.BaseUnionFind_FaceId.uniteUnbalanced ( self,
FaceId first,
FaceId 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)

The documentation for this class was generated from the following file: