mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
docstrings and tests added to linalg module
This commit is contained in:
parent
14cf1f7d1b
commit
eedad7deda
3 changed files with 21 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue