amroc/hds/IndexGridData3.h File Reference

Provide macros for array looping and indexing for GridData. More...

#include "generic.h"

Go to the source code of this file.

Defines

#define for_3(i, j, k, r, s)
#define BeginFastIndex3(a, b, d, type)
#define FastIndex3(a, i, j, k)   name2(a,_D)[name2(a,_B)+((i)/name2(a,_s0))+name2(a,_e0)*(((j)/name2(a,_s1))+name2(a,_e1)*((k)/name2(a,_s2)))]
#define EndFastIndex3(a)   }

Detailed Description

Provide macros for array looping and indexing for GridData.

Adaptation from LPARX developed by Scott Kohn (skohn-at-cs.ucsd.edu)

Author:
Manish Parashar, Ralf Deiterding (minor changes)

Define Documentation

#define BeginFastIndex3 ( a,
b,
d,
type   ) 
Value:
{                               \
const int   name2(a,_B)  = b.bottom();                                  \
type *const name2(a,_D)  = d;                                           \
const int   name2(a,_e0) = b.extents(0);                                \
const int   name2(a,_e1) = b.extents(1);                                \
const int   name2(a,_s0) = b.stepsize(0);                               \
const int   name2(a,_s1) = b.stepsize(1);                               \
const int   name2(a,_s2) = b.stepsize(2)

Referenced by GridData< Type, 3 >::lin_interp(), GridData< Type, 3 >::maxabs(), GridData< Type, 3 >::maxval(), GridData< Type, 3 >::minval(), GridData< Type, 3 >::moment1(), GridData< Type, 3 >::PackRegion(), GridData< Type, 3 >::product(), GridData< Type, 3 >::sum(), GridData< Type, 3 >::sumabs(), GridData< Type, 3 >::sumsqrd(), and GridData< Type, 3 >::UnPackRegion().

#define for_3 ( i,
j,
k,
r,
 ) 
Value:
{                                               \
   const int name2(k,_L) = (((r).lower(2)+((r).lower(2)<0?-s(2)+1:s(2)-1))/s(2))*s(2);    \
   const int name2(k,_U) = (r).upper(2);                                \
   const int name2(j,_L) = (((r).lower(1)+((r).lower(1)<0?-s(1)+1:s(1)-1))/s(1))*s(1);    \
   const int name2(j,_U) = (r).upper(1);                                \
   const int name2(i,_L) = (((r).lower(0)+((r).lower(0)<0?-s(0)+1:s(0)-1))/s(0))*s(0);    \
   const int name2(i,_U) = (r).upper(0);                                \
   const int name2(sk,_S) = (s(2));                                     \
   const int name2(sj,_S) = (s(1));                                     \
   const int name2(si,_S) = (s(0));                                     \
   for (register int k = name2(k,_L); k <= name2(k,_U); k+=name2(sk,_S))                \
   for (register int j = name2(j,_L); j <= name2(j,_U); j+=name2(sj,_S))                \
   for (register int i = name2(i,_L); i <= name2(i,_U); i+=name2(si,_S)) {

Referenced by GridHierarchy::DAGH_CreateGridUnitList(), DAGHCluster(), GridData< Type, 3 >::lin_interp(), GridData< Type, 3 >::maxabs(), GridData< Type, 3 >::maxval(), GridData< Type, 3 >::minval(), GridData< Type, 3 >::moment1(), GridData< Type, 3 >::PackRegion(), GridData< Type, 3 >::product(), GridData< Type, 3 >::sum(), GridData< Type, 3 >::sumabs(), GridData< Type, 3 >::sumsqrd(), and GridData< Type, 3 >::UnPackRegion().

Generated on Thu Jun 30 02:19:00 2016 for AMROC's Hierachical Data Structures by  doxygen 1.6.3