diff options
| author | y-jan137 <yousefjan24000@gmail.com> | 2026-04-27 07:24:41 +0300 |
|---|---|---|
| committer | y-jan137 <yousefjan24000@gmail.com> | 2026-04-27 07:24:41 +0300 |
| commit | 4602b36e9d5ea08656e3222846a1f161bbb1cec1 (patch) | |
| tree | 87618f154f7ebe91657ba1501d695d45a31e7881 /include/qr.hpp | |
| parent | b8bc28c70a6f2b0e7de81e85a796303d514df008 (diff) | |
Module refactor
Diffstat (limited to 'include/qr.hpp')
| -rw-r--r-- | include/qr.hpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/include/qr.hpp b/include/qr.hpp deleted file mode 100644 index c9e1638..0000000 --- a/include/qr.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "matrix.hpp" -#include "vector.hpp" - -namespace linalg { - -struct QRResult { - Matrix Q; - Matrix R; -}; - -// Classical Gram-Schmidt. -// Mathematically natural but numerically fragile: orthogonality of Q -// degrades rapidly on ill-conditioned inputs. -// Provided for comparison — prefer modified_gs or householder in practice. -// -// Throws DimensionMismatchError if rows < cols. -// Throws SingularMatrixError if a column is (nearly) linearly dependent. -QRResult qr_classical_gs(const Matrix& A, double zero_tolerance = 1e-14); - -// Modified Gram-Schmidt. -// Subtracts each projection immediately on the running vector rather than -// on the original column. Algebraically equivalent to classical GS but -// numerically much better — round-off stays local instead of accumulating. -// -// Same exceptions as classical GS. -QRResult qr_modified_gs(const Matrix& A, double zero_tolerance = 1e-14); - -// Householder QR. -// Applies a sequence of orthogonal reflections to zero out below-diagonal -// entries column by column. Backward-stable and the standard choice for -// dense QR. Works correctly on rank-deficient matrices (zero pivots -// produce zero diagonal entries in R without throwing). -// -// Throws DimensionMismatchError if rows < cols. -QRResult qr_householder(const Matrix& A); - -} // namespace linalg |