mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add an option to test evaluators globally
This commit is contained in:
@@ -126,6 +126,13 @@ endif(TEST_LIB)
|
||||
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Official")
|
||||
add_custom_target(BuildOfficial)
|
||||
|
||||
option(EIGEN_TEST_EVALUATORS "Enable work in progress evaluators" OFF)
|
||||
add_definitions("-DEIGEN_TEST_EVALUATORS=1")
|
||||
add_definitions("-DEIGEN_ENABLE_EVALUATORS=1")
|
||||
if(EIGEN_TEST_EVALUATORS)
|
||||
|
||||
endif(EIGEN_TEST_EVALUATORS)
|
||||
|
||||
ei_add_test(meta)
|
||||
ei_add_test(sizeof)
|
||||
ei_add_test(dynalloc)
|
||||
|
||||
@@ -271,7 +271,13 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user