Chris@10: Chris@10:
Chris@10:Chris@10: Next: Guru Complex DFTs, Chris@10: Previous: Interleaved and split arrays, Chris@10: Up: Guru Interface Chris@10:
The guru interface introduces one basic new data structure,
Chris@10: fftw_iodim
, that is used to specify sizes and strides for
Chris@10: multi-dimensional transforms and vectors:
Chris@10:
Chris@10:
typedef struct { Chris@10: int n; Chris@10: int is; Chris@10: int os; Chris@10: } fftw_iodim; Chris@10:Chris@10:
Chris@10: Here, n
is the size of the dimension, and is
and os
Chris@10: are the strides of that dimension for the input and output arrays. (The
Chris@10: stride is the separation of consecutive elements along this dimension.)
Chris@10:
Chris@10:
The meaning of the stride parameter depends on the type of the array
Chris@10: that the stride refers to. If the array is interleaved complex,
Chris@10: strides are expressed in units of complex numbers
Chris@10: (fftw_complex
). If the array is split complex or real, strides
Chris@10: are expressed in units of real numbers (double
). This
Chris@10: convention is consistent with the usual pointer arithmetic in the C
Chris@10: language. An interleaved array is denoted by a pointer p
to
Chris@10: fftw_complex
, so that p+1
points to the next complex
Chris@10: number. Split arrays are denoted by pointers to double
, in
Chris@10: which case pointer arithmetic operates in units of
Chris@10: sizeof(double)
.
Chris@10:
Chris@10:
Chris@10:
The guru planner interfaces all take a (rank
, dims[rank]
)
Chris@10: pair describing the transform size, and a (howmany_rank
,
Chris@10: howmany_dims[howmany_rank]
) pair describing the “vector” size (a
Chris@10: multi-dimensional loop of transforms to perform), where dims
and
Chris@10: howmany_dims
are arrays of fftw_iodim
.
Chris@10:
Chris@10:
For example, the howmany
parameter in the advanced complex-DFT
Chris@10: interface corresponds to howmany_rank
= 1,
Chris@10: howmany_dims[0].n
= howmany
, howmany_dims[0].is
=
Chris@10: idist
, and howmany_dims[0].os
= odist
.
Chris@10: (To compute a single transform, you can just use howmany_rank
= 0.)
Chris@10:
Chris@10:
A row-major multidimensional array with dimensions n[rank]
Chris@10: (see Row-major Format) corresponds to dims[i].n
=
Chris@10: n[i]
and the recurrence dims[i].is
= n[i+1] *
Chris@10: dims[i+1].is
(similarly for os
). The stride of the last
Chris@10: (i=rank-1
) dimension is the overall stride of the array.
Chris@10: e.g. to be equivalent to the advanced complex-DFT interface, you would
Chris@10: have dims[rank-1].is
= istride
and
Chris@10: dims[rank-1].os
= ostride
.
Chris@10:
Chris@10:
Chris@10:
In general, we only guarantee FFTW to return a non-NULL
plan if
Chris@10: the vector and transform dimensions correspond to a set of distinct
Chris@10: indices, and for in-place transforms the input/output strides should
Chris@10: be the same.
Chris@10:
Chris@10:
Chris@10:
Chris@10: