grundmann_moeller.py 文件源码

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

项目:quadpy 作者: nschloe 项目源码 文件源码
def __init__(self, n, s):
        self.name = 'GrundmannMöller(dim={}, {})'.format(n, s)
        d = 2*s + 1
        self.degree = d
        self.dim = n

        exponents = get_all_exponents(n+1, s)

        data = [
            (
                fr((-1)**i * 2**(-2*s) * (d+n-2*i)**d, fact(i) * fact(d+n-i)),
                numpy.array([
                    [fr(2*p + 1, d+n-2*i) for p in part]
                    for part in exponents[s-i]
                    ])
            )
            for i in range(s+1)
            ]

        self.bary, self.weights = untangle(data)
        self.weights /= sum(self.weights)
        self.points = self.bary[:, 1:]
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号