Esempio n. 1
0
def test_fexact_hybrid():
    k = np.array([[10, 6, 7], [5, 7, 9]], dtype=np.int64)
    res = fexact(k, workspace=10000000, hybrid=True)
    assert np.abs(0.3962 - res) < 10e-3

    res = fexact(k, workspace=10000000, hybrid=False)
    assert np.abs(0.4158 - res) < 10e-3
Esempio n. 2
0
def test_fexact_small():

    k = np.array([[5, 1, 5], [1, 1, 5]], dtype=np.int64)
    res = fexact(k)
    assert np.abs(0.4004524886877815 - res) < 10e-5
Esempio n. 3
0
def test_errors_ws2():
    k = np.array([[10, 6, 7] * 10, [5, 7, 9] * 10], dtype=np.int64)
    with pytest.raises(ValueError):
        res = fexact(k, workspace=2**3, hybrid=False)
        print(res)
Esempio n. 4
0
def test_errors_ws():
    k = np.array([[100000, 6, 7], [100000, 7, 9]], dtype=np.int64)
    with pytest.raises(ValueError):
        res = fexact(k, workspace=10000000, hybrid=False)
        print(res)
Esempio n. 5
0
def test_memleak():
    for i in range(1):
        k = np.array([[10, 6, 7] * 10, [5, 7, 9] * 10], dtype=np.int64)
        res = fexact(k, workspace=10000000, hybrid=False)
        print(res)
        gc.collect()
Esempio n. 6
0
def test_fexact_small_ws_kw():

    k = np.array([[5, 1, 5], [1, 1, 5]], dtype=np.int64)
    res = fexact(k, workspace=10000000)
    assert np.abs(0.4004524886877815 - res) < 10e-5