From a2ace4b79ad7a496ca22221ecad48f1c2748f261 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 28 Jun 2012 02:08:59 +0200 Subject: bug #482: pass scalar arguments by const references. This changeset only concerns the Core and Geometry modules --- Eigen/src/Core/Fuzzy.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Eigen/src/Core/Fuzzy.h') diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h index 887641163..e0f93bf3d 100644 --- a/Eigen/src/Core/Fuzzy.h +++ b/Eigen/src/Core/Fuzzy.h @@ -34,7 +34,7 @@ namespace internal template::IsInteger> struct isApprox_selector { - static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar prec) + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) { using std::min; typename internal::nested::type nested(x); @@ -46,7 +46,7 @@ struct isApprox_selector template struct isApprox_selector { - static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar) + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar&) { return x.matrix() == y.matrix(); } @@ -55,7 +55,7 @@ struct isApprox_selector template::IsInteger> struct isMuchSmallerThan_object_selector { - static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar prec) + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) { return x.cwiseAbs2().sum() <= abs2(prec) * y.cwiseAbs2().sum(); } @@ -64,7 +64,7 @@ struct isMuchSmallerThan_object_selector template struct isMuchSmallerThan_object_selector { - static bool run(const Derived& x, const OtherDerived&, typename Derived::RealScalar) + static bool run(const Derived& x, const OtherDerived&, const typename Derived::RealScalar&) { return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); } @@ -73,7 +73,7 @@ struct isMuchSmallerThan_object_selector template::IsInteger> struct isMuchSmallerThan_scalar_selector { - static bool run(const Derived& x, const typename Derived::RealScalar& y, typename Derived::RealScalar prec) + static bool run(const Derived& x, const typename Derived::RealScalar& y, const typename Derived::RealScalar& prec) { return x.cwiseAbs2().sum() <= abs2(prec * y); } @@ -82,7 +82,7 @@ struct isMuchSmallerThan_scalar_selector template struct isMuchSmallerThan_scalar_selector { - static bool run(const Derived& x, const typename Derived::RealScalar&, typename Derived::RealScalar) + static bool run(const Derived& x, const typename Derived::RealScalar&, const typename Derived::RealScalar&) { return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); } @@ -112,7 +112,7 @@ template template bool DenseBase::isApprox( const DenseBase& other, - RealScalar prec + const RealScalar& prec ) const { return internal::isApprox_selector::run(derived(), other.derived(), prec); @@ -134,7 +134,7 @@ bool DenseBase::isApprox( template bool DenseBase::isMuchSmallerThan( const typename NumTraits::Real& other, - RealScalar prec + const RealScalar& prec ) const { return internal::isMuchSmallerThan_scalar_selector::run(derived(), other, prec); @@ -154,7 +154,7 @@ template template bool DenseBase::isMuchSmallerThan( const DenseBase& other, - RealScalar prec + const RealScalar& prec ) const { return internal::isMuchSmallerThan_object_selector::run(derived(), other.derived(), prec); -- cgit v1.2.3