d@0: d@0:
d@0:d@0: d@0: Next: Real-data DFTs, d@0: Previous: Complex DFTs, d@0: Up: Basic Interface d@0:
All of the planner routines in FFTW accept an integer flags
d@0: argument, which is a bitwise OR (`|') of zero or more of the flag
d@0: constants defined below. These flags control the rigor (and time) of
d@0: the planning process, and can also impose (or lift) restrictions on the
d@0: type of transform algorithm that is employed.
d@0:
d@0:
Important: the planner overwrites the input array during
d@0: planning unless a saved plan (see Wisdom) is available for that
d@0: problem, so you should initialize your input data after creating the
d@0: plan. The only exceptions to this are the FFTW_ESTIMATE
and
d@0: FFTW_WISDOM_ONLY
flags, as mentioned below.
d@0:
d@0:
In all cases, if wisdom is available for the given problem that was
d@0: created with equal-or-greater planning rigor, then it is used instead.
d@0: For example, in FFTW_ESTIMATE
mode any available wisdom is
d@0: used, whereas in FFTW_PATIENT
mode only wisdom created in
d@0: patient or exhaustive mode can be used. See Words of Wisdom-Saving Plans.
d@0:
d@0:
FFTW_ESTIMATE
specifies that, instead of actual measurements of
d@0: different algorithms, a simple heuristic is used to pick a (probably
d@0: sub-optimal) plan quickly. With this flag, the input/output arrays are
d@0: not overwritten during planning.
d@0:
d@0: FFTW_MEASURE
tells FFTW to find an optimized plan by actually
d@0: computing several FFTs and measuring their execution time.
d@0: Depending on your machine, this can take some time (often a few
d@0: seconds). FFTW_MEASURE
is the default planning option.
d@0:
d@0: FFTW_PATIENT
is like FFTW_MEASURE
, but considers a wider
d@0: range of algorithms and often produces a “more optimal” plan
d@0: (especially for large transforms), but at the expense of several times
d@0: longer planning time (especially for large transforms).
d@0:
d@0: FFTW_EXHAUSTIVE
is like FFTW_PATIENT
, but considers an
d@0: even wider range of algorithms, including many that we think are
d@0: unlikely to be fast, to produce the most optimal plan but with a
d@0: substantially increased planning time.
d@0:
d@0: FFTW_WISDOM_ONLY
is a special planning mode in which the plan
d@0: is only created if wisdom is available for the given problem, and
d@0: otherwise a NULL
plan is returned. This can be combined with
d@0: other flags, e.g. `FFTW_WISDOM_ONLY | FFTW_PATIENT' creates a
d@0: plan only if wisdom is available that was created in
d@0: FFTW_PATIENT
or FFTW_EXHAUSTIVE
mode. The
d@0: FFTW_WISDOM_ONLY
flag is intended for users who need to detect
d@0: whether wisdom is available; for example, if wisdom is not available
d@0: one may wish to allocate new arrays for planning so that user data is
d@0: not overwritten.
d@0:
d@0: FFTW_DESTROY_INPUT
specifies that an out-of-place transform is
d@0: allowed to overwrite its input array with arbitrary data; this
d@0: can sometimes allow more efficient algorithms to be employed.
d@0:
d@0: FFTW_PRESERVE_INPUT
specifies that an out-of-place transform must
d@0: not change its input array. This is ordinarily the
d@0: default, except for c2r and hc2r (i.e. complex-to-real)
d@0: transforms for which FFTW_DESTROY_INPUT
is the default. In the
d@0: latter cases, passing FFTW_PRESERVE_INPUT
will attempt to use
d@0: algorithms that do not destroy the input, at the expense of worse
d@0: performance; for multi-dimensional c2r transforms, however, no
d@0: input-preserving algorithms are implemented and the planner will return
d@0: NULL
if one is requested.
d@0:
d@0: FFTW_UNALIGNED
specifies that the algorithm may not impose any
d@0: unusual alignment requirements on the input/output arrays (i.e. no
d@0: SIMD may be used). This flag is normally not necessary, since
d@0: the planner automatically detects misaligned arrays. The only use for
d@0: this flag is if you want to use the new-array execute interface to
d@0: execute a given plan on a different array that may not be aligned like
d@0: the original. (Using fftw_malloc
makes this flag unnecessary
d@0: even then.)
d@0:
d@0: extern void fftw_set_timelimit(double seconds); d@0:d@0:
d@0: This function instructs FFTW to spend at most seconds
seconds
d@0: (approximately) in the planner. If seconds ==
d@0: FFTW_NO_TIMELIMIT
(the default value, which is negative), then
d@0: planning time is unbounded. Otherwise, FFTW plans with a
d@0: progressively wider range of algorithms until the the given time limit
d@0: is reached or the given range of algorithms is explored, returning the
d@0: best available plan.
d@0:
d@0: For example, specifying FFTW_PATIENT
first plans in
d@0: FFTW_ESTIMATE
mode, then in FFTW_MEASURE
mode, then
d@0: finally (time permitting) in FFTW_PATIENT
. If
d@0: FFTW_EXHAUSTIVE
is specified instead, the planner will further
d@0: progress to FFTW_EXHAUSTIVE
mode.
d@0:
d@0:
Note that the seconds
argument specifies only a rough limit; in
d@0: practice, the planner may use somewhat more time if the time limit is
d@0: reached when the planner is in the middle of an operation that cannot
d@0: be interrupted. At the very least, the planner will complete planning
d@0: in FFTW_ESTIMATE
mode (which is thus equivalent to a time limit
d@0: of 0).
d@0:
d@0:
d@0:
d@0: