Chris@42: Chris@42: Chris@42: Chris@42: Chris@42:
Chris@42:Chris@42: Next: Advanced Real-data DFTs, Previous: Advanced Interface, Up: Advanced Interface [Contents][Index]
Chris@42:fftw_plan fftw_plan_many_dft(int rank, const int *n, int howmany, Chris@42: fftw_complex *in, const int *inembed, Chris@42: int istride, int idist, Chris@42: fftw_complex *out, const int *onembed, Chris@42: int ostride, int odist, Chris@42: int sign, unsigned flags); Chris@42:
This routine plans multiple multidimensional complex DFTs, and it
Chris@42: extends the fftw_plan_dft routine (see Complex DFTs) to
Chris@42: compute howmany transforms, each having rank rank and size
Chris@42: n.  In addition, the transform data need not be contiguous, but
Chris@42: it may be laid out in memory with an arbitrary stride.  To account for
Chris@42: these possibilities, fftw_plan_many_dft adds the new parameters
Chris@42: howmany, {i,o}nembed,
Chris@42: {i,o}stride, and
Chris@42: {i,o}dist.  The FFTW basic interface
Chris@42: (see Complex DFTs) provides routines specialized for ranks 1, 2,
Chris@42: and 3, but the advanced interface handles only the general-rank
Chris@42: case.
Chris@42: 
howmany is the number of transforms to compute.  The resulting
Chris@42: plan computes howmany transforms, where the input of the
Chris@42: k-th transform is at location in+k*idist (in C pointer
Chris@42: arithmetic), and its output is at location out+k*odist.  Plans
Chris@42: obtained in this way can often be faster than calling FFTW multiple
Chris@42: times for the individual transforms.  The basic fftw_plan_dft
Chris@42: interface corresponds to howmany=1 (in which case the dist
Chris@42: parameters are ignored).
Chris@42: 
Chris@42: 
Chris@42: 
Each of the howmany transforms has rank rank and size
Chris@42: n, as in the basic interface.  In addition, the advanced
Chris@42: interface allows the input and output arrays of each transform to be
Chris@42: row-major subarrays of larger rank-rank arrays, described by
Chris@42: inembed and onembed parameters, respectively.
Chris@42: {i,o}nembed must be arrays of length rank,
Chris@42: and n should be elementwise less than or equal to
Chris@42: {i,o}nembed.  Passing NULL for an
Chris@42: nembed parameter is equivalent to passing n (i.e. same
Chris@42: physical and logical dimensions, as in the basic interface.)
Chris@42: 
The stride parameters indicate that the j-th element of
Chris@42: the input or output arrays is located at j*istride or
Chris@42: j*ostride, respectively.  (For a multi-dimensional array,
Chris@42: j is the ordinary row-major index.)  When combined with the
Chris@42: k-th transform in a howmany loop, from above, this means
Chris@42: that the (j,k)-th element is at j*stride+k*dist.
Chris@42: (The basic fftw_plan_dft interface corresponds to a stride of 1.)
Chris@42: 
Chris@42: 
For in-place transforms, the input and output stride and
Chris@42: dist parameters should be the same; otherwise, the planner may
Chris@42: return NULL.
Chris@42: 
Arrays n, inembed, and onembed are not used after
Chris@42: this function returns.  You can safely free or reuse them.
Chris@42: 
Examples: Chris@42: One transform of one 5 by 6 array contiguous in memory: Chris@42:
   int rank = 2;
Chris@42:    int n[] = {5, 6};
Chris@42:    int howmany = 1;
Chris@42:    int idist = odist = 0; /* unused because howmany = 1 */
Chris@42:    int istride = ostride = 1; /* array is contiguous in memory */
Chris@42:    int *inembed = n, *onembed = n;
Chris@42: Transform of three 5 by 6 arrays, each contiguous in memory, Chris@42: stored in memory one after another: Chris@42:
   int rank = 2;
Chris@42:    int n[] = {5, 6};
Chris@42:    int howmany = 3;
Chris@42:    int idist = odist = n[0]*n[1]; /* = 30, the distance in memory
Chris@42:                                      between the first element
Chris@42:                                      of the first array and the
Chris@42:                                      first element of the second array */
Chris@42:    int istride = ostride = 1; /* array is contiguous in memory */
Chris@42:    int *inembed = n, *onembed = n;
Chris@42: Transform each column of a 2d array with 10 rows and 3 columns: Chris@42:
   int rank = 1; /* not 2: we are computing 1d transforms */
Chris@42:    int n[] = {10}; /* 1d transforms of length 10 */
Chris@42:    int howmany = 3;
Chris@42:    int idist = odist = 1;
Chris@42:    int istride = ostride = 3; /* distance between two elements in 
Chris@42:                                  the same column */
Chris@42:    int *inembed = n, *onembed = n;
Chris@42: Chris@42: Next: Advanced Real-data DFTs, Previous: Advanced Interface, Up: Advanced Interface [Contents][Index]
Chris@42: