Exemplo n.º 1
0
def test_treshape_2():
    """Simple test of treshape_2"""
    n = 4
    m = n * (n + 1) / 2
    a = np.arange(1, m + 1)
    b = rogues.treshape(a, row_wise=True)
    c = rogues.treshape(b, unit=2, row_wise=True)
    npt.assert_array_equal(a, c)
Exemplo n.º 2
0
def test_treshape_0():
    """Simple test of treshape_0"""
    n = 4
    m = n * (n + 1) / 2
    a = np.arange(1, m + 1)
    b = rogues.treshape(a)
    c = rogues.treshape(b, unit=2)
    npt.assert_array_equal(a, c)
Exemplo n.º 3
0
def test_treshape_3():
    """Simple test of treshape_3"""
    n = 4
    m = n * (n + 1) / 2
    a = np.arange(1, m + 1)

    d = rogues.treshape(a, unit=1, row_wise=True)
    e = rogues.treshape(d, unit=3, row_wise=True)
    npt.assert_array_equal(a, e)
    npt.assert_equal(nl.det(d), 1.0)