00001 #ifndef __UTILITIES_H__ 00002 #define __UTILITIES_H__ 00003 00004 #include <cmath> 00005 00006 #ifndef DUMP 00007 #define DUMP(a) cout << #a<<"="<< (a) << endl 00008 #endif 00009 00010 #define ODD(x) ((x)&1) 00011 #define EVEN(x) !ODD(x) 00012 00013 #define EPSIL 0.0000001 00014 #define EQUALS(x, y) fabs(x-y) < EPSIL 00015 00017 template <typename T1, typename T2> 00018 struct Convert 00019 { 00020 T2 operator()(const T1& v) const { return T2(v); } 00021 }; 00022 00024 int myRound (const double& input); 00025 00027 int myCeil (const double& d); 00028 00029 #endif