diff options
author | 2009-11-18 18:15:19 +0100 | |
---|---|---|
committer | 2009-11-18 18:15:19 +0100 | |
commit | e3d890bc5a89798eff50ff6650292b4fa934f72e (patch) | |
tree | 3c7d40332a019dce2773fc6a096d046eeab9fb7a /Eigen/src/Array/Norms.h | |
parent | 0529ecfe1b43d40e40755a2d856188d3ded2c14e (diff) |
Another big refactoring change:
* add a new Eigen2Support module including Cwise, Flagged, and some other deprecated stuff
* add a few cwiseXxx functions
* adapt a few modules to use cwiseXxx instead of the .cwise() prefix
Diffstat (limited to 'Eigen/src/Array/Norms.h')
-rw-r--r-- | Eigen/src/Array/Norms.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/Array/Norms.h b/Eigen/src/Array/Norms.h index ef3f2f20d..07741cdc9 100644 --- a/Eigen/src/Array/Norms.h +++ b/Eigen/src/Array/Norms.h @@ -31,7 +31,7 @@ struct ei_lpNorm_selector typedef typename NumTraits<typename ei_traits<Derived>::Scalar>::Real RealScalar; inline static RealScalar run(const MatrixBase<Derived>& m) { - return ei_pow(m.cwise().abs().cwise().pow(p).sum(), RealScalar(1)/p); + return ei_pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p); } }; @@ -40,7 +40,7 @@ struct ei_lpNorm_selector<Derived, 1> { inline static typename NumTraits<typename ei_traits<Derived>::Scalar>::Real run(const MatrixBase<Derived>& m) { - return m.cwise().abs().sum(); + return m.cwiseAbs().sum(); } }; @@ -58,12 +58,12 @@ struct ei_lpNorm_selector<Derived, Infinity> { inline static typename NumTraits<typename ei_traits<Derived>::Scalar>::Real run(const MatrixBase<Derived>& m) { - return m.cwise().abs().maxCoeff(); + return m.cwiseAbs().maxCoeff(); } }; /** \array_module - * + * * \returns the \f$ \ell^p \f$ norm of *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values * of the coefficients of *this. If \a p is the special value \a Eigen::Infinity, this function returns the \f$ \ell^p\infty \f$ * norm, that is the maximum of the absolute values of the coefficients of *this. |