pub fn shift_invert(
a: &HostCsr,
sigma: f64,
max_iter: usize,
tol: f64,
) -> SparseResult<ShiftInvertResult>Expand description
Finds the eigenvalue of a closest to the shift sigma via shift-invert
power iteration.
The matrix a must be square. It need not be symmetric, though the Rayleigh
quotient recovery is most accurate (and convergence cleanest) for symmetric
a. The shift sigma must not coincide exactly with an eigenvalue, since
A − σI would then be singular; a shift merely close to an eigenvalue is
ideal and accelerates convergence.
§Arguments
a– the square host CSR matrix.sigma– the target shift; the eigenvalue nearest this value is sought.max_iter– maximum number of power iterations (≥ 1).tol– residual tolerance‖A v − λ v‖for convergence.
§Errors
Returns SparseError::DimensionMismatch if a is not square,
SparseError::InvalidArgument if a is empty or max_iter == 0,
SparseError::SingularMatrix if A − σI is numerically singular (the
shift hit an eigenvalue exactly), and SparseError::ConvergenceFailure if
the iterate collapses (e.g. an unreachable spectrum component).