|
NumericAL
A header-only C++20 lexer built on REAL
|
Matrix factorisations and the algorithms built on them. More...
Go to the source code of this file.
Matrix factorisations and the algorithms built on them.
numerical::lu_decomposition factorises a square matrix once (Gaussian elimination with partial pivoting — an in-place P A = L U), then answers any number of queries cheaply: numerical::lu_decomposition::solve a system, its numerical::lu_decomposition::determinant, or its numerical::lu_decomposition::inverse. Free numerical::solve, numerical::determinant and numerical::inverse are one-shot conveniences over it.
The scalar T must be a field (support division) — double, std::complex<double>, … — and the partial pivoting is numerically stable for well-conditioned systems. A singular matrix has a zero determinant; asking it to solve or invert throws numerical::singular_matrix_error.
Every factorisation here refuses an infinite or NaN entry where it starts, with a numerical::non_finite_error, since none of them means anything on one and the iterative ones would stop at once and return plausible values.
This header gathers them: the factorisations are in factorizations.hpp, the singular value decomposition and what it answers (least squares, the pseudo-inverse, the rank) in svd.hpp.
Definition in file decomposition.hpp.