10#ifndef EIGEN_REPLICATE_H
11#define EIGEN_REPLICATE_H
16template<
typename MatrixType,
int RowFactor,
int ColFactor>
20 typedef typename MatrixType::Scalar Scalar;
24 typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
28 :
RowFactor * MatrixType::RowsAtCompileTime,
31 :
ColFactor * MatrixType::ColsAtCompileTime,
33 MaxRowsAtCompileTime = RowsAtCompileTime,
34 MaxColsAtCompileTime = ColsAtCompileTime,
35 IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1
36 : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0
61template<
typename MatrixType,
int RowFactor,
int ColFactor>
class Replicate
70 typedef typename internal::remove_all<MatrixType>::type NestedExpression;
72 template<
typename OriginalMatrixType>
78 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
82 template<
typename OriginalMatrixType>
88 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
91 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
92 inline Index rows()
const {
return m_matrix.rows() * m_rowFactor.
value(); }
93 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
94 inline Index cols()
const {
return m_matrix.cols() * m_colFactor.
value(); }
97 const _MatrixTypeNested& nestedExpression()
const
103 MatrixTypeNested m_matrix;
116template<
typename Derived>
117template<
int RowFactor,
int ColFactor>
132template<
typename ExpressionType,
int Direction>
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:47
EIGEN_DEVICE_FUNC CoeffReturnType value() const
Definition DenseBase.h:526
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Expression of the multiple replication of a matrix or vector.
Definition Replicate.h:63
Pseudo expression providing broadcasting and partial reduction operations.
Definition VectorwiseOp.h:187
Eigen::Index Index
Definition VectorwiseOp.h:192
Definition XprHelper.h:130
@ 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 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 ForwardDeclarations.h:17