MeshLib Rust Docs
Loading...
Searching...
No Matches
meshlib::UnionFind_MR_UndirectedEdgeId Struct 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

auto assign_from_another (_other:&meshlib::UnionFind_MR_UndirectedEdgeId) -> &mut meshlib::UnionFind_MR_UndirectedEdgeId
void reset (size:usize)
auto add () -> meshlib::UndirectedEdgeId
auto unite (first:meshlib::UndirectedEdgeId, second:meshlib::UndirectedEdgeId) -> meshlib::Owned< meshlib::std_pair_MR_UndirectedEdgeId_bool >
auto size_of_comp (a:meshlib::UndirectedEdgeId) -> core::ffi::c_int
auto size () const -> usize
auto unite_unbalanced (first:meshlib::UndirectedEdgeId, second:meshlib::UndirectedEdgeId) -> meshlib::Owned< meshlib::std_pair_MR_UndirectedEdgeId_bool >
auto united (first:meshlib::UndirectedEdgeId, second:meshlib::UndirectedEdgeId) -> bool
auto is_root (a:meshlib::UndirectedEdgeId) const -> bool
auto parent (a:meshlib::UndirectedEdgeId) const -> meshlib::UndirectedEdgeId
auto find (a:meshlib::UndirectedEdgeId) -> meshlib::UndirectedEdgeId
auto find_update_range (a:meshlib::UndirectedEdgeId, begin:meshlib::UndirectedEdgeId, end:meshlib::UndirectedEdgeId) -> meshlib::UndirectedEdgeId
auto roots () -> &meshlib::UndirectedEdgeMap
auto parents () const -> &meshlib::UndirectedEdgeMap
auto upcast_to_base_union_find_mr_undirected_edge_id () const -> &meshlib::BaseUnionFind_MR_UndirectedEdgeId
auto upcast_to_base_union_find_mr_undirected_edge_id_mut () -> &mut meshlib::BaseUnionFind_MR_UndirectedEdgeId

Static Public Member Functions

static auto new () -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static auto construct_from_another (_other:&meshlib::UnionFind_MR_UndirectedEdgeId) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static auto construct_size_t (size:usize) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static auto construct_mr_base_union_find_mr_undirected_edge_id (base:&mut meshlib::BaseUnionFind_MR_UndirectedEdgeId) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static auto static_downcast_from_base_union_find_mr_undirected_edge_id (object:&meshlib::BaseUnionFind_MR_UndirectedEdgeId) -> &Self
static auto static_downcast_from_base_union_find_mr_undirected_edge_id_mut (object:&mut meshlib::BaseUnionFind_MR_UndirectedEdgeId) -> &mut Self
Static Public Member Functions inherited from meshlib::CppClass
static void destroy (ptr:*mut Self)
Static Public Member Functions inherited from meshlib::CppCopy
static auto copy (ptr:*const Self) -> *mut Self

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>

Generated from class MR::UnionFind<MR::UndirectedEdgeId>. Heap-allocated instances are held in Owned<UnionFind_MR_UndirectedEdgeId>.

Member Function Documentation

◆ add()

auto meshlib::UnionFind_MR_UndirectedEdgeId::add ( ) -> meshlib::UndirectedEdgeId

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().

◆ assign_from_another()

auto meshlib::UnionFind_MR_UndirectedEdgeId::assign_from_another ( _other:&meshlib::UnionFind_MR_UndirectedEdgeId ) -> &mut meshlib::UnionFind_MR_UndirectedEdgeId

Generated from method MR::UnionFind<MR::UndirectedEdgeId>::operator=.

Calls MR_UnionFind_MR_UndirectedEdgeId_AssignFromAnother(). The reference to things referred to by the parameter _other (if any) might be preserved in this object.

◆ construct_from_another()

auto meshlib::UnionFind_MR_UndirectedEdgeId::construct_from_another ( _other:&meshlib::UnionFind_MR_UndirectedEdgeId ) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static

Generated from constructor MR::UnionFind<MR::UndirectedEdgeId>::UnionFind.

Calls MR_UnionFind_MR_UndirectedEdgeId_ConstructFromAnother(). The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.

◆ construct_mr_base_union_find_mr_undirected_edge_id()

auto meshlib::UnionFind_MR_UndirectedEdgeId::construct_mr_base_union_find_mr_undirected_edge_id ( base:&mut meshlib::BaseUnionFind_MR_UndirectedEdgeId ) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static

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.

Calls MR_UnionFind_MR_UndirectedEdgeId_Construct_MR_BaseUnionFind_MR_UndirectedEdgeId(). The reference to the parameter base might be preserved in the constructed object.

◆ construct_size_t()

auto meshlib::UnionFind_MR_UndirectedEdgeId::construct_size_t ( size:usize ) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static

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.

Calls MR_UnionFind_MR_UndirectedEdgeId_Construct_size_t(). The reference to the parameter size might be preserved in the constructed object.

◆ find()

auto meshlib::UnionFind_MR_UndirectedEdgeId::find ( a:meshlib::UndirectedEdgeId ) -> meshlib::UndirectedEdgeId

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().

