diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:26:32 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:26:32 +0200 |
commit | fc10b363b3c35313ac2f1bf14f83daec2bf22c41 (patch) | |
tree | 310335d19fc0623222ff2aca138947e29bc00c1e /solvers.py | |
parent | fe852453c0cb80e05a0adc4a95ceb52873461851 (diff) |
Diffstat (limited to 'solvers.py')
-rw-r--r-- | solvers.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -92,7 +92,7 @@ def gaussian_eliminate( aa: NDArray[np.float_], bb: NDArray[np.float_], tolerance: float = 1e-6 -) -> NDArray[np.float_] | None: +) -> NDArray[np.float_]: '''Solves a linear system of equations (A x = b) by LUP factorization. Args: @@ -108,7 +108,7 @@ def gaussian_eliminate( nn = uu.shape[0] # Check if rank of matrix is lower than nn if np.abs(uu[nn - 1, nn - 1]) < tolerance: - return None + raise ValueError # L y = P @ b y = forward_substitution(ll, pp @ bb) |