mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-19 08:07:36 +08:00
Fix compilation of isnan(complex)
This commit is contained in:
parent
88e352adac
commit
c11971de37
@ -794,24 +794,6 @@ bool (isfinite)(const T& x)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool (isfinite)(const std::complex<T>& x)
|
|
||||||
{
|
|
||||||
return numext::isfinite(numext::real(x)) && numext::isfinite(numext::imag(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool (isnan)(const std::complex<T>& x)
|
|
||||||
{
|
|
||||||
return numext::isnan(numext::real(x)) || numext::isnan(numext::imag(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool (isinf)(const std::complex<T>& x)
|
|
||||||
{
|
|
||||||
return (numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x))) && (!numext::isnan(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
bool (isnan)(const T& x)
|
bool (isnan)(const T& x)
|
||||||
@ -836,6 +818,24 @@ bool (isinf)(const T& x)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool (isfinite)(const std::complex<T>& x)
|
||||||
|
{
|
||||||
|
return numext::isfinite(numext::real(x)) && numext::isfinite(numext::imag(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool (isnan)(const std::complex<T>& x)
|
||||||
|
{
|
||||||
|
return numext::isnan(numext::real(x)) || numext::isnan(numext::imag(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool (isinf)(const std::complex<T>& x)
|
||||||
|
{
|
||||||
|
return (numext::isinf(numext::real(x)) || numext::isinf(numext::imag(x))) && (!numext::isnan(x));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
|
inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user