Пример #1
0
def test_dramadah_c():
    """Simple test of dramadah(10, 3).  We check that it's determinant is
    the n-th Fibonacci number"""
    a = rogues.dramadah(10, 3)
    x = nl.det(a)
    gf = fib()
    y = [gf.next() for i in range(10)]
    npt.assert_almost_equal(x, y[9])
Пример #2
0
def test_dramadah_c():
    """Simple test of dramadah(10, 3).  We check that it's determinant is
    the n-th Fibonacci number"""
    a = rogues.dramadah(10, 3)
    x = nl.det(a)
    gf = fib()
    y = [gf.next() for i in range(10)]
    npt.assert_almost_equal(x, y[9])
Пример #3
0
def test_dramadah_b():
    """Simple test of dramadah(10, 2).  We check that all eigenvalues == 1"""
    a = rogues.dramadah(10, 2)
    w, v = nl.eig(a)
    npt.assert_array_equal(w, np.ones(10))
Пример #4
0
def test_dramadah_a():
    """Simple test of dramadah(10,1).  We check to that abs(det()) == 1"""
    a = rogues.dramadah(10)
    npt.assert_almost_equal(abs(nl.det(a)), 1, 12)
Пример #5
0
def test_dramadah_b():
    """Simple test of dramadah(10, 2).  We check that all eigenvalues == 1"""
    a = rogues.dramadah(10, 2)
    w, v = nl.eig(a)
    npt.assert_array_equal(w, np.ones(10))
Пример #6
0
def test_dramadah_a():
    """Simple test of dramadah(10,1).  We check to that abs(det()) == 1"""
    a = rogues.dramadah(10)
    npt.assert_almost_equal(abs(nl.det(a)), 1, 12)