aboutsummaryrefslogtreecommitdiff
path: root/solvers.py
diff options
context:
space:
mode:
Diffstat (limited to 'solvers.py')
-rw-r--r--solvers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/solvers.py b/solvers.py
index 72f1b1d..38ac247 100644
--- a/solvers.py
+++ b/solvers.py
@@ -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)