diff options
| author | y-jan137 <yousefjan24000@gmail.com> | 2026-03-16 11:52:36 +0300 |
|---|---|---|
| committer | y-jan137 <yousefjan24000@gmail.com> | 2026-03-16 11:52:36 +0300 |
| commit | b27583941c200f98ab328901e81c9188945bf708 (patch) | |
| tree | c9b0c2bddb8d89e4398e6dbf2d787bea10cffaac /include | |
| parent | 606ad99e8363bd520506ea2e88b831911fe03c18 (diff) | |
Cleanup
Diffstat (limited to 'include')
| -rw-r--r-- | include/lu.hpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/include/lu.hpp b/include/lu.hpp index 6717733..e7fe939 100644 --- a/include/lu.hpp +++ b/include/lu.hpp @@ -8,18 +8,6 @@ namespace linalg { -// Result of LU factorization with partial pivoting. -// -// The factorization satisfies PA = LU, where: -// P is the permutation matrix encoded by `perm` -// L is unit lower triangular (L[i][i] == 1) -// U is upper triangular -// -// `perm[i]` = index of the original row that ended up at position i. -// Applying P to a vector b means: (Pb)[i] = b[perm[i]]. -// -// `sign` is the sign of the permutation: +1 if an even number of row -// swaps were made, -1 if odd. Useful for computing det(A) = sign * prod(diag(U)). struct LUResult { Matrix L; Matrix U; @@ -27,17 +15,8 @@ struct LUResult { int sign; }; -// Compute the LU factorization of A with partial pivoting. -// -// Throws DimensionMismatchError if A is not square. -// Throws SingularMatrixError if A is (numerically) singular, i.e. any -// pivot is smaller in magnitude than `singular_tolerance`. LUResult lu_factor(const Matrix& A, double singular_tolerance = 1e-12); -// Solve Ax = b given a precomputed LU factorization. -// -// Applies the stored permutation, then forward / backward substitution. -// Throws DimensionMismatchError if b.size() != lu.L.rows(). Vector lu_solve(const LUResult& lu, const Vector& b); } // namespace linalg |