00001
00002
00003 #ifndef _included_IndexGridData3_h
00004 #define _included_IndexGridData3_h
00005
00012 #include "generic.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef for_3
00027 #define for_3(i, j, k, r, s) { \
00028 const int name2(k,_L) = (((r).lower(2)+((r).lower(2)<0?-s(2)+1:s(2)-1))/s(2))*s(2); \
00029 const int name2(k,_U) = (r).upper(2); \
00030 const int name2(j,_L) = (((r).lower(1)+((r).lower(1)<0?-s(1)+1:s(1)-1))/s(1))*s(1); \
00031 const int name2(j,_U) = (r).upper(1); \
00032 const int name2(i,_L) = (((r).lower(0)+((r).lower(0)<0?-s(0)+1:s(0)-1))/s(0))*s(0); \
00033 const int name2(i,_U) = (r).upper(0); \
00034 const int name2(sk,_S) = (s(2)); \
00035 const int name2(sj,_S) = (s(1)); \
00036 const int name2(si,_S) = (s(0)); \
00037 for (register int k = name2(k,_L); k <= name2(k,_U); k+=name2(sk,_S)) \
00038 for (register int j = name2(j,_L); j <= name2(j,_U); j+=name2(sj,_S)) \
00039 for (register int i = name2(i,_L); i <= name2(i,_U); i+=name2(si,_S)) {
00040 #endif
00041
00042 #ifndef end_for
00043 #define end_for } }
00044 #endif
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #ifndef BeginFastIndex3
00069 #define BeginFastIndex3(a, b, d, type) { \
00070 const int name2(a,_B) = b.bottom(); \
00071 type *const name2(a,_D) = d; \
00072 const int name2(a,_e0) = b.extents(0); \
00073 const int name2(a,_e1) = b.extents(1); \
00074 const int name2(a,_s0) = b.stepsize(0); \
00075 const int name2(a,_s1) = b.stepsize(1); \
00076 const int name2(a,_s2) = b.stepsize(2)
00077 #define FastIndex3(a, i, j, k) \
00078 name2(a,_D)[name2(a,_B)+((i)/name2(a,_s0))+name2(a,_e0)*(((j)/name2(a,_s1))+name2(a,_e1)*((k)/name2(a,_s2)))]
00079 #define EndFastIndex3(a) }
00080 #endif
00081
00082 #endif