smallestEigenpairs
Finds the count smallest eigenpairs of this symmetric positive-semidefinite sparse matrix, using shift-invert Lanczos: builds one Krylov subspace for the operator v -> solve(this, v) (via SparseMatrix.solveCG) -- which maps this matrix's smallest eigenvalues to its largest, the ones Lanczos converges to fastest -- and extracts Ritz pairs from the resulting small, dense tridiagonal eigenproblem.
Unlike a per-mode inverse power iteration, this amortizes work across every requested mode: it needs roughly count matrix solves in total, not count independent from-scratch searches, and it also handles closely-spaced eigenvalues far better than plain power iteration (whose convergence rate for a mode degrades as its eigenvalue gets closer to the next one). This is intended for matrices where only a modest number of the smallest eigenpairs are needed, such as the discrete Laplacians produced by buildDirichletLaplacian -- it is not a general-purpose eigensolver.
Results are returned in ascending order of eigenvalue, each eigenvector sign-normalized (see normalizeSign) so that repeated calls -- and calls across nearby random sources or resolutions -- agree on orientation instead of flipping arbitrarily.
Parameters
The total number of smallest eigenpairs to return, including any knownEigenpairs. Clamped to the matrix size.
Eigenpairs already known analytically -- typically the zero eigenvalue of a singular (Neumann/graph) Laplacian, whose eigenvector is the constant vector. These are placed first in the result and deflated against throughout the Lanczos process, which both seeds and skips the (otherwise ill-posed, since this matrix is then singular) search for them.
Source of the random initial vectors. Defaults to a fixed seed (Random(0)) for reproducible results; pass e.g. a fresh Random(System.nanoTime()) for a different realization of any degenerate modes on each call.
Relative residual tolerance passed to the inner SparseMatrix.solveCG solves.