Chris@10: Chris@10: Chris@10: Row-major Format - FFTW 3.3.3 Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10:
Chris@10: Chris@10: Chris@10:

Chris@10: Next: , Chris@10: Previous: Multi-dimensional Array Format, Chris@10: Up: Multi-dimensional Array Format Chris@10:


Chris@10:
Chris@10: Chris@10:

3.2.1 Row-major Format

Chris@10: Chris@10:

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

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

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

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