d@0: d@0: d@0: Row-major Format - 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: d@0: Next: , d@0: Previous: Multi-dimensional Array Format, d@0: Up: Multi-dimensional Array Format d@0:


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

3.2.1 Row-major Format

d@0: d@0:

d@0: The multi-dimensional arrays passed to fftw_plan_dft etcetera d@0: are expected to be stored as a single contiguous block in d@0: row-major order (sometimes called “C order”). Basically, this d@0: means that as you step through adjacent memory locations, the first d@0: dimension's index varies most slowly and the last dimension's index d@0: varies most quickly. d@0: d@0:

To be more explicit, let us consider an array of rank d whose d@0: dimensions are n0 × n1 × n2 × … × nd-1. Now, we specify a location in the array by a d@0: sequence of d (zero-based) indices, one for each dimension: d@0: (i0, i1, i2,..., id-1). If the array is stored in row-major d@0: order, then this element is located at the position d@0: id-1 + nd-1 * (id-2 + nd-2 * (... + n1 * i0)). d@0: d@0:

Note that, for the ordinary complex DFT, each element of the array d@0: must be of type fftw_complex; i.e. a (real, imaginary) pair of d@0: (double-precision) numbers. d@0: d@0:

In the advanced FFTW interface, the physical dimensions n from d@0: which the indices are computed can be different from (larger than) d@0: the logical dimensions of the transform to be computed, in order to d@0: transform a subset of a larger array. d@0: Note also that, in the advanced interface, the expression above is d@0: multiplied by a stride to get the actual array index—this is d@0: useful in situations where each element of the multi-dimensional array d@0: is actually a data structure (or another array), and you just want to d@0: transform a single field. In the basic interface, however, the stride d@0: is 1. d@0: d@0: d@0: d@0: d@0: