cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: FFTW 3.3.5: Advanced Complex DFTs cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127:
cannam@127:

cannam@127: Next: , Previous: , Up: Advanced Interface   [Contents][Index]

cannam@127:
cannam@127:
cannam@127: cannam@127:

4.4.1 Advanced Complex DFTs

cannam@127: cannam@127:
cannam@127:
fftw_plan fftw_plan_many_dft(int rank, const int *n, int howmany,
cannam@127:                              fftw_complex *in, const int *inembed,
cannam@127:                              int istride, int idist,
cannam@127:                              fftw_complex *out, const int *onembed,
cannam@127:                              int ostride, int odist,
cannam@127:                              int sign, unsigned flags);
cannam@127: 
cannam@127: cannam@127: cannam@127:

This routine plans multiple multidimensional complex DFTs, and it cannam@127: extends the fftw_plan_dft routine (see Complex DFTs) to cannam@127: compute howmany transforms, each having rank rank and size cannam@127: n. In addition, the transform data need not be contiguous, but cannam@127: it may be laid out in memory with an arbitrary stride. To account for cannam@127: these possibilities, fftw_plan_many_dft adds the new parameters cannam@127: howmany, {i,o}nembed, cannam@127: {i,o}stride, and cannam@127: {i,o}dist. The FFTW basic interface cannam@127: (see Complex DFTs) provides routines specialized for ranks 1, 2, cannam@127: and 3, but the advanced interface handles only the general-rank cannam@127: case. cannam@127:

cannam@127:

howmany is the number of transforms to compute. The resulting cannam@127: plan computes howmany transforms, where the input of the cannam@127: k-th transform is at location in+k*idist (in C pointer cannam@127: arithmetic), and its output is at location out+k*odist. Plans cannam@127: obtained in this way can often be faster than calling FFTW multiple cannam@127: times for the individual transforms. The basic fftw_plan_dft cannam@127: interface corresponds to howmany=1 (in which case the dist cannam@127: parameters are ignored). cannam@127: cannam@127: cannam@127:

cannam@127: cannam@127:

Each of the howmany transforms has rank rank and size cannam@127: n, as in the basic interface. In addition, the advanced cannam@127: interface allows the input and output arrays of each transform to be cannam@127: row-major subarrays of larger rank-rank arrays, described by cannam@127: inembed and onembed parameters, respectively. cannam@127: {i,o}nembed must be arrays of length rank, cannam@127: and n should be elementwise less than or equal to cannam@127: {i,o}nembed. Passing NULL for an cannam@127: nembed parameter is equivalent to passing n (i.e. same cannam@127: physical and logical dimensions, as in the basic interface.) cannam@127:

cannam@127:

The stride parameters indicate that the j-th element of cannam@127: the input or output arrays is located at j*istride or cannam@127: j*ostride, respectively. (For a multi-dimensional array, cannam@127: j is the ordinary row-major index.) When combined with the cannam@127: k-th transform in a howmany loop, from above, this means cannam@127: that the (j,k)-th element is at j*stride+k*dist. cannam@127: (The basic fftw_plan_dft interface corresponds to a stride of 1.) cannam@127: cannam@127:

cannam@127: cannam@127:

For in-place transforms, the input and output stride and cannam@127: dist parameters should be the same; otherwise, the planner may cannam@127: return NULL. cannam@127:

cannam@127:

Arrays n, inembed, and onembed are not used after cannam@127: this function returns. You can safely free or reuse them. cannam@127:

cannam@127:

Examples: cannam@127: One transform of one 5 by 6 array contiguous in memory: cannam@127:

cannam@127:
   int rank = 2;
cannam@127:    int n[] = {5, 6};
cannam@127:    int howmany = 1;
cannam@127:    int idist = odist = 0; /* unused because howmany = 1 */
cannam@127:    int istride = ostride = 1; /* array is contiguous in memory */
cannam@127:    int *inembed = n, *onembed = n;
cannam@127: 
cannam@127: cannam@127:

Transform of three 5 by 6 arrays, each contiguous in memory, cannam@127: stored in memory one after another: cannam@127:

cannam@127:
   int rank = 2;
cannam@127:    int n[] = {5, 6};
cannam@127:    int howmany = 3;
cannam@127:    int idist = odist = n[0]*n[1]; /* = 30, the distance in memory
cannam@127:                                      between the first element
cannam@127:                                      of the first array and the
cannam@127:                                      first element of the second array */
cannam@127:    int istride = ostride = 1; /* array is contiguous in memory */
cannam@127:    int *inembed = n, *onembed = n;
cannam@127: 
cannam@127: cannam@127:

Transform each column of a 2d array with 10 rows and 3 columns: cannam@127:

cannam@127:
   int rank = 1; /* not 2: we are computing 1d transforms */
cannam@127:    int n[] = {10}; /* 1d transforms of length 10 */
cannam@127:    int howmany = 3;
cannam@127:    int idist = odist = 1;
cannam@127:    int istride = ostride = 3; /* distance between two elements in 
cannam@127:                                  the same column */
cannam@127:    int *inembed = n, *onembed = n;
cannam@127: 
cannam@127: cannam@127:
cannam@127:
cannam@127:

cannam@127: Next: , Previous: , Up: Advanced Interface   [Contents][Index]

cannam@127:
cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: