Add isfinite overload for complexes.

This commit is contained in:
Gael Guennebaud 2014-04-14 21:57:49 +02:00
parent d567e3b893
commit 7098e6d976

View File

@ -669,6 +669,15 @@ bool (isfinite)(const T& x)
return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest();
}
template<typename T>
EIGEN_DEVICE_FUNC
bool (isfinite)(const std::complex<T>& x)
{
using std::real;
using std::imag;
return isfinite(real(x)) && isfinite(imag(x));
}
} // end namespace numext
namespace internal {