diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:11:20 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2024-06-04 11:11:20 +0200 |
commit | fe852453c0cb80e05a0adc4a95ceb52873461851 (patch) | |
tree | 313beb43b025917264da93048c1f1f8d63d15c84 /test | |
parent | 68870236395435606a767c4c8c1a6b45f5c1ff64 (diff) |
Modify substitution routines to return vectors
Diffstat (limited to 'test')
-rw-r--r-- | test/test_solvers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_solvers.py b/test/test_solvers.py index 5b5da6f..a7c175f 100644 --- a/test/test_solvers.py +++ b/test/test_solvers.py @@ -43,7 +43,7 @@ def test_lu_factorization() -> None: def test_forward_substitution() -> None: ll = np.array([[2.0, 0.0, 0.0], [-1.0, 2.0, 0.0], [4.0, 4.0, 2.0]]) bb = np.array([3.0, 2.0, 1.0]) - xx_result = solvers.forward_substitution(ll, bb)[:, 0] + xx_result = solvers.forward_substitution(ll, bb) xx_expected = np.array([3 / 2, 7.0 / 4.0, -6]) print(xx_result) assert np.allclose(xx_expected, xx_result) @@ -51,7 +51,7 @@ def test_forward_substitution() -> None: def test_back_substitution() -> None: uu = np.array([[2.0, 4.0, 4.0], [0.0, 2.0, -1.0], [0.0, 0.0, 2.0]]) bb = np.array([1.0, 2.0, 3.0]) - xx_result = solvers.back_substitution(uu, bb)[:, 0] + xx_result = solvers.back_substitution(uu, bb) xx_expected = np.array([-6, 7.0 / 4.0, 3.0 / 2.0]) print(xx_result) assert np.allclose(xx_expected, xx_result) |