diff --git a/Eigen/src/Array/Reverse.h b/Eigen/src/Array/Reverse.h index 16740b4bd..f744bc194 100644 --- a/Eigen/src/Array/Reverse.h +++ b/Eigen/src/Array/Reverse.h @@ -92,8 +92,7 @@ template class Reverse ((Direction == Horizontal) || (Direction == BothDirections)) ? m_matrix.cols() - col - 1 : col); } - /* could be removed */ - /* + /* TODO have to be updated for vector expression only */ inline const Scalar coeff(int index) const { switch ( Direction ) @@ -113,6 +112,7 @@ template class Reverse } + /* TODO have to be updated for vector expression only */ inline Scalar& coeffRef(int index) { switch ( Direction ) @@ -130,9 +130,8 @@ template class Reverse break; } } - */ - /* the following is not ready yet */ + // the following is not ready yet /* // TODO: We must reverse the packet reading and writing, which is currently not done here, I think template @@ -150,6 +149,7 @@ template class Reverse x); } + // TODO have to be updated for vector expression only template inline const PacketScalar packet(int index) const { @@ -168,10 +168,8 @@ template class Reverse break; } } - */ - /* could be removed */ - /* + // TODO have to be updated for vector expression only template inline void writePacket(int index, const PacketScalar& x) { diff --git a/test/reverse.cpp b/test/reverse.cpp index 03584b812..40868abbc 100644 --- a/test/reverse.cpp +++ b/test/reverse.cpp @@ -185,4 +185,9 @@ void test_reverse() CALL_SUBTEST( reverse(Matrix()) ); CALL_SUBTEST( reverse(Matrix(10,10)) ); } + Vector4f x; x << 1, 2, 3, 4; + Vector4f y; y << 4, 3, 2, 1; + VERIFY(x.reverse()[1] == 3); + VERIFY(x.reverse() == y); + }