mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Enable std::isfinite/nan/inf on MSVC 2013 and newer and clang. Fix isinf for gcc4.4 and older msvc with fast-math.
This commit is contained in:
@@ -18,6 +18,14 @@ void check(bool b, bool ref)
|
||||
std::cout << " BAD ";
|
||||
}
|
||||
|
||||
#if EIGEN_COMP_MSVC < 1800
|
||||
namespace std {
|
||||
template<typename T> bool (isfinite)(T x) { return _finite(x); }
|
||||
template<typename T> bool (isnan)(T x) { return _isnan(x); }
|
||||
template<typename T> bool (isinf)(T x) { return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; }
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
void check_inf_nan(bool dryrun) {
|
||||
Matrix<T,Dynamic,1> m(10);
|
||||
|
||||
Reference in New Issue
Block a user