aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-07-20 18:21:30 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-07-20 18:21:30 +0200
commit72950effdffd58fde8fdf25a4d548b58ed87aa5c (patch)
tree24661506deebb32e54fd7a4edd450cd21f8888c2 /test/main.h
parent7b4abc2b1dd7d996102a746de4fb3ff58a81d46b (diff)
enable testing of Boost.Multiprecision with expression templates
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/main.h b/test/main.h
index b435298cc..74ff96a23 100644
--- a/test/main.h
+++ b/test/main.h
@@ -452,20 +452,20 @@ T test_relative_error(const AngleAxis<T> &a, const AngleAxis<T> &b)
}
template<typename Type1, typename Type2>
-inline bool test_isApprox(const Type1& a, const Type2& b)
+inline bool test_isApprox(const Type1& a, const Type2& b, typename Type1::Scalar* = 0) // Enabled for Eigen's type only
{
return a.isApprox(b, test_precision<typename Type1::Scalar>());
}
// get_test_precision is a small wrapper to test_precision allowing to return the scalar precision for either scalars or expressions
template<typename T>
-typename NumTraits<typename T::Scalar>::Real get_test_precision(const T*, const typename T::Scalar* = 0)
+typename NumTraits<typename T::Scalar>::Real get_test_precision(const T&, const typename T::Scalar* = 0)
{
return test_precision<typename NumTraits<typename T::Scalar>::Real>();
}
template<typename T>
-typename NumTraits<T>::Real get_test_precision(const T*,typename internal::enable_if<internal::is_arithmetic<typename NumTraits<T>::Real>::value, T>::type* = 0)
+typename NumTraits<T>::Real get_test_precision(const T&,typename internal::enable_if<internal::is_arithmetic<typename NumTraits<T>::Real>::value, T>::type* = 0)
{
return test_precision<typename NumTraits<T>::Real>();
}
@@ -477,7 +477,7 @@ inline bool verifyIsApprox(const Type1& a, const Type2& b)
bool ret = test_isApprox(a,b);
if(!ret)
{
- std::cerr << "Difference too large wrt tolerance " << get_test_precision(static_cast<Type1*>(0)) << ", relative error is: " << test_relative_error(a,b) << std::endl;
+ std::cerr << "Difference too large wrt tolerance " << get_test_precision(a) << ", relative error is: " << test_relative_error(a,b) << std::endl;
}
return ret;
}