21 #ifndef GRT_TYPEDEFS_HEADER
22 #define GRT_TYPEDEFS_HEADER
24 #include "GRTVersionInfo.h"
31 #define PI 3.14159265358979323846264338327950288
35 #define TWO_PI 6.28318530718
39 #define SQRT_TWO_PI 2.506628274631
42 template<
class T>
inline T SQR(
const T &a) {
return a*a;}
43 template<
class T>
inline void SWAP(T &a,T &b) { T temp(a); a = b; b = temp; }
45 inline double SIGN(
const double &a,
const double &b) {
return (b >= 0 ? (a >= 0 ? a : -a) : (a >= 0 ? -a : a));}
47 inline double antilog(
const double &x){
return exp( x ); }
50 #define MIN(a,b) (((a)<(b))?(a):(b))
53 #define MAX(a,b) (((a)>(b))?(a):(b))
56 #define GRT_DEFAULT_NULL_CLASS_LABEL 0
57 #define GRT_SAFE_CHECKING true
60 #ifdef __GRT_WINDOWS_BUILD__
61 #define grt_isnan(x) (x != x)
62 #define grt_isinf(x) (!grt_isnan(x) && grt_isnan(x - x))
66 static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
67 #define NAN (*(const float *) __nan)
71 #define INFINITY (DBL_MAX+DBL_MAX)
81 #ifdef __GRT_OSX_BUILD__
82 #define grt_isnan(x) (x != x)
83 #define grt_isinf(x) (!grt_isnan(x) && grt_isnan(x - x))
85 typedef unsigned int UINT;
86 typedef signed int SINT;
87 typedef unsigned long ULONG;
90 #ifdef __GRT_LINUX_BUILD__
91 #define grt_isnan(x) (x != x)
92 #define grt_isinf(x) (!grt_isnan(x) && grt_isnan(x - x))
94 typedef unsigned int UINT;
95 typedef signed int SINT;
96 typedef unsigned long ULONG;
100 typedef std::vector<double> VectorDouble;
103 class ClassificationData;
104 class RegressionData;
105 class TimeSeriesClassificationData;
106 class UnlabelledData;
107 typedef ClassificationData LabelledClassificationData;
108 typedef RegressionData LabelledRegressionData;
109 typedef TimeSeriesClassificationData LabelledTimeSeriesClassificationData;
110 typedef UnlabelledData UnlabelledClassificationData;
113 #endif //GRT_TYPEDEFS_HEADER