From 7098e6d976ee8d5b25776e749d3ef6e66a302829 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 14 Apr 2014 21:57:49 +0200 Subject: [PATCH] Add isfinite overload for complexes. --- Eigen/src/Core/MathFunctions.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 63fb92b75..20fc2be74 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -669,6 +669,15 @@ bool (isfinite)(const T& x) return x::highest() && x>NumTraits::lowest(); } +template +EIGEN_DEVICE_FUNC +bool (isfinite)(const std::complex& x) +{ + using std::real; + using std::imag; + return isfinite(real(x)) && isfinite(imag(x)); +} + } // end namespace numext namespace internal {