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