aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Array/VectorwiseOp.h
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-10-29 19:56:58 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-10-29 19:56:58 +0100
commitc70a603e342e486f6c534f9fa3fc2c5d5f3aa7f8 (patch)
treeee54a7e25dff6c17c0a186f12aa80e285e4c8f9b /Eigen/src/Array/VectorwiseOp.h
parente513cc75c4661d490ccb425068740458f3483961 (diff)
added mean() reduction
Diffstat (limited to 'Eigen/src/Array/VectorwiseOp.h')
-rw-r--r--Eigen/src/Array/VectorwiseOp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Array/VectorwiseOp.h b/Eigen/src/Array/VectorwiseOp.h
index 4cb0083fa..6f6c2c8a7 100644
--- a/Eigen/src/Array/VectorwiseOp.h
+++ b/Eigen/src/Array/VectorwiseOp.h
@@ -122,6 +122,7 @@ class PartialReduxExpr : ei_no_assignment_operator,
EIGEN_MEMBER_FUNCTOR(squaredNorm, Size * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(norm, (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(sum, (Size-1)*NumTraits<Scalar>::AddCost);
+EIGEN_MEMBER_FUNCTOR(mean, (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(minCoeff, (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(maxCoeff, (Size-1)*NumTraits<Scalar>::AddCost);
EIGEN_MEMBER_FUNCTOR(all, (Size-1)*NumTraits<Scalar>::AddCost);
@@ -297,6 +298,13 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
const typename ReturnType<ei_member_sum>::Type sum() const
{ return _expression(); }
+ /** \returns a row (or column) vector expression of the mean
+ * of each column (or row) of the referenced expression.
+ *
+ * \sa MatrixBase::mean() */
+ const typename ReturnType<ei_member_mean>::Type mean() const
+ { return _expression(); }
+
/** \returns a row (or column) vector expression representing
* whether \b all coefficients of each respective column (or row) are \c true.
*