MeshLib Java Docs
Loading...
Searching...
No Matches
meshlib.UnionFind_MR_UndirectedEdgeId Class Reference

Union-find data structure for representing disjoint 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. Sequential implementation that selects the root of a united pair by set size for best performance. More...

Inheritance diagram for meshlib.UnionFind_MR_UndirectedEdgeId:

Public Member Functions

 UnionFind_MR_UndirectedEdgeId (java.lang.foreign.MemorySegment ptr, boolean owned, java.lang.Object owner)
 UnionFind_MR_UndirectedEdgeId ()
 UnionFind_MR_UndirectedEdgeId (meshlib.UnionFind_MR_UndirectedEdgeId _other)
 UnionFind_MR_UndirectedEdgeId (long size)
 UnionFind_MR_UndirectedEdgeId (meshlib.BaseUnionFind_MR_UndirectedEdgeId base)
meshlib.UnionFind_MR_UndirectedEdgeId assignFromAnother (meshlib.UnionFind_MR_UndirectedEdgeId _other)
void reset (long size)
meshlib.UndirectedEdgeId add ()
meshlib.std_pair_MR_UndirectedEdgeId_bool unite (meshlib.UndirectedEdgeId first, meshlib.UndirectedEdgeId second)
int sizeOfComp (meshlib.UndirectedEdgeId a)
long size ()
meshlib.std_pair_MR_UndirectedEdgeId_bool uniteUnbalanced (meshlib.UndirectedEdgeId first, meshlib.UndirectedEdgeId second)
boolean united (meshlib.UndirectedEdgeId first, meshlib.UndirectedEdgeId second)
boolean isRoot (meshlib.UndirectedEdgeId a)
meshlib.UndirectedEdgeId parent (meshlib.UndirectedEdgeId a)
meshlib.UndirectedEdgeId find (meshlib.UndirectedEdgeId a)
meshlib.UndirectedEdgeId findUpdateRange (meshlib.UndirectedEdgeId a, meshlib.UndirectedEdgeId begin, meshlib.UndirectedEdgeId end)
meshlib.UndirectedEdgeMap roots ()
meshlib.UndirectedEdgeMap parents ()
meshlib.BaseUnionFind_MR_UndirectedEdgeId upcastToBaseUnionFind_MR_UndirectedEdgeId ()
Public Member Functions inherited from meshlib.CppObject
final java.lang.foreign.MemorySegment rawPointer ()
final boolean isOwned ()
final void close ()
final java.lang.foreign.MemorySegment release ()

Static Public Member Functions

static meshlib.UnionFind_MR_UndirectedEdgeId staticDowncastFromBaseUnionFind_MR_UndirectedEdgeId (meshlib.BaseUnionFind_MR_UndirectedEdgeId object)

Additional Inherited Members

Protected Member Functions inherited from meshlib.CppObject
 CppObject (java.lang.foreign.MemorySegment ptr, java.util.function.Consumer< java.lang.foreign.MemorySegment > destroy, java.lang.Object owner)

Detailed Description

Union-find data structure for representing disjoint 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. Sequential implementation that selects the root of a united pair by set size for best performance.

Template Parameters
Iis the identifier of a set's element, e.g. FaceId

Generated from class MR::UnionFind<MR::UndirectedEdgeId>. Base classes: Direct: (non-virtual) MR::BaseUnionFind<MR::UndirectedEdgeId>

Instances created here own their C++ objects, see CppObject.

Constructor & Destructor Documentation

◆ UnionFind_MR_UndirectedEdgeId() [1/5]

meshlib.UnionFind_MR_UndirectedEdgeId.UnionFind_MR_UndirectedEdgeId ( java.lang.foreign.MemorySegment ptr,
boolean owned,
java.lang.Object owner )

Wraps a pointer from the C bindings. If owned, the object is destroyed when the wrapper dies. owner is kept alive as long as this wrapper is. Not for normal use.

◆ UnionFind_MR_UndirectedEdgeId() [2/5]

meshlib.UnionFind_MR_UndirectedEdgeId.UnionFind_MR_UndirectedEdgeId ( )

