aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core
diff options
context:
space:
mode:
authorGravatar Eugene Brevdo <ebrevdo@gmail.com>2016-03-09 09:04:45 -0800
committerGravatar Eugene Brevdo <ebrevdo@gmail.com>2016-03-09 09:04:45 -0800
commit836e92a051f9f56801c52d603402aaa5e74a7a6f (patch)
tree5a2342184bd9ee7d5a6aaa26307366c4583a2054 /Eigen/src/Core
parent5e7de771e364937cbd53692aa3145abf2b31b5ef (diff)
Update MathFunctions/SpecialFunctions with intelligent header guards.
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r--Eigen/src/Core/MathFunctions.h14
-rw-r--r--Eigen/src/Core/SpecialFunctions.h2
2 files changed, 11 insertions, 5 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
index 0be6de71f..311808187 100644
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -946,12 +946,13 @@ T (floor)(const T& x)
return floor(x);
}
+#ifdef EIGEN_HAS_C99_MATH
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float floor(const float &x) { return ::floorf(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double floor(const double &x) { return ::floor(x); }
-
+#endif
template<typename T>
EIGEN_DEVICE_FUNC
@@ -999,12 +1000,13 @@ T log(const T &x) {
return log(x);
}
+#ifdef EIGEN_HAS_C99_MATH
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float log(const float &x) { return ::logf(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double log(const double &x) { return ::log(x); }
-
+#endif
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
@@ -1013,12 +1015,13 @@ T tan(const T &x) {
return tan(x);
}
+#ifdef EIGEN_HAS_C99_MATH
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float tan(const float &x) { return ::tanf(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double tan(const double &x) { return ::tan(x); }
-
+#endif
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
@@ -1027,12 +1030,13 @@ T abs(const T &x) {
return abs(x);
}
+#ifdef EIGEN_HAS_C99_MATH
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float abs(const float &x) { return ::fabsf(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double abs(const double &x) { return ::fabs(x); }
-
+#endif
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
@@ -1041,11 +1045,13 @@ T exp(const T &x) {
return exp(x);
}
+#ifdef EIGEN_HAS_C99_MATH
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float exp(const float &x) { return ::expf(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double exp(const double &x) { return ::exp(x); }
+#endif
} // end namespace numext
diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h
index c01a88d18..c12e41a7b 100644
--- a/Eigen/src/Core/SpecialFunctions.h
+++ b/Eigen/src/Core/SpecialFunctions.h
@@ -284,7 +284,7 @@ struct digamma_impl {
bool negative;
const Scalar maxnum = NumTraits<Scalar>::infinity();
- const Scalar m_pi = 3.14159265358979323846;
+ const Scalar m_pi = EIGEN_PI;
negative = 0;
nz = 0.0;