From c11971de3799299e3a0dec9dff188734e6bfe8d3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 20 Jul 2015 12:56:01 +0200 Subject: [PATCH] Fix compilation of isnan(complex) --- Eigen/src/Core/MathFunctions.h | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index fb2e2a5f1..f2d5b4879 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -794,24 +794,6 @@ bool (isfinite)(const T& x) #endif } -template -bool (isfinite)(const std::complex& x) -{ - return numext::isfinite(numext::real(x)) && numext::isfinite(numext::imag(x)); -} - -template -bool (isnan)(const std::complex& x) -{ - return numext::isnan(numext::real(x)) || numext::isnan(numext::imag(x)); -} - -template -bool (isinf)(const std::complex& x) -{ - return (numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x))) && (!numext::isnan(x)); -} - template EIGEN_DEVICE_FUNC bool (isnan)(const T& x) @@ -836,6 +818,24 @@ bool (isinf)(const T& x) #endif } +template +bool (isfinite)(const std::complex& x) +{ + return numext::isfinite(numext::real(x)) && numext::isfinite(numext::imag(x)); +} + +template +bool (isnan)(const std::complex& x) +{ + return numext::isnan(numext::real(x)) || numext::isnan(numext::imag(x)); +} + +template +bool (isinf)(const std::complex& x) +{ + return (numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x))) && (!numext::isnan(x)); +} + template EIGEN_DEVICE_FUNC inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)