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