pub struct LeidenOptions<'a> {
pub resolution: f64,
pub beta: f64,
pub iterations: Option<u32>,
pub initial: Option<&'a [i64]>,
}Expand description
Options of Graph::community_leiden and Graph::community_leiden_simple.
Fields§
§resolution: f64Resolution parameter γ (default 1.0). Note that for the raw
Graph::community_leiden interface, modularity is obtained with
degrees as vertex weights and γ = 1 / (2m).
beta: f64Randomness in the refinement step (default 0.01).
iterations: Option<u32>Number of iterations of the core algorithm (default Some(2));
None iterates until an iteration does not change the partition.
initial: Option<&'a [i64]>Starting partition (default None: singletons).
Implementations§
Source§impl<'a> LeidenOptions<'a>
impl<'a> LeidenOptions<'a>
Sourcepub fn with_resolution(self, resolution: f64) -> Self
pub fn with_resolution(self, resolution: f64) -> Self
Sets the resolution parameter.
Sourcepub fn with_iterations(self, iterations: Option<u32>) -> Self
pub fn with_iterations(self, iterations: Option<u32>) -> Self
Sets the number of iterations (None: until convergence).
Sourcepub fn with_initial(self, initial: &'a [i64]) -> Self
pub fn with_initial(self, initial: &'a [i64]) -> Self
Sets the starting partition.
Trait Implementations§
Source§impl<'a> Clone for LeidenOptions<'a>
impl<'a> Clone for LeidenOptions<'a>
Source§fn clone(&self) -> LeidenOptions<'a>
fn clone(&self) -> LeidenOptions<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for LeidenOptions<'a>
impl<'a> Debug for LeidenOptions<'a>
Source§impl Default for LeidenOptions<'_>
impl Default for LeidenOptions<'_>
Source§impl<'a> PartialEq for LeidenOptions<'a>
impl<'a> PartialEq for LeidenOptions<'a>
Source§fn eq(&self, other: &LeidenOptions<'a>) -> bool
fn eq(&self, other: &LeidenOptions<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for LeidenOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for LeidenOptions<'a>
impl<'a> RefUnwindSafe for LeidenOptions<'a>
impl<'a> Send for LeidenOptions<'a>
impl<'a> Sync for LeidenOptions<'a>
impl<'a> Unpin for LeidenOptions<'a>
impl<'a> UnsafeUnpin for LeidenOptions<'a>
impl<'a> UnwindSafe for LeidenOptions<'a>
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