lether.py 文件源码

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

项目:quadpy 作者: nschloe 项目源码 文件源码
def __init__(self, n):
        self.degree = 2*n - 2

        a, A = numpy.polynomial.legendre.leggauss(n)

        w = numpy.outer((1 + a) * A, A)
        x = numpy.outer(1-a, numpy.ones(n)) / 2
        y = numpy.outer(1+a, 1-a) / 4

        self.weights = w.reshape(-1) / 4
        self.points = numpy.stack([x.reshape(-1), y.reshape(-1)]).T

        self.bary = numpy.array([
            self.points[:, 0],
            self.points[:, 1],
            1 - numpy.sum(self.points, axis=1)
            ]).T
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号