Skip to main content

ArpackError

Enum ArpackError 

Source
pub enum ArpackError {
Show 26 variants NoError, Prod, NPos, NevNPos, NcvSmall, NonPosI, WhichInv, BmatInv, WorklSmall, TriDErr, ZeroStart, ModeInv, ModeBmat, IShift, NevBe, NoFact, Failed, Howmny, HowmnyS, EvDiff, Shur, Lapack, Unknown, MaxIt, NoShift, Reorder,
}
Expand description

Error conditions reported by ARPACK (igraph_arpack_error_t), see ArpackError::from_error and arpack_error_to_string.

Variants§

§

NoError

No error.

§

Prod

Matrix-vector product failed (not used any more).

§

NPos

N must be positive.

§

NevNPos

NEV must be positive.

§

NcvSmall

NCV must be bigger.

§

NonPosI

Maximum number of iterations should be positive.

§

WhichInv

Invalid WHICH parameter.

§

BmatInv

Invalid BMAT parameter.

§

WorklSmall

WORKL is too small.

§

TriDErr

LAPACK error in tridiagonal eigenvalue calculation.

§

ZeroStart

Starting vector is zero.

§

ModeInv

MODE is invalid.

§

ModeBmat

MODE and BMAT are not compatible.

§

IShift

ISHIFT must be 0 or 1.

§

NevBe

NEV and WHICH=‘BE’ are incompatible.

§

NoFact

Could not build an Arnoldi factorization.

§

Failed

No eigenvalues to sufficient accuracy.

§

Howmny

HOWMNY is invalid.

§

HowmnyS

HOWMNY=‘S’ is not implemented.

§

EvDiff

Different number of converged Ritz values.

§

Shur

Error from calculation of a real Schur form.

§

Lapack

LAPACK (dtrevc) error for calculating eigenvectors.

§

Unknown

Unknown ARPACK error.

§

MaxIt

Maximum number of iterations reached.

§

NoShift

No shifts could be applied during a cycle of the implicitly restarted Arnoldi iteration.

§

Reorder

The Schur form could not be reordered.

Implementations§

Source§

impl ArpackError

Source

pub fn from_error(error: &Error) -> Option<Self>

The ARPACK error condition behind an ErrorKind::Arpack error, recognized from its message (igraph reports ARPACK failures with the text of arpack_error_to_string); None for other errors.

Unlike arpack_last_error this is thread-safe: it only looks at the error value returned by the failed call.

use igraph::{linalg::*, ErrorKind};
// The Laplacian of a path, started from its eigenvector (1, ..., 1) of
// eigenvalue 0: ARPACK's first Krylov vector is zero.
let n = 6;
let path = move |x: &[f64], y: &mut [f64]| {
    for i in 0..n {
        let deg = if i == 0 || i == n - 1 { 1.0 } else { 2.0 };
        y[i] = deg * x[i];
        if i > 0 {
            y[i] -= x[i - 1];
        }
        if i + 1 < n {
            y[i] -= x[i + 1];
        }
    }
};
let opts = ArpackOptions::default()
    .with_start(vec![1.0; n])
    .with_which(ArpackWhich::SmallestMagnitude);
let err = arpack_rssolve(n, path, &opts, None).unwrap_err();
assert_eq!(err.kind(), ErrorKind::Arpack);
assert_eq!(ArpackError::from_error(&err), Some(ArpackError::ZeroStart));

Trait Implementations§

Source§

impl Clone for ArpackError

Source§

fn clone(&self) -> ArpackError

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 Copy for ArpackError

Source§

impl Debug for ArpackError

Source§

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

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

impl Display for ArpackError

Source§

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

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

impl Eq for ArpackError

Source§

impl From<ArpackError> for igraph_arpack_error_t

Source§

fn from(value: ArpackError) -> igraph_arpack_error_t

Converts to this type from the input type.
Source§

impl Hash for ArpackError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ArpackError

Source§

fn eq(&self, other: &ArpackError) -> 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 ArpackError

Source§

impl TryFrom<u32> for ArpackError

Source§

type Error = Error

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

fn try_from(value: igraph_arpack_error_t) -> Result<Self>

Performs the conversion.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.