#include <sys/types.h>
#include <assert.h>
#include <iostream>
Classes | |
class | MDA_IndexRange< MDA_DIM > |
Defines index ranges for multidimensional arrays. More... | |
class | MDA_OrderRowMajor< MDA_DIM > |
Performs computations based for row-major arrays. More... | |
class | MDA_OrderColMajor< MDA_DIM > |
Performs computations based for column-major arrays. More... | |
class | MDA_Access< MDA_TYPE, MDA_DIM, OrderType > |
Non-const multidimensional array access. More... | |
class | MDA_AccessConst< MDA_TYPE, MDA_DIM, OrderType > |
Const data version of the multidimensional array access template class MDA_Access. More... |
The classes are written for performance (or at least to not degrade performance), so they are almost all inlined with no run-time toggle-able error checking. It is possible that this approach leads to long compile times and large binaries if you are using a not-so-smart compiler. In theory though, because these classes are not doing any extraneous computations, it generates codes that are as optimizable as any other code doing similar functions, including Fortran codes.
Five classes are defined in this file:
To give the compiler the maximum amount of information with which to perform optimization, always use locally scoped objects. These classes are very light-weight, so copying them is cheap.