MeshLib Java Docs
Loading...
Searching...
No Matches
meshlib.BaseUnionFind_MR_UndirectedEdgeId 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_UndirectedEdgeId:

Public Member Functions

 BaseUnionFind_MR_UndirectedEdgeId (java.lang.foreign.MemorySegment ptr, boolean owned, java.lang.Object owner)
 BaseUnionFind_MR_UndirectedEdgeId ()
 BaseUnionFind_MR_UndirectedEdgeId (meshlib.BaseUnionFind_MR_UndirectedEdgeId _other)
meshlib.BaseUnionFind_MR_UndirectedEdgeId assignFromAnother (meshlib.BaseUnionFind_MR_UndirectedEdgeId _other)
long size ()
void reset (long size)
meshlib.UndirectedEdgeId add ()
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 ()
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::UndirectedEdgeId>. Derived classes: Direct: (non-virtual) MR::UnionFind<MR::UndirectedEdgeId>

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

Constructor & Destructor Documentation

◆ BaseUnionFind_MR_UndirectedEdgeId() [1/3]

meshlib.BaseUnionFind_MR_UndirectedEdgeId.BaseUnionFind_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.

◆ BaseUnionFind_MR_UndirectedEdgeId() [2/3]

meshlib.BaseUnionFind_MR_UndirectedEdgeId.BaseUnionFind_MR_UndirectedEdgeId ( )

Constructs an empty (default-constructed) instance.

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_DefaultConstruct().

◆ BaseUnionFind_MR_UndirectedEdgeId() [3/3]

meshlib.BaseUnionFind_MR_UndirectedEdgeId.BaseUnionFind_MR_UndirectedEdgeId ( meshlib.BaseUnionFind_MR_UndirectedEdgeId _other)

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_ConstructFromAnother().

Member Function Documentation

◆ add()

meshlib.UndirectedEdgeId meshlib.BaseUnionFind_MR_UndirectedEdgeId.add ( )

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_add().

◆ assignFromAnother()

meshlib.BaseUnionFind_MR_UndirectedEdgeId meshlib.BaseUnionFind_MR_UndirectedEdgeId.assignFromAnother ( meshlib.BaseUnionFind_MR_UndirectedEdgeId _other)

Generated from method MR::BaseUnionFind<MR::UndirectedEdgeId>::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_UndirectedEdgeId_AssignFromAnother().

◆ find()

meshlib.UndirectedEdgeId meshlib.BaseUnionFind_MR_UndirectedEdgeId.find ( meshlib.UndirectedEdgeId a)

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_find().

◆ findUpdateRange()

meshlib.UndirectedEdgeId meshlib.BaseUnionFind_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::BaseUnionFind<MR::UndirectedEdgeId>::findUpdateRange.

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_findUpdateRange().

◆ isRoot()

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

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_isRoot().

◆ parent()

meshlib.UndirectedEdgeId meshlib.BaseUnionFind_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::BaseUnionFind<MR::UndirectedEdgeId>::parent.

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_parent().

◆ parents()

meshlib.UndirectedEdgeMap meshlib.BaseUnionFind_MR_UndirectedEdgeId.parents ( )

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_parents().

◆ reset()

void meshlib.BaseUnionFind_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::BaseUnionFind<MR::UndirectedEdgeId>::reset.

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_reset().

◆ roots()

meshlib.UndirectedEdgeMap meshlib.BaseUnionFind_MR_UndirectedEdgeId.roots ( )

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_roots().

◆ size()

long meshlib.BaseUnionFind_MR_UndirectedEdgeId.size ( )

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_size().

◆ united()

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

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

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_united().

◆ uniteUnbalanced()

meshlib.std_pair_MR_UndirectedEdgeId_bool meshlib.BaseUnionFind_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::BaseUnionFind<MR::UndirectedEdgeId>::uniteUnbalanced.

Calls MR_BaseUnionFind_MR_UndirectedEdgeId_uniteUnbalanced().


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