algorithms.py 文件源码

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

项目:chebpy 作者: chebpy 项目源码 文件源码
def coeffmult(fc, gc):
    """Coefficient-Space multiplication of equal-length first-kind
    Chebyshev series."""
    Fc = np.append( 2.*fc[:1], (fc[1:], fc[:0:-1]) )
    Gc = np.append( 2.*gc[:1], (gc[1:], gc[:0:-1]) )
    ak = ifft( fft(Fc) * fft(Gc) )
    ak = np.append( ak[:1], ak[1:] + ak[:0:-1] ) * .25
    ak = ak[:fc.size]
    inputcfs = np.append(fc, gc)
    out = np.real(ak) if np.isreal(inputcfs).all() else ak
    return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号