def ifft(x): N=len(x) if N in [1<<i for i in range(16)]: return FFT.inverse_fft(x) if N not in _ifft_cache: _ifft_cache[N]=ifftm(N) return dot(_ifft_cache[N],x)
def ifft(x): N = len(x) if N in [1 << i for i in range(16)]: return FFT.inverse_fft(x) if N not in _ifft_cache: _ifft_cache[N] = ifftm(N) return dot(_ifft_cache[N], x)
def fft(x): N=len(x) if N in [1<<i for i in range(16)]: return FFT.fft(x) if N not in _fft_cache: _fft_cache[N]=fftm(N) return dot(_fft_cache[N],x)
def fft(x): N = len(x) if N in [1 << i for i in range(16)]: return FFT.fft(x) if N not in _fft_cache: _fft_cache[N] = fftm(N) return dot(_fft_cache[N], x)