Copyright (C) 2000-2012 |
GNU Info (fftw.info)Row-major FormatRow-major Format ---------------- The multi-dimensional arrays passed to `fftwnd' are expected to be stored as a single contiguous block in "row-major" order (sometimes called "C order"). Basically, this means that as you step through adjacent memory locations, the first dimension's index varies most slowly and the last dimension's index varies most quickly. To be more explicit, let us consider an array of rank d whose dimensions are n1 x n2 x n3 x ... x nd. Now, we specify a location in the array by a sequence of (zero-based) indices, one for each dimension: (i1, i2, ..., id). If the array is stored in row-major order, then this element is located at the position id + nd * (id-1 + nd-1 * (... + n2 * i1)). Note that each element of the array must be of type `fftw_complex'; i.e. a (real, imaginary) pair of (double-precision) numbers. Note also that, in `fftwnd', the expression above is multiplied by the stride to get the actual array index--this is useful in situations where each element of the multi-dimensional array is actually a data structure or another array, and you just want to transform a single field. In most cases, however, you use a stride of 1. automatically generated by info2www version 1.2.2.9 |