source/patchdata/array/array_access/MDA_Access.h File Reference

Provides classes supporting Fortran-style multidimensional array accessing in C++. More...

#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...


Detailed Description

Provides classes supporting Fortran-style multidimensional array accessing in C++.

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:

  1. MDA_IndexRange: a class to define and manipulate index range objects.
  2. MDA_OrderRowMajor: class with functions to compute order-dependent info from the index range. This version is for row-major order.
  3. MDA_OrderColMajor: the column-major counterpart of MDA_OrderRowMajor.
  4. MDA_Access: class to allow access to individually indexed elements of a multidimensional array.
  5. MDA_AccessConst: the const counterpart of MDA_Access, to allow read-only access to data.

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.


Generated on Thu Jun 18 11:25:29 2009 for SAMRAI by  doxygen 1.5.1