#[non_exhaustive]pub enum Error {
InvalidParam(&'static str),
AupdFailed {
info: i32,
iters: usize,
nconv: usize,
n_matvec: usize,
},
EupdFailed {
info: i32,
iters: usize,
nconv: usize,
n_matvec: usize,
},
UnexpectedIdo(i32),
MaxIterReached {
iters: usize,
nconv: usize,
n_matvec: usize,
},
NoShiftsApplied {
iters: usize,
nconv: usize,
n_matvec: usize,
},
ArnoldiFactorizationFailed {
iters: usize,
factorization_size: usize,
n_matvec: usize,
},
}Expand description
Errors raised by the safe ARPACK wrappers.
Documented ARPACK info codes are interpreted into named variants
so a non-expert consumer sees the meaning rather than a bare number,
while the raw info is retained as a field on the catch-all
variants so an ARPACK expert can still match it against the Users’
Guide. Each variant also carries the iparam writeback counters
(iters, nconv, n_matvec) describing the run that produced it.
Most documented codes are never observed here: the wrapper validates
n / nev / ncv / max_iter / which and hardcodes bmat,
mode, and ishift before the FFI call, so the parameter-misuse
band (info = -1..-7, -10..-13, the howmny codes) cannot be
returned by ARPACK. The reachable non-success *aupd_c codes are
info = 1 (Error::MaxIterReached / partial Ok), info = 3
(Error::NoShiftsApplied), info = -9999
(Error::ArnoldiFactorizationFailed), and the rare internal
failures -8 / -9 (catch-all Error::AupdFailed).
info = 1 from *aupd_c (max_iter reached before all nev Ritz
pairs converged) splits two ways depending on the converged count
reported in iparam[4]:
nconv == 0: no usable Ritz pair. Mapped toError::MaxIterReachedwith the diagnostic counters preserved so the caller can retry with a larger budget. The wrapper does not call*eupd_cin this case (symmetric*seupdwould quick-return with d/z untouched; complex*neupdwould returninfo = -14).0 < nconv < nev: partial extraction. Mapped toOk(MultiEigSolution { nconv, .. })carrying thenconvconverged pairs ARPACK was able to produce. This branch is only reachable from the multi-eigenpair drivers (eigenpairs_*); thenev = 1wrappers cannot observe it because there is no integer strictly between 0 and 1.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidParam(&'static str)
A wrapper-side parameter check failed before any FFI call.
AupdFailed
*aupd_c returned a non-zero info code that is not separately
modelled — a rare internal failure such as info = -8 (error
from the LAPACK eigenvalue calculation) or info = -9 (a
degenerate starting vector). The raw info is retained for
expert diagnosis; the iparam writeback counters describe the run.
Fields
EupdFailed
*eupd_c (eigenvector extraction) returned a non-zero info
code. Extraction failures are rare internal LAPACK and
converged-count-consistency errors whose numeric codes differ
between the real-symmetric and complex families, so they are
surfaced generically with the raw info retained rather than
modelled per code.
Fields
UnexpectedIdo(i32)
*aupd_c requested an ido value the wrapper does not support
(currently ido = 2, which only occurs for generalized
eigenproblems with bmat = 'G').
MaxIterReached
*aupd_c returned info = 1 AND iparam[4] == 0: the
iteration hit max_iter with zero converged Ritz pairs, so
no eigenpair could be extracted. The iparam writeback
counters are preserved so the caller can retry with a larger
max_iter. The partial-extraction case (0 < nconv < nev)
is reported through Ok(MultiEigSolution { nconv, .. })
instead and never via this variant.
Fields
iters: usizeiparam[2] writeback — restart iterations performed
(equals Options::max_iter when the cap was hit).
NoShiftsApplied
*aupd_c returned info = 3: no shifts could be applied during
a cycle of the Implicitly Restarted Arnoldi/Lanczos iteration,
so the restart stalled before convergence. The usual remedy is
to increase ncv relative to nev. The iparam writeback
counters are preserved.
Fields
ArnoldiFactorizationFailed
*aupd_c returned info = -9999: ARPACK could not build an
Arnoldi factorization of the requested size within max_iter.
Increasing max_iter or ncv may help. The iparam writeback
counters are preserved.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()