pub fn eigsh_shift_invert<T>(
matrix: &SymCsrMatrix<T>,
sigma: T,
k: Option<usize>,
which: Option<&str>,
options: Option<LanczosOptions>,
) -> SparseResult<EigenResult<T>>where
T: Float + Debug + Copy + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T> + Sum + SimdUnifiedOps + SparseElement + PartialOrd + Send + Sync + 'static,Expand description
Find eigenvalues near a target value using shift-and-invert mode
This function computes eigenvalues of a symmetric matrix that are closest to a specified target value (sigma) using the shift-and-invert transformation. It solves (A - sigma*I)^(-1)x = mux and transforms back to get eigenvalues lambda = sigma + 1/mu.
§Arguments
matrix- The symmetric sparse matrixsigma- The shift value (target eigenvalue)k- Number of eigenvalues to compute (default: 6)which- Which eigenvalues to compute after transformation (default: “LM”)options- Additional options for the solver
§Returns
Eigenvalue computation result with eigenvalues near sigma
§Examples
use scirs2_sparse::linalg::eigsh_shift_invert;
use scirs2_sparse::sym_csr::SymCsrMatrix;
// Symmetric 2x2 matrix stored as lower triangle
let data = vec![4.0, 2.0, 5.0];
let indptr = vec![0, 1, 3];
let indices = vec![0, 0, 1];
let matrix = SymCsrMatrix::new(data, indptr, indices, (2, 2)).unwrap();
// Find eigenvalues near 2.5
let result = eigsh_shift_invert(&matrix, 2.5, Some(2), None, None).unwrap();