Commit eb13da75 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

row-major vs column major order

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libfourier
SVN Revision: 3940
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 3e175647
......@@ -946,10 +946,47 @@ We need more text and examples.
row-major C like memory layout too.
Classes to interface raw memory arrays are presented in Carray.h.
\section sec_array_layout_row_major Row major layout
By definition the first index \f$ i \f$ on a two-dimenional matrix
\f$ A_{ij} \f$ as represented by the array
\c A(i,j) is the row index while the second index \f$ j \f$ is the
column index.
If elements of the two-dimensional matrix or array are arranged in linear
computer memory, there are two options:
\section sec_array_layout_column_major 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
\section sec_array_layout_row_major 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.
*/
// ----- END OF README -----
......@@ -157,6 +157,7 @@ namespace aff {
* This constructor together with the aff::Strided::shrink() function is
* used by aff::Shaper in aff::Shaper::operator Tshape () to create a
* strided shape.
* \sa \ref page_array_layout
*/
explicit Strided(const TIndexVec& first, const TIndexVec& last,
const Tsubscript& shift=0);
......@@ -166,6 +167,8 @@ namespace aff {
* \param s1 size of second dimension
* \param s2 size of third dimension
* \param s3 size of fourth dimension
*
* \sa \ref page_array_layout
*/
explicit Strided(const Tsize& s0, const Tsize& s1=1,
const Tsize& s2=1, const Tsize& s3=1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment