MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.BaseUnionFind_UndirectedEdgeId Class Reference
Inheritance diagram for mrmeshpy.BaseUnionFind_UndirectedEdgeId:

Public Member Functions

None __init__ (self)
None __init__ (self, ConstBaseUnionFind_UndirectedEdgeId arg0)
UndirectedEdgeId add (self)
BaseUnionFind_UndirectedEdgeId assign (self, ConstBaseUnionFind_UndirectedEdgeId other)
UndirectedEdgeId find (self, ConstUndirectedEdgeId a)
UndirectedEdgeId findUpdateRange (self, ConstUndirectedEdgeId a, ConstUndirectedEdgeId begin, ConstUndirectedEdgeId end)
None reset (self, int size)
ConstUndirectedEdgeMap roots (self)
tuple[UndirectedEdgeId, bool] uniteUnbalanced (self, ConstUndirectedEdgeId first, ConstUndirectedEdgeId second)
bool united (self, ConstUndirectedEdgeId first, ConstUndirectedEdgeId second)
Public Member Functions inherited from mrmeshpy.ConstBaseUnionFind_UndirectedEdgeId
 __init__ (self, *args, **kwargs)
bool isRoot (self, ConstUndirectedEdgeId a)
UndirectedEdgeId parent (self, ConstUndirectedEdgeId a)
ConstUndirectedEdgeMap parents (self)
int size (self)

Static Public Member Functions

None __init__ (*args, **kwargs)

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__() [1/3]

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

◆ __init__() [2/3]

None mrmeshpy.BaseUnionFind_UndirectedEdgeId.__init__ ( self)

◆ __init__() [3/3]

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

Member Function Documentation

◆ add()

UndirectedEdgeId mrmeshpy.BaseUnionFind_UndirectedEdgeId.add ( self)
adds new element in its own disjoint set, returns its identifier

Reimplemented in mrmeshpy.UnionFind_UndirectedEdgeId.

◆ assign()

BaseUnionFind_UndirectedEdgeId mrmeshpy.BaseUnionFind_UndirectedEdgeId.assign ( self,
ConstBaseUnionFind_UndirectedEdgeId other )

◆ find()

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

◆ findUpdateRange()

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

◆ reset()

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.

◆ roots()

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

◆ united()

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

◆ uniteUnbalanced()

tuple[UndirectedEdgeId, bool] mrmeshpy.BaseUnionFind_UndirectedEdgeId.uniteUnbalanced ( self,
ConstUndirectedEdgeId first,
ConstUndirectedEdgeId 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: