num::lanczos¶
Defined in header <linear/eigen/lanczos.hpp>
template <class Op>
requires self_adjoint_operator<Op, vec<real>>
lanczos_result lanczos(const Op &A, idx k, real tol = 1e-10, idx max_steps = 0); // (1)
lanczos_result lanczos(const with_law<mat<real>, law::self_adjoint> &A, idx k,
real tol = 1e-10, idx max_steps = 0); // (2)
(1) Compute \(k\) extreme eigenvalues and eigenvectors by the Lanczos method: \(A v \approx \lambda v\).
(2) Compute extreme eigenpairs of a matrix tagged symmetric, by Lanczos: \(A v \approx \lambda v\).
Exceptions¶
std::invalid_argument: Ifkis out of range orAis not square.