d@0: d@0: d@0: Guru vector and transform sizes - FFTW 3.2.1 d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0:
d@0:

d@0: d@0: Next: , d@0: Previous: Interleaved and split arrays, d@0: Up: Guru Interface d@0:


d@0:
d@0: d@0:

4.5.2 Guru vector and transform sizes

d@0: d@0:

The guru interface introduces one basic new data structure, d@0: fftw_iodim, that is used to specify sizes and strides for d@0: multi-dimensional transforms and vectors: d@0: d@0:

     typedef struct {
d@0:           int n;
d@0:           int is;
d@0:           int os;
d@0:      } fftw_iodim;
d@0: 
d@0:

d@0: Here, n is the size of the dimension, and is and os d@0: are the strides of that dimension for the input and output arrays. (The d@0: stride is the separation of consecutive elements along this dimension.) d@0: d@0:

The meaning of the stride parameter depends on the type of the array d@0: that the stride refers to. If the array is interleaved complex, d@0: strides are expressed in units of complex numbers d@0: (fftw_complex). If the array is split complex or real, strides d@0: are expressed in units of real numbers (double). This d@0: convention is consistent with the usual pointer arithmetic in the C d@0: language. An interleaved array is denoted by a pointer p to d@0: fftw_complex, so that p+1 points to the next complex d@0: number. Split arrays are denoted by pointers to double, in d@0: which case pointer arithmetic operates in units of d@0: sizeof(double). d@0: d@0: The guru planner interfaces all take a (rank, dims[rank]) d@0: pair describing the transform size, and a (howmany_rank, d@0: howmany_dims[howmany_rank]) pair describing the “vector” size (a d@0: multi-dimensional loop of transforms to perform), where dims and d@0: howmany_dims are arrays of fftw_iodim. d@0: d@0:

For example, the howmany parameter in the advanced complex-DFT d@0: interface corresponds to howmany_rank = 1, d@0: howmany_dims[0].n = howmany, howmany_dims[0].is = d@0: idist, and howmany_dims[0].os = odist. d@0: (To compute a single transform, you can just use howmany_rank = 0.) d@0: d@0:

A row-major multidimensional array with dimensions n[rank] d@0: (see Row-major Format) corresponds to dims[i].n = d@0: n[i] and the recurrence dims[i].is = n[i+1] * d@0: dims[i+1].is (similarly for os). The stride of the last d@0: (i=rank-1) dimension is the overall stride of the array. d@0: e.g. to be equivalent to the advanced complex-DFT interface, you would d@0: have dims[rank-1].is = istride and d@0: dims[rank-1].os = ostride. d@0: d@0: In general, we only guarantee FFTW to return a non-NULL plan if d@0: the vector and transform dimensions correspond to a set of distinct d@0: indices, and for in-place transforms the input/output strides should d@0: be the same. d@0: d@0: d@0: d@0: