aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/VectorwiseOp.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-07-16 15:19:28 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-07-16 15:19:28 +0200
commitdb9b1541935bf92dfa06a0f00cd81b593ea438a9 (patch)
tree92d8e33f3f939fb83379acc0db245a8fe1a7dc5f /Eigen/src/Core/VectorwiseOp.h
parent461cd819c276a3f20bf60930c68fe5b72168b927 (diff)
Add missing non-const reverse method in VectorwiseOp.
Diffstat (limited to 'Eigen/src/Core/VectorwiseOp.h')
-rw-r--r--Eigen/src/Core/VectorwiseOp.h11
1 files changed, 10 insertions, 1 deletions
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<typename ExpressionType, int Direction> class VectorwiseOp
typedef typename ReturnType<internal::member_any>::Type AnyReturnType;
typedef PartialReduxExpr<ExpressionType, internal::member_count<Index>, Direction> CountReturnType;
typedef typename ReturnType<internal::member_prod>::Type ProdReturnType;
+ typedef Reverse<const ExpressionType, Direction> ConstReverseReturnType;
typedef Reverse<ExpressionType, Direction> ReverseReturnType;
template<int p> struct LpNormReturnType {
@@ -456,7 +457,15 @@ template<typename ExpressionType, int Direction> 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<ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType;