Skip to main content

LeadingEigenvectorStep

Struct LeadingEigenvectorStep 

Source
pub struct LeadingEigenvectorStep<'a> { /* private fields */ }
Expand description

The state passed to the callback of Graph::community_leading_eigenvector_with after each eigenvector computation.

Implementations§

Source§

impl LeadingEigenvectorStep<'_>

Source

pub fn membership(&self) -> &[i64]

The current membership vector, before applying the split implied by this eigenvector.

Source

pub fn community(&self) -> i64

The id of the community the algorithm is trying to split.

Source

pub fn eigenvalue(&self) -> f64

The leading eigenvalue just found; the community is split only if it is positive.

Source

pub fn eigenvector(&self) -> &[f64]

The corresponding eigenvector, with one element per vertex of the community (in increasing vertex id order).

Source

pub fn multiply(&self, x: &[f64]) -> Result<Vec<f64>>

Multiplies x by the (generalized) modularity matrix of the community being split, i.e. runs the ARPACK matrix-vector product igraph used to find this eigenvector. x must have the length of eigenvector.

For instance step.multiply(step.eigenvector()) is eigenvalue * eigenvector up to numerical accuracy.

§Errors

If x has a wrong length.

Trait Implementations§

Source§

impl Debug for LeadingEigenvectorStep<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.