JuliaLang/julia — pull request #1856 by stevengj (2012-12-31 05:02:05+00:00)
Title: RFC: rewritten FFTW interface

This patch rewrites the FFTW interface as discussed in issues #1617, #1806, and #1805.

The `fft(x)` function now performs a multidimensional FFT by default (what used to be called `fftn`). To transform along 0 or more dimensions, do `fft(x, region)` where region is an iterable set of integers. (Similarly for `bfft`, `ifft`, `rfft`, etcetera.) The functions `fftn`, `fft2`, and `fft3` are removed.

It also adds a new function `p = plan_fft(x)` which returns a function `p(x)` that computes optimized FFTs of a fixed size. `plan_fft` has optional arguments to specify the region and FFTW planner flags.

It also adds in-place functions `fft!` etcetera.

There are a few other odds and ends that I changed. e.g. `FFTW.import_wisdom` and `FFTW.export_wisdom` now import/export both single and double precision wisdom from/to a single file. The `FFTW.num_threads` function should now work properly even if `fft` has been previously called. `brfft` no longer overwrites its input. The 64-bit API is used everywhere. The `fft.jl` tests are a bit more extensive.

The documentation has not been updated yet; I wanted to get some feedback first.