12#ifndef EIGEN_REVERSE_H
13#define EIGEN_REVERSE_H
19template<
typename MatrixType,
int Direction>
23 typedef typename MatrixType::Scalar
Scalar;
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
71 using
Base::IsRowMajor;
118template<
typename Derived>
140template<
typename Derived>
149 Index half2 = rows()/2;
159 Index half2 = cols()/2;
167template<
int Direction>
173 template<
typename ExpressionType>
174 static void run(ExpressionType &xpr)
176 const int HalfAtCompileTime = ExpressionType::RowsAtCompileTime==
Dynamic?
Dynamic:ExpressionType::RowsAtCompileTime/2;
178 xpr.topRows(fix<HalfAtCompileTime>(
half))
179 .swap(xpr.bottomRows(fix<HalfAtCompileTime>(
half)).colwise().reverse());
186 template<
typename ExpressionType>
187 static void run(ExpressionType &xpr)
189 const int HalfAtCompileTime = ExpressionType::ColsAtCompileTime==
Dynamic?
Dynamic:ExpressionType::ColsAtCompileTime/2;
191 xpr.leftCols(fix<HalfAtCompileTime>(
half))
192 .swap(xpr.rightCols(fix<HalfAtCompileTime>(
half)).rowwise().reverse());
209template<
typename ExpressionType,
int Direction>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i)
This is the const version of col().
Definition: BlockMethods.h:1097
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type tail(NType n)
Definition: BlockMethods.h:1257
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NRowsBlockXpr< internal::get_fixed_value< NRowsType >::value >::Type topRows(NRowsType n)
Definition: BlockMethods.h:570
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NColsBlockXpr< internal::get_fixed_value< NColsType >::value >::Type rightCols(NColsType n)
Definition: BlockMethods.h:872
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NRowsBlockXpr< internal::get_fixed_value< NRowsType >::value >::Type bottomRows(NRowsType n)
Definition: BlockMethods.h:645
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NColsBlockXpr< internal::get_fixed_value< NColsType >::value >::Type leftCols(NColsType n)
Definition: BlockMethods.h:797
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
#define EIGEN_NOEXCEPT
Definition: Macros.h:1428
#define EIGEN_CONSTEXPR
Definition: Macros.h:797
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1293
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Definition: Macros.h:1241
EIGEN_DEVICE_FUNC void reverseInPlace()
This is the "in place" version of reverse: it reverses *this.
Definition: Reverse.h:141
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition: Reverse.h:120
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:65
internal::remove_all< MatrixType >::type NestedExpression
Definition: Reverse.h:70
EIGEN_DEVICE_FUNC Index innerStride() const
Definition: Reverse.h:97
internal::reverse_packet_cond< PacketScalar, ReversePacket > reverse_packet
Definition: Reverse.h:85
@ OffsetCol
Definition: Reverse.h:80
@ ReversePacket
Definition: Reverse.h:81
@ ReverseRow
Definition: Reverse.h:77
@ PacketSize
Definition: Reverse.h:75
@ ReverseCol
Definition: Reverse.h:78
@ OffsetRow
Definition: Reverse.h:79
@ IsColMajor
Definition: Reverse.h:76
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: Reverse.h:93
EIGEN_DEVICE_FUNC Reverse(const MatrixType &matrix)
Definition: Reverse.h:88
EIGEN_DEVICE_FUNC const internal::remove_all< typenameMatrixType::Nested >::type & nestedExpression() const
Definition: Reverse.h:103
MatrixType::Nested m_matrix
Definition: Reverse.h:109
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Reverse.h:95
internal::dense_xpr_base< Reverse >::type Base
Definition: Reverse.h:68
EIGEN_DEVICE_FUNC void reverseInPlace()
This is the "in place" version of VectorwiseOp::reverse: it reverses each column or row of *this.
Definition: Reverse.h:210
type
Definition: core.h:575
@ 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
EIGEN_STRONG_INLINE Packet4f preverse(const Packet4f &a)
Definition: PacketMath.h:891
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.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
GHC_FS_API uintmax_t remove_all(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4732
Definition: Eigen_Colamd.h:50
Definition: XprHelper.h:484
Definition: GenericPacketMath.h:107
Definition: XprHelper.h:417
T type
Definition: Meta.h:126
T type
Definition: Meta.h:114
static PacketType run(const PacketType &x)
Definition: Reverse.h:44
static PacketType run(const PacketType &x)
Definition: Reverse.h:39
traits< MatrixType >::StorageKind StorageKind
Definition: Reverse.h:24
ref_selector< MatrixType >::type MatrixTypeNested
Definition: Reverse.h:26
traits< MatrixType >::XprKind XprKind
Definition: Reverse.h:25
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
Definition: Reverse.h:27
MatrixType::Scalar Scalar
Definition: Reverse.h:23
Definition: ForwardDeclarations.h:17
static void run(ExpressionType &xpr)
Definition: Reverse.h:187
static void run(ExpressionType &xpr)
Definition: Reverse.h:174
Definition: Reverse.h:168