From c16b80746aaa0bb865d55b2d1cefac0f54f7cd3e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 19 Feb 2014 11:30:58 +0100 Subject: [PATCH] isApprox must honors nested_eval --- Eigen/src/Core/Fuzzy.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h index f9a88dd3c..9c8d10683 100644 --- a/Eigen/src/Core/Fuzzy.h +++ b/Eigen/src/Core/Fuzzy.h @@ -23,8 +23,13 @@ struct isApprox_selector static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) { EIGEN_USING_STD_MATH(min); +#ifdef EIGEN_TEST_EVALUATORS + typename internal::nested_eval::type nested(x); + typename internal::nested_eval::type otherNested(y); +#else typename internal::nested::type nested(x); typename internal::nested::type otherNested(y); +#endif return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * (min)(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum()); } };