mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Add isfinite overload for complexes.
This commit is contained in:
parent
d567e3b893
commit
7098e6d976
@ -669,6 +669,15 @@ bool (isfinite)(const T& x)
|
|||||||
return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest();
|
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
|
} // end namespace numext
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user