◆ find_update_range()

auto meshlib::UnionFind_MR_UndirectedEdgeId::find_update_range ( a:meshlib::UndirectedEdgeId ,
begin:meshlib::UndirectedEdgeId ,
end:meshlib::UndirectedEdgeId  ) -> meshlib::UndirectedEdgeId

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().

◆ is_root()

auto meshlib::UnionFind_MR_UndirectedEdgeId::is_root ( a:meshlib::UndirectedEdgeId ) const -> bool

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().

◆ new()

auto meshlib::UnionFind_MR_UndirectedEdgeId::new ( ) -> meshlib::Owned< meshlib::UnionFind_MR_UndirectedEdgeId >
static

Constructs an empty (default-constructed) instance.

Calls MR_UnionFind_MR_UndirectedEdgeId_DefaultConstruct().

◆ parent()

auto meshlib::UnionFind_MR_UndirectedEdgeId::parent ( a:meshlib::UndirectedEdgeId ) const -> meshlib::UndirectedEdgeId

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()

auto meshlib::UnionFind_MR_UndirectedEdgeId::parents ( ) const -> &meshlib::UndirectedEdgeMap

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 ( size:usize )

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()

auto meshlib::UnionFind_MR_UndirectedEdgeId::roots ( ) -> &meshlib::UndirectedEdgeMap

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()

auto meshlib::UnionFind_MR_UndirectedEdgeId::size ( ) const -> usize

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

Calls MR_UnionFind_MR_UndirectedEdgeId_size().

◆ size_of_comp()

auto meshlib::UnionFind_MR_UndirectedEdgeId::size_of_comp ( a:meshlib::UndirectedEdgeId ) -> core::ffi::c_int

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().

◆ static_downcast_from_base_union_find_mr_undirected_edge_id()

auto meshlib::UnionFind_MR_UndirectedEdgeId::static_downcast_from_base_union_find_mr_undirected_edge_id ( object:&meshlib::BaseUnionFind_MR_UndirectedEdgeId ) -> &Self
static

Static downcast from the base class MR::BaseUnionFind<MR::UndirectedEdgeId>.

Calls MR_UnionFind_MR_UndirectedEdgeId_StaticDowncastFrom_MR_BaseUnionFind_MR_UndirectedEdgeId(). Undefined behavior if the object isn't actually a UnionFind_MR_UndirectedEdgeId.

Note
This function is unsafe.

◆ static_downcast_from_base_union_find_mr_undirected_edge_id_mut()

auto meshlib::UnionFind_MR_UndirectedEdgeId::static_downcast_from_base_union_find_mr_undirected_edge_id_mut ( object:&mut meshlib::BaseUnionFind_MR_UndirectedEdgeId ) -> &mut Self
static

Static downcast from the base class MR::BaseUnionFind<MR::UndirectedEdgeId>.

Calls MR_UnionFind_MR_UndirectedEdgeId_MutableStaticDowncastFrom_MR_BaseUnionFind_MR_UndirectedEdgeId(). Undefined behavior if the object isn't actually a UnionFind_MR_UndirectedEdgeId.

Note
This function is unsafe.

◆ unite()

auto meshlib::UnionFind_MR_UndirectedEdgeId::unite ( first:meshlib::UndirectedEdgeId ,
second:meshlib::UndirectedEdgeId  ) -> meshlib::Owned< meshlib::std_pair_MR_UndirectedEdgeId_bool >

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().

◆ unite_unbalanced()

auto meshlib::UnionFind_MR_UndirectedEdgeId::unite_unbalanced ( first:meshlib::UndirectedEdgeId ,
second:meshlib::UndirectedEdgeId  ) -> meshlib::Owned< meshlib::std_pair_MR_UndirectedEdgeId_bool >

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().

◆ united()

auto meshlib::UnionFind_MR_UndirectedEdgeId::united ( first:meshlib::UndirectedEdgeId ,
second:meshlib::UndirectedEdgeId  ) -> bool

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

Calls MR_UnionFind_MR_UndirectedEdgeId_united().

◆ upcast_to_base_union_find_mr_undirected_edge_id()

auto meshlib::UnionFind_MR_UndirectedEdgeId::upcast_to_base_union_find_mr_undirected_edge_id ( ) const -> &meshlib::BaseUnionFind_MR_UndirectedEdgeId

Upcasts to the base class MR::BaseUnionFind<MR::UndirectedEdgeId>.

Calls MR_UnionFind_MR_UndirectedEdgeId_UpcastTo_MR_BaseUnionFind_MR_UndirectedEdgeId().

◆ upcast_to_base_union_find_mr_undirected_edge_id_mut()

auto meshlib::UnionFind_MR_UndirectedEdgeId::upcast_to_base_union_find_mr_undirected_edge_id_mut ( ) -> &mut meshlib::BaseUnionFind_MR_UndirectedEdgeId

Upcasts to the base class MR::BaseUnionFind<MR::UndirectedEdgeId>.

Calls MR_UnionFind_MR_UndirectedEdgeId_MutableUpcastTo_MR_BaseUnionFind_MR_UndirectedEdgeId().


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