Skip to main content

ArpackOptions

Struct ArpackOptions 

Source
pub struct ArpackOptions {
    pub nev: usize,
    pub which: ArpackWhich,
    pub tol: f64,
    pub ncv: usize,
    pub mxiter: usize,
    pub mode: ArpackMode,
    pub start: Option<Vec<f64>>,
}
Expand description

Options of the ARPACK eigensolvers (a safe subset of igraph_arpack_options_t).

Default gives igraph’s defaults (igraph_arpack_options_init): one eigenvalue of largest magnitude, machine precision tolerance, automatic number of Lanczos/Arnoldi vectors, at most 3000 iterations, regular mode and a random start vector (drawn from igraph’s RNG, so results are reproducible after rng::seed).

The functions that pick which and nev themselves (e.g. eigen_matrix_symmetric, Graph::eigen_adjacency or the spectral embeddings) ignore those fields as well as ncv, mode and the start vector: they only use tol and mxiter.

use igraph::linalg::{ArpackOptions, ArpackWhich};
let opts = ArpackOptions::default().with_nev(3).with_which(ArpackWhich::SmallestAlgebraic).with_tol(1e-10);
assert_eq!(opts.nev, 3);
assert_eq!(opts.mxiter, 3000);

Fields§

§nev: usize

Number of eigenvalues to compute (nev), at least 1 and smaller than the order of the matrix (at most n - 2 for non-symmetric problems).

§which: ArpackWhich

Which eigenvalues to compute.

§tol: f64

Relative accuracy of the Ritz values; 0 means machine precision.

§ncv: usize

Number of Lanczos (Arnoldi) vectors; 0 lets igraph choose. Otherwise it must satisfy nev < ncv <= n.

§mxiter: usize

Maximum number of Arnoldi update iterations.

§mode: ArpackMode

Regular or shift-and-invert mode.

§start: Option<Vec<f64>>

Starting vector (length n); None draws a random one.

Implementations§

Source§

impl ArpackOptions

Source

pub fn with_nev(self, nev: usize) -> Self

Sets the number of eigenvalues to compute.

Source

pub fn with_which(self, which: ArpackWhich) -> Self

Sets which eigenvalues to compute.

Source

pub fn with_tol(self, tol: f64) -> Self

Sets the tolerance.

Source

pub fn with_ncv(self, ncv: usize) -> Self

Sets the number of Lanczos/Arnoldi vectors (0 = automatic).

Source

pub fn with_mxiter(self, mxiter: usize) -> Self

Sets the maximum number of iterations.

Source

pub fn with_shift_invert(self, sigma: f64) -> Self

Selects the shift-and-invert mode with the given shift.

Source

pub fn with_start(self, start: Vec<f64>) -> Self

Sets the starting vector.

Trait Implementations§

Source§

impl Clone for ArpackOptions

Source§

fn clone(&self) -> ArpackOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ArpackOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ArpackOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ArpackOptions

Source§

fn eq(&self, other: &ArpackOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ArpackOptions

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.