diff options
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) |