예제 #1
0
 def test_flip_matrix(self, input, expected_output):
     """Test taking the absolute values of eigenvalues of a matrix."""
     assert np.allclose(kern.flip_matrix(input), expected_output)
예제 #2
0
 def test_do_nothing_on_non_negative(self, input):
     """Test thresholding, displacing and flipping matrix to do nothing on PSD matrices."""
     assert np.allclose(kern.threshold_matrix(input), input)
     assert np.allclose(kern.displace_matrix(input), input)
     assert np.allclose(kern.flip_matrix(input), input)