Subversion Repositories gelsvn

Rev

Rev 632 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 632 Rev 639
Line 20... Line 20...
20
#include <climits>
20
#include <climits>
21
#include <cassert>
21
#include <cassert>
22
#include <algorithm>
22
#include <algorithm>
23
#include <functional>
23
#include <functional>
24
 
24
 
-
 
25
#ifdef _MSC_VER // if visual studio
-
 
26
#include <float.h>
-
 
27
#endif
-
 
28
 
25
#ifndef M_PI
29
#ifndef M_PI
26
#define M_PI 3.14159265358979323846
30
#define M_PI 3.14159265358979323846
27
#define M_PI_2 1.57079632679489661923
31
#define M_PI_2 1.57079632679489661923
28
#endif
32
#endif
29
 
33
 
Line 75... Line 79...
75
#define SQRT3 sqrt3()
79
#define SQRT3 sqrt3()
76
 
80
 
77
  /// Useful enum that represents coordiante axes.
81
  /// Useful enum that represents coordiante axes.
78
  enum Axis {XAXIS=0,YAXIS=1,ZAXIS=2};
82
  enum Axis {XAXIS=0,YAXIS=1,ZAXIS=2};
79
 
83
 
80
  inline bool isnan(double x) { return x != x; }
84
  inline bool isnan(double x) {
-
 
85
#ifdef _MSC_VER // if visual studio
-
 
86
      return _isnan(x);
-
 
87
#else
-
 
88
      return std::isnan(x);
-
 
89
#endif
-
 
90
  }
81
 
91
 
82
  /// Template for a function that squares the argument.
92
  /// Template for a function that squares the argument.
83
  template <class Scalar>
93
  template <class Scalar>
84
  inline Scalar sqr(Scalar x) {///
94
  inline Scalar sqr(Scalar x) {///
85
    return x*x;}
95
    return x*x;}