示例#1
0
def test_cubature_three_exact():
    d = 8
    xmin = -np.ones((d,))
    xmax = np.ones((d,))

    val = ti.cubature_three_exact(xmin, xmax)
    assert np.abs(val) < 1e-14

    xmin = np.zeros((d,))
    xmax = np.ones((d,))

    val = ti.cubature_three_exact(xmin, xmax)
    assert np.abs(val - 1) < 1e-14
示例#2
0
def test_cubature_three_exact():
    d = 8
    xmin = -np.ones((d, ))
    xmax = np.ones((d, ))

    val = ti.cubature_three_exact(xmin, xmax)
    assert np.abs(val) < 1e-14

    xmin = np.zeros((d, ))
    xmax = np.ones((d, ))

    val = ti.cubature_three_exact(xmin, xmax)
    assert np.abs(val - 1) < 1e-14
示例#3
0
def test_hcubature_cubature_three():
    d = 8
    xmin = np.zeros((d,))
    xmax = np.ones((d,))

    exact = ti.cubature_three_exact(xmin, xmax)

    val, err = cubature(ti.cubature_three, d, 1, xmin, xmax)

    assert np.allclose([exact], [val])
示例#4
0
def test_hcubature_cubature_three():
    d = 8
    xmin = np.zeros((d, ))
    xmax = np.ones((d, ))

    exact = ti.cubature_three_exact(xmin, xmax)

    val, err = cubature(ti.cubature_three, d, 1, xmin, xmax)

    assert np.allclose([exact], [val])