diff options
author | 2015-04-20 14:59:57 -0400 | |
---|---|---|
committer | 2015-04-20 14:59:57 -0400 | |
commit | e5048b5501a4c2cd86fa3f92ad214938eb3f9b3f (patch) | |
tree | 3e1006fdf481f4b1606d158038a01ed1d13d0053 | |
parent | 249c48ba001f83978f84bf1befdf4867550ff6ea (diff) |
Use std::isfinite when available
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index a1ea059b7..1ce935909 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -787,13 +787,16 @@ inline EIGEN_MATHFUNC_RETVAL(pow, Scalar) pow(const Scalar& x, const Scalar& y) return EIGEN_MATHFUNC_IMPL(pow, Scalar)::run(x, y); } -// std::isfinite is non standard, so let's define our own version, -// even though it is not very efficient. template<typename T> EIGEN_DEVICE_FUNC bool (isfinite)(const T& x) { - return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest(); + #ifdef EIGEN_HAS_C99_MATH + using std::isfinite; + return isfinite(x); + #else + return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest(); + #endif } template<typename T> |