Constructs an empty (default-constructed) instance.

Calls MR_UnionFind_MR_UndirectedEdgeId_DefaultConstruct().

◆ UnionFind_MR_UndirectedEdgeId() [3/5]

meshlib.UnionFind_MR_UndirectedEdgeId.UnionFind_MR_UndirectedEdgeId ( meshlib.UnionFind_MR_UndirectedEdgeId _other)

Generated from constructor MR::UnionFind<MR::UndirectedEdgeId>::UnionFind. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.

Calls MR_UnionFind_MR_UndirectedEdgeId_ConstructFromAnother().

◆ UnionFind_MR_UndirectedEdgeId() [4/5]

meshlib.UnionFind_MR_UndirectedEdgeId.UnionFind_MR_UndirectedEdgeId ( long size)

creates union-find with given number of elements, each element is the only one in its disjoint set Generated from constructor MR::UnionFind<MR::UndirectedEdgeId>::UnionFind. The reference to the parameter size might be preserved in the constructed object.

Calls MR_UnionFind_MR_UndirectedEdgeId_Construct_size_t().

◆ UnionFind_MR_UndirectedEdgeId() [5/5]

meshlib.UnionFind_MR_UndirectedEdgeId.UnionFind_MR_UndirectedEdgeId ( meshlib.BaseUnionFind_MR_UndirectedEdgeId base)

adopts the parent forest of a base/parallel union-find and (re)computes set sizes, so the result supports the full sequential interface (e.g. unite, sizeOfComp) Generated from constructor MR::UnionFind<MR::UndirectedEdgeId>::UnionFind. The reference to the parameter base might be preserved in the constructed object.

Calls MR_UnionFind_MR_UndirectedEdgeId_Construct_MR_BaseUnionFind_MR_UndirectedEdgeId().

Member Function Documentation

◆ add()

meshlib.UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.add ( )

adds new element in its own disjoint set, returns its identifier Generated from method MR::UnionFind<MR::UndirectedEdgeId>::add.

Calls MR_UnionFind_MR_UndirectedEdgeId_add().

◆ assignFromAnother()

meshlib.UnionFind_MR_UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.assignFromAnother ( meshlib.UnionFind_MR_UndirectedEdgeId _other)

Generated from method MR::UnionFind<MR::UndirectedEdgeId>::operator=. The reference to things referred to by the parameter _other (if any) might be preserved in this object.

Calls MR_UnionFind_MR_UndirectedEdgeId_AssignFromAnother().

◆ find()

meshlib.UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.find ( meshlib.UndirectedEdgeId a)

finds the root of the set containing given element with optimizing data structure updates Generated from method MR::UnionFind<MR::UndirectedEdgeId>::find.

Calls MR_UnionFind_MR_UndirectedEdgeId_find().

◆ findUpdateRange()

meshlib.UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.findUpdateRange ( meshlib.UndirectedEdgeId a,
meshlib.UndirectedEdgeId begin,
meshlib.UndirectedEdgeId end )

finds the root of the set containing given element with optimizing data structure in the range [begin, end) Generated from method MR::UnionFind<MR::UndirectedEdgeId>::findUpdateRange.

Calls MR_UnionFind_MR_UndirectedEdgeId_findUpdateRange().

◆ isRoot()

boolean meshlib.UnionFind_MR_UndirectedEdgeId.isRoot ( meshlib.UndirectedEdgeId a)

returns true if given element is the root of some set Generated from method MR::UnionFind<MR::UndirectedEdgeId>::isRoot.

Calls MR_UnionFind_MR_UndirectedEdgeId_isRoot().

◆ parent()

meshlib.UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.parent ( meshlib.UndirectedEdgeId a)

return parent element of this element, which is equal to given element only for set's root Generated from method MR::UnionFind<MR::UndirectedEdgeId>::parent.

Calls MR_UnionFind_MR_UndirectedEdgeId_parent().

◆ parents()

meshlib.UndirectedEdgeMap meshlib.UnionFind_MR_UndirectedEdgeId.parents ( )

