test_pyramid.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:quadpy 作者: nschloe 项目源码 文件源码
def test_scheme(scheme):
    # Test integration until we get to a polynomial degree `d` that can no
    # longer be integrated exactly. The scheme's degree is `d-1`.
    pyra = numpy.array([
        [-1, -1, -1],
        [+1, -1, -1],
        [+1, +1, -1],
        [-1, +1, -1],
        [0, 0, 1],
        ])
    degree = check_degree(
            lambda poly: quadpy.pyramid.integrate(poly, pyra, scheme),
            lambda k: _integrate_exact(k, pyra),
            3,
            scheme.degree + 1
            )
    assert degree == scheme.degree
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号