1//we introduce the next macro to avoid confusing the compiler, which
2//sometimes thinks the variable class is a reserved word
3#define class _class_
4#define a(m,n,j,k)       a[m-1+5*(n-1+5*(j-1+isiz1*(k-1)))]
5#define b(m,n,j,k)       b[m-1+5*(n-1+5*(j-1+isiz1*(k-1)))]
6#define c(m,n,j,k)       c[m-1+5*(n-1+5*(j-1+isiz1*(k-1)))]
7#define d(m,n,j,k)       d[m-1+5*(n-1+5*(j-1+isiz1*(k-1)))]
8#define flux(m,i,j,k) flux[m-1+5*((i+0)+(isiz1+2)*((j+0)+(isiz2+2)*(k-1)))]
9#define frct(m,i,j,k) frct[m-1+5*((i+1)+(isiz1+4)*((j+1)+(isiz2+4)*(k-1)))]
10#define rsd(m,i,j,k)   rsd[m-1+5*((i+1)+(isiz1+4)*((j+1)+(isiz2+4)*(k-1)))]
11#define u(m,i,j,k)       u[m-1+5*((i+1)+(isiz1+4)*((j+1)+(isiz2+4)*(k-1)))]
12
13#define tv(m,i,j)     tv[m-1+5*((i-1)+isiz1*(j-1))]
14
15#define phi1(i,k)     phi1[i+(isiz2+2)*(k)]
16#define phi2(i,k)     phi2[i+(isiz2+2)*(k)]
17#define ce(m,n)       ce[m-1+5*(n-1)]
18#define tmat(m,n)     tmat[m-1+5*(n-1)]
19
20#define rsdnm(m)      rsdnm[m-1]
21#define tolrsd(m)     tolrsd[m-1]
22#define errnm(m)      errnm[m-1]
23
24/* PAD32byte is used to compute a cacheline padded length of n (input) bytes */
25#define  PAD32byte(n) ((n)%32==0 ? (n) : (n) + 32 - (n)%32)
26/* PAD32dbl is used to compute a cacheline padded length of n (input) doubles */
27#define  PAD32dbl(n)  ((n)%(32/sizeof(double))==0 ? (n) : (n) + (32/sizeof(double)) \
28                      - (n)%(32/sizeof(double)))
29
30#define max(x,y)      ((x)>(y)? (x) : (y))
31#define min(x,y)      ((x)<(y)? (x) : (y))
32