gets the parents of all elements as is Generated from method MR::UnionFind<MR::UndirectedEdgeId>::parents.

Calls MR_UnionFind_MR_UndirectedEdgeId_parents().

◆ reset()

void meshlib.UnionFind_MR_UndirectedEdgeId.reset ( long size)

resets union-find to represent given number of elements, each element is the only one in its disjoint set Generated from method MR::UnionFind<MR::UndirectedEdgeId>::reset.

Calls MR_UnionFind_MR_UndirectedEdgeId_reset().

◆ roots()

meshlib.UndirectedEdgeMap meshlib.UnionFind_MR_UndirectedEdgeId.roots ( )

sets the root of corresponding set as the parent of each element, then returns the vector Generated from method MR::UnionFind<MR::UndirectedEdgeId>::roots.

Calls MR_UnionFind_MR_UndirectedEdgeId_roots().

◆ size()

long meshlib.UnionFind_MR_UndirectedEdgeId.size ( )

returns the number of elements in union-find Generated from method MR::UnionFind<MR::UndirectedEdgeId>::size.

Calls MR_UnionFind_MR_UndirectedEdgeId_size().

◆ sizeOfComp()

int meshlib.UnionFind_MR_UndirectedEdgeId.sizeOfComp ( meshlib.UndirectedEdgeId a)

returns the number of elements in the set containing given element Generated from method MR::UnionFind<MR::UndirectedEdgeId>::sizeOfComp.

Calls MR_UnionFind_MR_UndirectedEdgeId_sizeOfComp().

◆ staticDowncastFromBaseUnionFind_MR_UndirectedEdgeId()

meshlib.UnionFind_MR_UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.staticDowncastFromBaseUnionFind_MR_UndirectedEdgeId ( meshlib.BaseUnionFind_MR_UndirectedEdgeId object)
static

Static downcast from the base class MR::BaseUnionFind<MR::UndirectedEdgeId>. Undefined behavior if the object isn't actually a UnionFind_MR_UndirectedEdgeId. The result refers to object.

Calls MR_UnionFind_MR_UndirectedEdgeId_MutableStaticDowncastFrom_MR_BaseUnionFind_MR_UndirectedEdgeId().

◆ unite()

meshlib.std_pair_MR_UndirectedEdgeId_bool meshlib.UnionFind_MR_UndirectedEdgeId.unite ( meshlib.UndirectedEdgeId first,
meshlib.UndirectedEdgeId second )

unite two elements,

Returns
first: new common root, second: true = union was done, false = first and second were already united Generated from method MR::UnionFind<MR::UndirectedEdgeId>::unite.

Calls MR_UnionFind_MR_UndirectedEdgeId_unite().

◆ united()

boolean meshlib.UnionFind_MR_UndirectedEdgeId.united ( meshlib.UndirectedEdgeId first,
meshlib.UndirectedEdgeId second )

returns true if given two elements are from one set Generated from method MR::UnionFind<MR::UndirectedEdgeId>::united.

Calls MR_UnionFind_MR_UndirectedEdgeId_united().

◆ uniteUnbalanced()

meshlib.std_pair_MR_UndirectedEdgeId_bool meshlib.UnionFind_MR_UndirectedEdgeId.uniteUnbalanced ( meshlib.UndirectedEdgeId first,
meshlib.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.

Returns
first: new common root, second: true if the union was done (false if already in one set) Generated from method MR::UnionFind<MR::UndirectedEdgeId>::uniteUnbalanced.

Calls MR_UnionFind_MR_UndirectedEdgeId_uniteUnbalanced().

◆ upcastToBaseUnionFind_MR_UndirectedEdgeId()

meshlib.BaseUnionFind_MR_UndirectedEdgeId meshlib.UnionFind_MR_UndirectedEdgeId.upcastToBaseUnionFind_MR_UndirectedEdgeId ( )

Upcasts to the base class MR::BaseUnionFind<MR::UndirectedEdgeId>. The result refers to this object.

Calls MR_UnionFind_MR_UndirectedEdgeId_MutableUpcastTo_MR_BaseUnionFind_MR_UndirectedEdgeId().


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