aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-05-14 18:01:15 +0200
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-05-14 18:01:15 +0200
commit1a90133ff849e1f38a1a0c5cf47c36d4ad1850bd (patch)
tree0dd8dfb093f8f6ffbec9d0169ec39436399d5ecb
parent35b9fdf6b4c8e34e13dac72899f05be9afccc0e1 (diff)
Add dtype to matrix
* linsolver/solvers.py (gaussian_elimination): Specify dtype of xx
-rw-r--r--solvers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/solvers.py b/solvers.py
index da38e2b..933bc2f 100644
--- a/solvers.py
+++ b/solvers.py
@@ -52,7 +52,7 @@ def gaussian_eliminate(
return None
# Back substitution
- xx = np.zeros((nn, 1))
+ xx = np.zeros((nn, 1), dtype=np.float_)
for i in range(nn - 1, -1, -1):
xx[i] = (ee[i, nn] - np.dot(ee[i, i:nn], xx[i:nn])) / ee[i, i]