diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-12-04 23:17:14 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-12-04 23:17:14 +0100 |
commit | 8e05f9cfa1538d76a9d3e01e08ba565bd581806a (patch) | |
tree | e3ba56b1c37c00ce1da70277e8ef2a86a48c6173 /Eigen/src/Core/Fuzzy.h | |
parent | 80ebeae48d7b56500d9ebc8abd2789061af145e1 (diff) |
add a DenseBase class for MAtrixBase and ArrayBase and more code factorisation
Diffstat (limited to 'Eigen/src/Core/Fuzzy.h')
-rw-r--r-- | Eigen/src/Core/Fuzzy.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Eigen/src/Core/Fuzzy.h b/Eigen/src/Core/Fuzzy.h index 13fcfcdab..fdc13d00d 100644 --- a/Eigen/src/Core/Fuzzy.h +++ b/Eigen/src/Core/Fuzzy.h @@ -47,8 +47,8 @@ */ template<typename Derived> template<typename OtherDerived> -bool MatrixBase<Derived>::isApprox( - const MatrixBase<OtherDerived>& other, +bool DenseBase<Derived>::isApprox( + const DenseBase<OtherDerived>& other, RealScalar prec ) const { @@ -68,15 +68,15 @@ bool MatrixBase<Derived>::isApprox( * the value of the reference scalar \a other should come from the Hilbert-Schmidt norm * of a reference matrix of same dimensions. * - * \sa isApprox(), isMuchSmallerThan(const MatrixBase<OtherDerived>&, RealScalar) const + * \sa isApprox(), isMuchSmallerThan(const DenseBase<OtherDerived>&, RealScalar) const */ template<typename Derived> -bool MatrixBase<Derived>::isMuchSmallerThan( +bool DenseBase<Derived>::isMuchSmallerThan( const typename NumTraits<Scalar>::Real& other, RealScalar prec ) const { - return cwiseAbs2().sum() <= prec * prec * other * other; + return derived().cwiseAbs2().sum() <= prec * prec * other * other; } /** \returns \c true if the norm of \c *this is much smaller than the norm of \a other, @@ -91,12 +91,12 @@ bool MatrixBase<Derived>::isMuchSmallerThan( */ template<typename Derived> template<typename OtherDerived> -bool MatrixBase<Derived>::isMuchSmallerThan( - const MatrixBase<OtherDerived>& other, +bool DenseBase<Derived>::isMuchSmallerThan( + const DenseBase<OtherDerived>& other, RealScalar prec ) const { - return cwiseAbs2().sum() <= prec * prec * other.cwiseAbs2().sum(); + return derived().cwiseAbs2().sum() <= prec * prec * other.derived().cwiseAbs2().sum(); } #else @@ -122,8 +122,8 @@ struct ei_fuzzy_selector; */ template<typename Derived> template<typename OtherDerived> -bool MatrixBase<Derived>::isApprox( - const MatrixBase<OtherDerived>& other, +bool DenseBase<Derived>::isApprox( + const DenseBase<OtherDerived>& other, RealScalar prec ) const { @@ -138,10 +138,10 @@ bool MatrixBase<Derived>::isApprox( * \f[ \Vert v \Vert \leqslant p\,\vert x\vert. \f] * For matrices, the comparison is done on all columns. * - * \sa isApprox(), isMuchSmallerThan(const MatrixBase<OtherDerived>&, RealScalar) const + * \sa isApprox(), isMuchSmallerThan(const DenseBase<OtherDerived>&, RealScalar) const */ template<typename Derived> -bool MatrixBase<Derived>::isMuchSmallerThan( +bool DenseBase<Derived>::isMuchSmallerThan( const typename NumTraits<Scalar>::Real& other, RealScalar prec ) const @@ -161,8 +161,8 @@ bool MatrixBase<Derived>::isMuchSmallerThan( */ template<typename Derived> template<typename OtherDerived> -bool MatrixBase<Derived>::isMuchSmallerThan( - const MatrixBase<OtherDerived>& other, +bool DenseBase<Derived>::isMuchSmallerThan( + const DenseBase<OtherDerived>& other, RealScalar prec ) const { |