36 for (
idx i = 0; i < v.
size(); ++i)
40 for (
idx i = 0; i < v.
size(); ++i)
constexpr idx size() const noexcept
Backend enum for linear algebra operations.
LU factorization with partial pivoting.
real normalise(Vector &v)
Normalise v in-place; returns the old norm.
Backend
Selects which backend handles a linalg operation.
PowerResult inverse_iteration(const Matrix &A, real sigma, real tol=1e-10, idx max_iter=1000, Backend backend=default_backend)
Inverse iteration – finds the eigenvalue closest to a shift sigma.
PowerResult power_iteration(const Matrix &A, real tol=1e-10, idx max_iter=1000, Backend backend=default_backend)
Power iteration – finds the eigenvalue largest in absolute value.
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
constexpr Backend default_backend
PowerResult rayleigh_iteration(const Matrix &A, const Vector &x0, real tol=1e-10, idx max_iter=50, Backend backend=default_backend)
Rayleigh quotient iteration – cubically convergent.
Result of a single-eigenvalue iteration.
real eigenvalue
Converged eigenvalue (Rayleigh quotient)
idx iterations
Iterations performed.
Vector eigenvector
Corresponding unit eigenvector.
bool converged
Whether tolerance was met.