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