10 #ifndef EIGEN_REPLICATE_H 11 #define EIGEN_REPLICATE_H 16 template<
typename MatrixType,
int RowFactor,
int ColFactor>
20 typedef typename MatrixType::Scalar Scalar;
26 RowsAtCompileTime = RowFactor==
Dynamic || int(MatrixType::RowsAtCompileTime)==
Dynamic 28 : RowFactor * MatrixType::RowsAtCompileTime,
29 ColsAtCompileTime = ColFactor==
Dynamic || int(MatrixType::ColsAtCompileTime)==
Dynamic 31 : ColFactor * MatrixType::ColsAtCompileTime,
33 MaxRowsAtCompileTime = RowsAtCompileTime,
34 MaxColsAtCompileTime = ColsAtCompileTime,
35 IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1
36 : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0
61 template<
typename MatrixType,
int RowFactor,
int ColFactor>
class Replicate 72 template<
typename OriginalMatrixType>
74 inline explicit Replicate(
const OriginalMatrixType& matrix)
75 : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor)
78 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
82 template<
typename OriginalMatrixType>
84 inline Replicate(
const OriginalMatrixType& matrix,
Index rowFactor,
Index colFactor)
85 : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor)
88 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
92 inline Index rows()
const {
return m_matrix.rows() * m_rowFactor.value(); }
94 inline Index cols()
const {
return m_matrix.cols() * m_colFactor.value(); }
97 const _MatrixTypeNested& nestedExpression()
const 103 MatrixTypeNested m_matrix;
116 template<
typename Derived>
117 template<
int RowFactor,
int ColFactor>
132 template<
typename ExpressionType,
int Direction>
142 #endif // EIGEN_REPLICATE_H For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns...
Definition: Constants.h:265
Eigen::Index Index
Definition: VectorwiseOp.h:162
EIGEN_DEVICE_FUNC const ReplicateReturnType replicate(Index factor) const
Definition: Replicate.h:134
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
Definition: XprHelper.h:463
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:61
Definition: XprHelper.h:396
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows...
Definition: Constants.h:268
Definition: BandTriangularSolver.h:13
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Definition: ForwardDeclarations.h:17