aboutsummaryrefslogtreecommitdiff
path: root/solvers.py
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-06-04 11:08:51 +0200
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-06-04 11:08:51 +0200
commit68870236395435606a767c4c8c1a6b45f5c1ff64 (patch)
tree535d787e504f336ea934137a5bb137cbd5b0b49a /solvers.py
parent255c2e7b7bf721296d4d4f22cb106ab3cf197e0a (diff)
Add tests for LU routine
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 040c6f4..c7d421c 100644
--- a/solvers.py
+++ b/solvers.py
@@ -6,7 +6,7 @@ from numpy.typing import NDArray
def lu_factorization(
mm: NDArray[np.float_],
tolerance: float = 1e-6
-) -> NDArray[np.float_]:
+) -> tuple[NDArray[np.float_], NDArray[np.float_], NDArray[np.float_]]:
'''Computes the LUP factorization of a matrix
Args:
@@ -28,7 +28,7 @@ def lu_factorization(
j = 0
while i < nn and j < nn:
- pivot_row = i + np.argmax(np.abs(uu[i:, j]))
+ pivot_row = i + int(np.argmax(np.abs(uu[i:, j])))
if np.abs(uu[pivot_row, j]) < tolerance:
j = j + 1