HMSBEAGLE  1.0.0
Precision.h
1 /*
2  * Precision.h
3  *
4  * Created on: Oct 13, 2009
5  * Author: msuchard
6  */
7 
8 #include <string.h>
9 
10 #ifndef PRECISION_H_
11 #define PRECISION_H_
12 
13 #define DOUBLE_PRECISION (sizeof(REALTYPE) == 8)
14 
15 template<typename T, typename F>
16 inline void beagleMemCpy( T* to, F* from, unsigned int length )
17 {
18  for(unsigned int m=0; m<length; m++)
19  to[m]=(T)from[m];
20 };
21 
22 template<typename F>
23 inline void beagleMemCpy( F* to, const F* from, unsigned int length )
24 {
25  memcpy( to, from, length*sizeof(F) );
26 }
27 
28 /*#define MEMCNV(to, from, length, toType) { \
29  int m; \
30  for(m = 0; m < length; m++) { \
31  to[m] = (toType) from[m]; \
32  } \
33  }
34 */
35 
36 #endif /* PRECISION_H_ */