diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-02-06 05:25:03 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-02-06 05:25:03 -0800 |
commit | c739102ef9a52fcb194dcc77f785aa55879987e4 (patch) | |
tree | 22d19d1df4cb20baea532fa1ce13208329ff53e3 /test/main.h | |
parent | 2559fa9b0f20ea138cfb019d441ad1757221568d (diff) | |
parent | a8f2c6eec788c5cccc6beb9b5837544ea98a7154 (diff) |
Pulled the latest changes from the trunk
Diffstat (limited to 'test/main.h')
-rw-r--r-- | test/main.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/test/main.h b/test/main.h index 9cb41c828..579cd2131 100644 --- a/test/main.h +++ b/test/main.h @@ -61,7 +61,7 @@ #endif // shuts down ICC's remark #593: variable "XXX" was set but never used -#define TEST_SET_BUT_UNUSED_VARIABLE(X) X = X + 0; +#define TEST_SET_BUT_UNUSED_VARIABLE(X) EIGEN_UNUSED_VARIABLE(X) // the following file is automatically generated by cmake #include "split_test_helper.h" @@ -76,7 +76,7 @@ #endif // bounds integer values for AltiVec -#ifdef __ALTIVEC__ +#if defined(__ALTIVEC__) || defined(__VSX__) #define EIGEN_MAKING_DOCS #endif @@ -94,6 +94,9 @@ namespace Eigen static bool g_has_set_repeat, g_has_set_seed; } +#define TRACK std::cerr << __FILE__ << " " << __LINE__ << std::endl +// #define TRACK while() + #define EI_PP_MAKE_STRING2(S) #S #define EI_PP_MAKE_STRING(S) EI_PP_MAKE_STRING2(S) @@ -312,13 +315,7 @@ inline bool test_isApproxOrLessThan(const long double& a, const long double& b) template<typename Type1, typename Type2> inline bool test_isApprox(const Type1& a, const Type2& b) { -#ifdef EIGEN_TEST_EVALUATORS - typename internal::eval<Type1>::type a_eval(a); - typename internal::eval<Type2>::type b_eval(b); - return a_eval.isApprox(b_eval, test_precision<typename Type1::Scalar>()); -#else return a.isApprox(b, test_precision<typename Type1::Scalar>()); -#endif } // The idea behind this function is to compare the two scalars a and b where @@ -436,6 +433,26 @@ void randomPermutationVector(PermutationVectorType& v, typename PermutationVecto } } +template<typename T> bool isNotNaN(const T& x) +{ + return x==x; +} + +template<typename T> bool isNaN(const T& x) +{ + return x!=x; +} + +template<typename T> bool isInf(const T& x) +{ + return x > NumTraits<T>::highest(); +} + +template<typename T> bool isMinusInf(const T& x) +{ + return x < NumTraits<T>::lowest(); +} + } // end namespace Eigen template<typename T> struct GetDifferentType; |