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: usizeNumber 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: ArpackWhichWhich eigenvalues to compute.
tol: f64Relative accuracy of the Ritz values; 0 means machine precision.
ncv: usizeNumber of Lanczos (Arnoldi) vectors; 0 lets igraph choose. Otherwise
it must satisfy nev < ncv <= n.
mxiter: usizeMaximum number of Arnoldi update iterations.
mode: ArpackModeRegular or shift-and-invert mode.
start: Option<Vec<f64>>Starting vector (length n); None draws a random one.
Implementations§
Source§impl ArpackOptions
impl ArpackOptions
Sourcepub fn with_which(self, which: ArpackWhich) -> Self
pub fn with_which(self, which: ArpackWhich) -> Self
Sets which eigenvalues to compute.
Sourcepub fn with_ncv(self, ncv: usize) -> Self
pub fn with_ncv(self, ncv: usize) -> Self
Sets the number of Lanczos/Arnoldi vectors (0 = automatic).
Sourcepub fn with_mxiter(self, mxiter: usize) -> Self
pub fn with_mxiter(self, mxiter: usize) -> Self
Sets the maximum number of iterations.
Sourcepub fn with_shift_invert(self, sigma: f64) -> Self
pub fn with_shift_invert(self, sigma: f64) -> Self
Selects the shift-and-invert mode with the given shift.
Sourcepub fn with_start(self, start: Vec<f64>) -> Self
pub fn with_start(self, start: Vec<f64>) -> Self
Sets the starting vector.
Trait Implementations§
Source§impl Clone for ArpackOptions
impl Clone for ArpackOptions
Source§fn clone(&self) -> ArpackOptions
fn clone(&self) -> ArpackOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArpackOptions
impl Debug for ArpackOptions
Source§impl Default for ArpackOptions
impl Default for ArpackOptions
Source§impl PartialEq for ArpackOptions
impl PartialEq for ArpackOptions
Source§fn eq(&self, other: &ArpackOptions) -> bool
fn eq(&self, other: &ArpackOptions) -> bool
self and other values to be equal, and is used by ==.