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