pychebfun.py 文件源码

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

项目:fluids 作者: CalebBell 项目源码 文件源码
def polyval(self, chebcoeff):
        """
        Compute the interpolation values at Chebyshev points.
        chebcoeff: Chebyshev coefficients
        """
        N = len(chebcoeff)
        if N == 1:
            return chebcoeff

        data = even_data(chebcoeff)/2
        data[0] *= 2
        data[N-1] *= 2

        fftdata = 2*(N-1)*fftpack.ifft(data, axis=0)
        complex_values = fftdata[:N]
        # convert to real if input was real
        if np.isrealobj(chebcoeff):
            values = np.real(complex_values)
        else:
            values = complex_values
        return values
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号