Node:Guru vector and transform sizes, Next:, Previous:Guru Interface, Up:Guru Interface



4.5.1 Guru vector and transform sizes

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

typedef struct {
     int n;
     int is;
     int os;
} fftw_iodim;

Here, n is the size of the dimension, and is and os are the strides (in units of double) of that dimension for the input and output arrays.

The guru planner interfaces all take a (rank, dims[rank]) pair describing the transform size, and a (howmany_rank, howmany_dims[rank]) pair describing the "vector" size (a multi-dimensional loop of transforms to perform), where dims and howmany_dims are arrays of fftw_iodim.

For example, the howmany parameter in the advanced complex-DFT interface corresponds to howmany_rank = 1, howmany_dims[0].n = howmany, howmany_dims[0].is = 2*idist, and howmany_dims[0].os = 2*odist. Here, the factors of 2 in the strides are because the advanced complex-DFT interface measures all strides in units of fftw_complex, whereas here we use units of double.

A row-major multidimensional array with dimensions n[rank] (see Row-major Format) corresponds to dims[i].n = n[i] and the recurrence dims[i].is = n[i+1] * dims[i+1].is (similarly for os). The stride of the last (i=rank-1) dimension is the overall stride of the array. e.g. to be equivalent to the advanced complex-DFT interface, you would have dims[rank-1].is = 2*istride and dims[rank-1].os = 2*ostride.

In general, we only guarantee FFTW to return a non-NULL plan if the vector and transform dimensions correspond to a set of distinct indices, and for in-place transforms the input/output strides should be the same.