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

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 More...

Inheritance diagram for meshlib.BaseUnionFind_MR_VertId:

Public Member Functions

 BaseUnionFind_MR_VertId (java.lang.foreign.MemorySegment ptr, boolean owned, java.lang.Object owner)
 BaseUnionFind_MR_VertId ()
 BaseUnionFind_MR_VertId (meshlib.BaseUnionFind_MR_VertId _other)
meshlib.BaseUnionFind_MR_VertId assignFromAnother (meshlib.BaseUnionFind_MR_VertId _other)
long size ()
void reset (long size)
meshlib.VertId add ()
meshlib.std_pair_MR_VertId_bool uniteUnbalanced (meshlib.VertId first, meshlib.VertId second)
boolean united (meshlib.VertId first, meshlib.VertId second)
boolean isRoot (meshlib.VertId a)
meshlib.VertId parent (meshlib.VertId a)
meshlib.VertId find (meshlib.VertId a)
meshlib.VertId findUpdateRange (meshlib.VertId a, meshlib.VertId begin, meshlib.VertId end)
meshlib.VertMap roots ()
meshlib.VertMap parents ()
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 ()

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

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

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

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

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

Constructor & Destructor Documentation

◆ BaseUnionFind_MR_VertId() [1/3]

meshlib.BaseUnionFind_MR_VertId.BaseUnionFind_MR_VertId ( 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.

◆ BaseUnionFind_MR_VertId() [2/3]

meshlib.BaseUnionFind_MR_VertId.BaseUnionFind_MR_VertId ( )

Constructs an empty (default-constructed) instance.

Calls MR_BaseUnionFind_MR_VertId_DefaultConstruct().

◆ BaseUnionFind_MR_VertId() [3/3]

meshlib.BaseUnionFind_MR_VertId.BaseUnionFind_MR_VertId ( meshlib.BaseUnionFind_MR_VertId _other)

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

Calls MR_BaseUnionFind_MR_VertId_ConstructFromAnother().

Member Function Documentation

◆ add()

meshlib.VertId meshlib.BaseUnionFind_MR_VertId.add ( )

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

Calls MR_BaseUnionFind_MR_VertId_add().

◆ assignFromAnother()

meshlib.BaseUnionFind_MR_VertId meshlib.BaseUnionFind_MR_VertId.assignFromAnother ( meshlib.BaseUnionFind_MR_VertId _other)

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

Calls MR_BaseUnionFind_MR_VertId_AssignFromAnother().

◆ find()

meshlib.VertId meshlib.BaseUnionFind_MR_VertId.find ( meshlib.VertId a)

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

Calls MR_BaseUnionFind_MR_VertId_find().

◆ findUpdateRange()

meshlib.VertId meshlib.BaseUnionFind_MR_VertId.findUpdateRange ( meshlib.VertId a,
meshlib.VertId begin,
meshlib.VertId end )

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

Calls MR_BaseUnionFind_MR_VertId_findUpdateRange().

◆ isRoot()

boolean meshlib.BaseUnionFind_MR_VertId.isRoot ( meshlib.VertId a)

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

Calls MR_BaseUnionFind_MR_VertId_isRoot().

◆ parent()

meshlib.VertId meshlib.BaseUnionFind_MR_VertId.parent ( meshlib.VertId a)

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

Calls MR_BaseUnionFind_MR_VertId_parent().

◆ parents()

meshlib.VertMap meshlib.BaseUnionFind_MR_VertId.parents ( )

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

Calls MR_BaseUnionFind_MR_VertId_parents().

◆ reset()

void meshlib.BaseUnionFind_MR_VertId.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::BaseUnionFind<MR::VertId>::reset.

Calls MR_BaseUnionFind_MR_VertId_reset().

◆ roots()

meshlib.VertMap meshlib.BaseUnionFind_MR_VertId.roots ( )

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

Calls MR_BaseUnionFind_MR_VertId_roots().

◆ size()

long meshlib.BaseUnionFind_MR_VertId.size ( )

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

Calls MR_BaseUnionFind_MR_VertId_size().

◆ united()

boolean meshlib.BaseUnionFind_MR_VertId.united ( meshlib.VertId first,
meshlib.VertId second )

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

Calls MR_BaseUnionFind_MR_VertId_united().

◆ uniteUnbalanced()

meshlib.std_pair_MR_VertId_bool meshlib.BaseUnionFind_MR_VertId.uniteUnbalanced ( meshlib.VertId first,
meshlib.VertId 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::BaseUnionFind<MR::VertId>::uniteUnbalanced.

Calls MR_BaseUnionFind_MR_VertId_uniteUnbalanced().


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