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