pub struct ReindexMembershipResult {
pub membership: Vec<u32>,
pub new_to_old: Vec<u32>,
}Expand description
Result of reindex_membership: a densified membership vector
[0, k), the old cluster id behind each new id (so new_to_old[i]
is the original id that now maps to i), and the number of
distinct clusters k = new_to_old.len().
Fields§
§membership: Vec<u32>membership[v] ∈ [0, k) — the densified cluster id of vertex
v.
new_to_old: Vec<u32>new_to_old[i] — the original cluster id that vertex
encounters with this id now map to. nb_clusters = new_to_old.len().
Implementations§
Source§impl ReindexMembershipResult
impl ReindexMembershipResult
Sourcepub fn nb_clusters(&self) -> u32
pub fn nb_clusters(&self) -> u32
Number of distinct clusters in the densified membership.
§Examples
use rust_igraph::reindex_membership;
let r = reindex_membership(&[5, 5, 10, 10, 5]).unwrap();
assert_eq!(r.nb_clusters(), 2);Trait Implementations§
Source§impl Clone for ReindexMembershipResult
impl Clone for ReindexMembershipResult
Source§fn clone(&self) -> ReindexMembershipResult
fn clone(&self) -> ReindexMembershipResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReindexMembershipResult
impl Debug for ReindexMembershipResult
Source§impl PartialEq for ReindexMembershipResult
impl PartialEq for ReindexMembershipResult
impl Eq for ReindexMembershipResult
impl StructuralPartialEq for ReindexMembershipResult
Auto Trait Implementations§
impl Freeze for ReindexMembershipResult
impl RefUnwindSafe for ReindexMembershipResult
impl Send for ReindexMembershipResult
impl Sync for ReindexMembershipResult
impl Unpin for ReindexMembershipResult
impl UnsafeUnpin for ReindexMembershipResult
impl UnwindSafe for ReindexMembershipResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more