AFF --- A container for numbers (array) by Friederich and Forbriger.
Array layout

The array class template aff::Array uses the shape class aff::Strided. Usually and in particular when constructed by using aff::Shaper, aff::Strided uses a Fortran like column-major layout in memory. aff::FortranArray and aff::util::FortranShape are provided to interface Fortran code with such kind of arrays. Nevertheless aff::Array together with aff::Strided is able to address a row-major C like memory layout too. Classes to interface raw memory arrays are presented in Carray.h.

By definition the first index $ i $ on a two-dimenional matrix $ A_{ij} $ as represented by the array A(i,j) is the row index while the second index $ j $ is the column index. If elements of the two-dimensional matrix or array are arranged in linear computer memory, there are two options:

Column major layout

When traversing the linear representation in memory byte by byte in increasing address order the elements of the first column in order of increasing row index are passed first. Next the elements of the second column are passed in increasing row order and so forth. When labelling the array elements in linear memory, the first index varies quicker than the second index of the array if the elements are traversed in increasing address order. This is called the "column major order" and is the usualy layout of Fortran arrays.

Column major layout is described in detail at http://en.wikipedia.org/wiki/Row-major_order#Column-major_order

Row major layout

When traversing the linear representation in memory byte by byte in increasing address order the elements of the first row in order of increasing column index are passed first. Next the elements of the second row are passed in increasing column order and so forth. When labelling the array elements in linear memory, the second index varies quicker than the first index of the array if the elements are traversed in increasing address order. This is called the "row major order" and is the usualy layout of C arrays.

Row major layout is described in detail at http://en.wikipedia.org/wiki/Row-major_order#Row-major_order

Todo:
Provide details on indexing raw memory in both layouts here.