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

Public Member Functions

None __init__ (self)
 
None __init__ (self, int size)
 
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)
 
int sizeOfComp (self, FaceId a)
 
tuple[FaceId, bool] unite (self, FaceId first, FaceId second)
 
bool united (self, FaceId first, FaceId second)
 

Static Public Member Functions

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

Detailed Description

Generated from:  MR::UnionFind<MR::FaceId>


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

Constructor & Destructor Documentation

◆ __init__() [1/3]

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

◆ __init__() [2/3]

None mrmeshpy.UnionFind_FaceId.__init__ ( self)

◆ __init__() [3/3]

None mrmeshpy.UnionFind_FaceId.__init__ ( self,
int size )
creates union-find with given number of elements, each element is the only one in its disjoint set

Member Function Documentation

◆ find()

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

◆ findUpdateRange()

FaceId mrmeshpy.UnionFind_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.UnionFind_FaceId.isRoot ( self,
FaceId a )
returns true if given element is the root of some set

◆ operator() [1/2]

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

◆ operator() [2/2]

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

◆ parent()

FaceId mrmeshpy.UnionFind_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.UnionFind_FaceId.parents ( self)
gets the parents of all elements as is

◆ reset()

None mrmeshpy.UnionFind_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.UnionFind_FaceId.roots ( self)
sets the root of corresponding set as the parent of each element, then returns the vector

◆ size()

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

◆ sizeOfComp()

int mrmeshpy.UnionFind_FaceId.sizeOfComp ( self,
FaceId a )
returns the number of elements in the set containing given element

◆ unite()

tuple[FaceId, bool] mrmeshpy.UnionFind_FaceId.unite ( self,
FaceId first,
FaceId second )
unite two elements,
\\return first: new common root, second: true = union was done, false = first and second were already united

◆ united()

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

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