pyfftw_fft.py 文件源码

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

项目:mpiFFT4py 作者: spectralDNS 项目源码 文件源码
def dct(a, b, type=2, axis=0, overwrite_input=False, threads=1, planner_effort="FFTW_EXHAUSTIVE"):
        global dct_object
        key = (a.shape, a.dtype, overwrite_input, axis, type)
        if not key in dct_object:
            if iscomplexobj(a):
                ac = a.real.copy()
            else:
                ac = a
            dct_object[key] = pyfftw.builders.dct(ac, axis=axis, type=type, 
                                                  overwrite_input=overwrite_input, 
                                                  threads=threads,
                                                  planner_effort=planner_effort)

        dobj = dct_object[key]
        c = dobj.get_output_array()
        if iscomplexobj(a):
            dobj(a.real, c)
            b.real[:] = c
            dobj(a.imag, c)
            b.imag[:] = c

        else:
            dobj(a)
            b[:] = c
        return b
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号