mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
tests: tests for linalg and obs extended.
This commit is contained in:
parent
c9e1cd10af
commit
cd2f361a3e
2 changed files with 32 additions and 0 deletions
|
@ -314,6 +314,9 @@ def test_matrix_functions():
|
|||
# Check determinant
|
||||
assert pe.linalg.det(np.diag(np.diag(matrix))) == np.prod(np.diag(matrix))
|
||||
|
||||
with pytest.raises(Exception):
|
||||
pe.linalg.det(5)
|
||||
|
||||
pe.linalg.pinv(matrix[:,:3])
|
||||
|
||||
|
||||
|
@ -347,3 +350,10 @@ def test_complex_matrix_operations():
|
|||
diff = ta * tb - 1
|
||||
for (i, j), entry in np.ndenumerate(diff):
|
||||
assert entry.is_zero()
|
||||
|
||||
|
||||
def test_complex_matrix_real_entries():
|
||||
my_mat = get_complex_matrix(4)
|
||||
my_mat[0, 1] = 4
|
||||
my_mat[2, 0] = pe.Obs([np.random.normal(1.0, 0.1, 100)], ['t'])
|
||||
assert np.all((my_mat @ pe.linalg.inv(my_mat) - np.identity(4)) == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue