docstrings and tests added to linalg module

This commit is contained in:
Fabian Joswig 2021-10-25 21:59:12 +01:00
parent 14cf1f7d1b
commit eedad7deda
3 changed files with 21 additions and 19 deletions

View file

@ -87,8 +87,7 @@ def test_complex_matrix_inverse():
def test_matrix_functions():
dim = 3 + int(4 * np.random.rand())
print(dim)
dim = 4
matrix = []
for i in range(dim):
row = []
@ -125,6 +124,13 @@ def test_matrix_functions():
for j in range(dim):
assert tmp[j].is_zero()
# Check svd
u, v, vh = pe.linalg.svd(sym)
diff = sym - u @ np.diag(v) @ vh
for (i, j), entry in np.ndenumerate(diff):
assert entry.is_zero()
def test_complex_matrix_operations():
dimension = 4

View file

@ -16,4 +16,4 @@ def test_root_linear():
assert np.isclose(my_root.value, value)
difference = my_obs - my_root
assert np.allclose(0.0, difference.deltas['t'])
assert difference.is_zero()