Previous: Guru Real-to-real Transforms, Up: Guru Interface

#### 4.5.6 Guru Execution of Plans

Normally, one executes a plan for the arrays with which the plan was created, by calling `fftw_execute(plan)` as described in Using Plans. However, it is possible to apply a given plan to a different array using the guru functions detailed below, provided that the following conditions are met:

- The array size, strides, etcetera are the same (since those are set by the plan).
- The input and output arrays are the same (in-place) or different (out-of-place) if the plan was originally created to be in-place or out-of-place, respectively.
- For split arrays, the separations between the real and imaginary parts, `ii-ri` and `io-ro`, are the same as they were for the input and output arrays when the plan was created. (This condition is automatically satisfied for interleaved arrays.)
- The alignment of the new input/output arrays is the same as that of the input/output arrays when the plan was created, unless the plan was created with the `FFTW_UNALIGNED` flag. Here, the alignment is a platform-dependent quantity (for example, it is the address modulo 16 if SSE SIMD instructions are used, but the address modulo 4 for non-SIMD single-precision FFTW on the same machine). In general, only arrays allocated with `fftw_malloc` are guaranteed to be equally aligned.

If you are tempted to use this guru interface because you want to transform a known bunch of arrays of the same size, stop here and go use the advanced interface instead (see Advanced Interface)).

The guru execute functions are:

         void fftw_execute_dft(
              const fftw_plan p,
              fftw_complex *in, fftw_complex *out);

         void fftw_execute_split_dft(
              const fftw_plan p,
              double *ri, double *ii, double *ro, double *io);

         void fftw_execute_dft_r2c(
              const fftw_plan p,
              double *in, fftw_complex *out);

         void fftw_execute_split_dft_r2c(
              const fftw_plan p,
              double *in, double *ro, double *io);

         void fftw_execute_dft_c2r(
              const fftw_plan p,
              fftw_complex *in, double *out);

         void fftw_execute_split_dft_c2r(
              const fftw_plan p,
              double *ri, double *ii, double *out);

         void fftw_execute_r2r(
              const fftw_plan p,
              double *in, double *out);

These execute the `plan` to compute the corresponding transform on the input/output arrays specified by the subsequent arguments. The input/output array arguments have the same meanings as the ones passed to the guru planner routines in the preceding sections. The `plan` is not modified, and these routines can be called as many times as desired, or intermixed with calls to the ordinary `fftw_execute`.

The `plan` must have been created for the transform type corresponding to the execute function, e.g. it must be a complex-DFT plan for `fftw_execute_dft`. Any of the planner routines for that transform type, from the basic to the guru interface, could have been used to create the plan, however.