diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-02-19 11:30:58 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-02-19 11:30:58 +0100 |
commit | c16b80746aaa0bb865d55b2d1cefac0f54f7cd3e (patch) | |
tree | 9937e57042b9864cbe9d7c21ed9581f6c23d7b9b /Eigen/src/Core/Fuzzy.h | |
parent | 5b78780deffd4a5728cfc6ae5371f56e038e2ac0 (diff) |
isApprox must honors nested_eval
Diffstat (limited to 'Eigen/src/Core/Fuzzy.h')
-rw-r--r-- | Eigen/src/Core/Fuzzy.h | 5 |
1 files changed, 5 insertions, 0 deletions
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<Derived,2>::type nested(x); + typename internal::nested_eval<OtherDerived,2>::type otherNested(y); +#else typename internal::nested<Derived,2>::type nested(x); typename internal::nested<OtherDerived,2>::type otherNested(y); +#endif return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * (min)(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum()); } }; |