Пример #1
0
def test_gfpp():
    """Simple exercise of generating the gfpp matrix
    we know this matrix has a growth factor given by 2**(n - 1), which
    for n = 5 is 16, so we just check for that (assumes ge is correct)
    """
    a = rogues.gfpp(5)
    l, u, r = rogues.ge(a)
    npt.assert_almost_equal(r, 16., 8)
Пример #2
0
def test_gfpp():
    """Simple exercise of generating the gfpp matrix
    we know this matrix has a growth factor given by 2**(n - 1), which
    for n = 5 is 16, so we just check for that (assumes ge is correct)
    """
    a = rogues.gfpp(5)
    l, u, r = rogues.ge(a)
    npt.assert_almost_equal(r, 16., 8)
Пример #3
0
def test_ge():
    """Simple exercise of the ge (Gaussian elimination)"""
    a = rogues.gfpp(5)
    l, u, r = rogues.ge(a)
    b = np.matrix(l) * np.matrix(u)
    npt.assert_array_almost_equal(a, b, 12)