From db9b1541935bf92dfa06a0f00cd81b593ea438a9 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 16 Jul 2016 15:19:28 +0200 Subject: Add missing non-const reverse method in VectorwiseOp. --- Eigen/src/Core/VectorwiseOp.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/VectorwiseOp.h') diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index 00a4a8c39..dd382e990 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -284,6 +284,7 @@ template class VectorwiseOp typedef typename ReturnType::Type AnyReturnType; typedef PartialReduxExpr, Direction> CountReturnType; typedef typename ReturnType::Type ProdReturnType; + typedef Reverse ConstReverseReturnType; typedef Reverse ReverseReturnType; template struct LpNormReturnType { @@ -456,7 +457,15 @@ template class VectorwiseOp * * \sa DenseBase::reverse() */ EIGEN_DEVICE_FUNC - const ReverseReturnType reverse() const + const ConstReverseReturnType reverse() const + { return ConstReverseReturnType( _expression() ); } + + /** \returns a writable matrix expression + * where each column (or row) are reversed. + * + * \sa reverse() const */ + EIGEN_DEVICE_FUNC + ReverseReturnType reverse() { return ReverseReturnType( _expression() ); } typedef Replicate ReplicateReturnType; -- cgit v1.2.3