示例#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)