Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)