HMSBEAGLE  1.0.0
libhmsbeagle/CPU/Precision.h
00001 /*
00002  * Precision.h
00003  *
00004  *  Created on: Oct 13, 2009
00005  *      Author: msuchard
00006  */
00007 
00008 #include <string.h>
00009 
00010 #ifndef PRECISION_H_
00011 #define PRECISION_H_
00012 
00013 #define DOUBLE_PRECISION (sizeof(REALTYPE) == 8)
00014 
00015 template<typename T, typename F> 
00016 inline void beagleMemCpy( T* to, F* from, unsigned int length )
00017 {
00018         for(unsigned int m=0; m<length; m++)
00019                 to[m]=(T)from[m];
00020 };
00021 
00022 template<typename F> 
00023 inline void beagleMemCpy( F* to, const F* from, unsigned int length )
00024 {
00025         memcpy( to, from, length*sizeof(F) );
00026 }
00027 
00028 /*#define MEMCNV(to, from, length, toType)    { \
00029                                                 int m; \
00030                                                 for(m = 0; m < length; m++) { \
00031                                                     to[m] = (toType) from[m]; \
00032                                                 } \
00033                                             }
00034 */
00035 
00036 #endif /* PRECISION_H_ */