def test_orthogonalize(): """ test that the orthogonalization is OK """ X = np.random.randn(100, 5) X = _orthogonalize(X) K = np.dot(X.T, X) K -= np.diag(np.diag(K)) assert_almost_equal((K**2).sum(), 0, 15)
def test_orthogonalize(): """ test that the orthogonalization is OK """ X = np.random.randn(100, 5) X = _orthogonalize(X) K = np.dot(X.T, X) K -= np.diag(np.diag(K)) assert_almost_equal((K ** 2).sum(), 0, 15)
def test_orthogonalize_trivial(): """ test that the orthogonalization is OK """ X = np.random.randn(100) Y = X.copy() X = _orthogonalize(X) assert_array_equal(Y, X)