12#ifndef EIGEN_REVERSE_H
13#define EIGEN_REVERSE_H
19template<
typename MatrixType,
int Direction>
23 typedef typename MatrixType::Scalar Scalar;
27 typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
29 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
30 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
31 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
32 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
39 static inline PacketType run(
const PacketType& x) {
return preverse(x); }
44 static inline PacketType run(
const PacketType& x) {
return x; }
63template<
typename MatrixType,
int Direction>
class Reverse
69 EIGEN_DENSE_PUBLIC_INTERFACE(
Reverse)
70 typedef typename internal::remove_all<MatrixType>::type NestedExpression;
71 using Base::IsRowMajor;
76 IsColMajor = !IsRowMajor,
79 OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1,
80 OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1,
82 || ((Direction ==
Vertical) && IsColMajor)
88 EIGEN_DEVICE_FUNC
explicit inline Reverse(
const MatrixType& matrix) : m_matrix(matrix) { }
90 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Reverse)
92 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
93 inline Index rows()
const EIGEN_NOEXCEPT {
return m_matrix.rows(); }
94 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
95 inline Index cols()
const EIGEN_NOEXCEPT {
return m_matrix.cols(); }
97 EIGEN_DEVICE_FUNC
inline Index innerStride()
const
99 return -m_matrix.innerStride();
102 EIGEN_DEVICE_FUNC
const typename internal::remove_all<typename MatrixType::Nested>::type&
103 nestedExpression()
const
109 typename MatrixType::Nested m_matrix;
118template<
typename Derived>
140template<
typename Derived>
167template<
int Direction>
173 template<
typename ExpressionType>
174 static void run(ExpressionType &
xpr)
186 template<
typename ExpressionType>
187 static void run(ExpressionType &
xpr)
209template<
typename ExpressionType,
int Direction>
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:47
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(const DenseBase< OtherDerived > &other)
swaps *this with the expression other.
Definition DenseBase.h:420
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
Definition DenseBase.h:562
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition Reverse.h:120
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
Definition DenseBase.h:550
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Expression of the reverse of a vector or matrix.
Definition Reverse.h:65
Pseudo expression providing broadcasting and partial reduction operations.
Definition VectorwiseOp.h:187
@ BothDirections
For Reverse, both rows and columns are reversed; not used for PartialReduxExpr and VectorwiseOp.
Definition Constants.h:270
@ Horizontal
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows.
Definition Constants.h:267
@ Vertical
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns.
Definition Constants.h:264
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition Constants.h:144
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Definition XprHelper.h:484
Definition GenericPacketMath.h:107
Definition ForwardDeclarations.h:17