diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:08:51 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:08:51 +0200 |
commit | 68870236395435606a767c4c8c1a6b45f5c1ff64 (patch) | |
tree | 535d787e504f336ea934137a5bb137cbd5b0b49a /solvers.py | |
parent | 255c2e7b7bf721296d4d4f22cb106ab3cf197e0a (diff) |
Add tests for LU routine
Diffstat (limited to 'solvers.py')
-rw-r--r-- | solvers.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |