diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-30 11:58:17 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-30 11:58:17 -0400 |
commit | cf4f90cceacecee87be359b94595662359d027fb (patch) | |
tree | 15766e5ac38066c1dd21260f0c3004dc08c458ed /Eigen/src/Core | |
parent | 38facbd55b815b62686cf622619f165d2b76f65f (diff) |
fix #116 and remove debug cout's
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/IO.h | 18 | ||||
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 3 |
2 files changed, 16 insertions, 5 deletions
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index 853506288..3da92d21a 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -126,8 +126,8 @@ DenseBase<Derived>::format(const IOFormat& fmt) const return WithFormat<Derived>(derived(), fmt); } -template<typename Scalar> -struct ei_significant_decimals_impl +template<typename Scalar, bool IsInteger> +struct ei_significant_decimals_default_impl { typedef typename NumTraits<Scalar>::Real RealScalar; static inline int run() @@ -136,6 +136,20 @@ struct ei_significant_decimals_impl } }; +template<typename Scalar> +struct ei_significant_decimals_default_impl<Scalar, true> +{ + static inline int run() + { + return 0; + } +}; + +template<typename Scalar> +struct ei_significant_decimals_impl + : ei_significant_decimals_default_impl<Scalar, NumTraits<Scalar>::IsInteger> +{}; + /** \internal * print the matrix \a _m to the output stream \a s using the output format \a fmt */ template<typename Derived> diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index ad1432f25..74dda7139 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -780,7 +780,6 @@ struct ei_scalar_fuzzy_default_impl<Scalar, false, false> } static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) { - std::cout << " float" << std::endl; return ei_abs(x - y) <= std::min(ei_abs(x), ei_abs(y)) * prec; } static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec) @@ -800,7 +799,6 @@ struct ei_scalar_fuzzy_default_impl<Scalar, false, true> } static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&) { - std::cout << " integer" << std::endl; return x == y; } static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&) @@ -820,7 +818,6 @@ struct ei_scalar_fuzzy_default_impl<Scalar, true, false> } static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) { - std::cout << " cplx" << std::endl; return ei_abs2(x - y) <= std::min(ei_abs2(x), ei_abs2(y)) * prec * prec; } }; |