constexpr idx size() const noexcept
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.
constexpr T ipow(T x) noexcept
Compute x^N at compile time via repeated squaring.
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.
Backend enum for linear algebra operations.
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.