mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
tests: test for is_matrix_symmetric added.
This commit is contained in:
parent
42f62380b4
commit
4a6dfe3482
1 changed files with 22 additions and 0 deletions
|
@ -367,6 +367,28 @@ def test_matrix_symmetric():
|
|||
corr3.matrix_symmetric()
|
||||
|
||||
|
||||
def test_is_matrix_symmetric():
|
||||
corr_data = []
|
||||
for t in range(4):
|
||||
mat = np.zeros((4, 4), dtype=object)
|
||||
for i in range(4):
|
||||
for j in range(i, 4):
|
||||
obs = pe.pseudo_Obs(0.1, 0.047, "rgetrasrewe53455b153v13v5/*/*sdfgb")
|
||||
mat[i, j] = obs
|
||||
if i != j:
|
||||
mat[j, i] = obs
|
||||
corr_data.append(mat)
|
||||
corr = pe.Corr(corr_data)
|
||||
|
||||
assert corr.is_matrix_symmetric()
|
||||
corr[0][0, 1] = 1.0 * corr[0][0, 1]
|
||||
assert corr.is_matrix_symmetric()
|
||||
corr[3][2, 1] = (1 + 1e-14) * corr[3][2, 1]
|
||||
assert corr.is_matrix_symmetric()
|
||||
corr[0][0, 1] = 1.1 * corr[0][0, 1]
|
||||
assert not corr.is_matrix_symmetric()
|
||||
|
||||
|
||||
def test_GEVP_solver():
|
||||
|
||||
mat1 = np.random.rand(15, 15)
|
||||
|
|
Loading…
Add table
Reference in a new issue