finished a.EMGLLF.c [to test] ; fix indices in EMGLLF.c [by cols]
[valse.git] / src / sources / utils / io.h
1 #ifndef select_ioutils_H
2 #define select_ioutils_H
3
4 // Fill an array with zeros
5 #define zeroArray(array, size)\
6 {\
7 for (int u=0; u<size; u++)\
8 array[u] = 0;\
9 }
10
11 // Copy an 1D array
12 #define copyArray(array, copy, size)\
13 {\
14 for (int u=0; u<size; u++)\
15 copy[u] = array[u];\
16 }
17
18 // Matrix Index ; TODO? ncol unused
19 #define mi(i,j,nrow,ncol)\
20 j*nrow + i
21
22 // Array Index ; TODO? d3 unused
23 #define ai(i,j,k,d1,d2,d3)\
24 k*d1*d2 + j*d1 + i
25
26 #endif