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>
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(); }
116 template<
typename Derived>
117 template<
int RowFactor,
int ColFactor>
132 template<
typename ExpressionType,
int Direction>
142 #endif // EIGEN_REPLICATE_H MatrixType::Scalar Scalar
ref_selector< MatrixType >::type MatrixTypeNested
EIGEN_DEVICE_FUNC Index rows() const
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
const internal::variable_if_dynamic< Index, RowFactor > m_rowFactor
EIGEN_DEVICE_FUNC Replicate(const OriginalMatrixType &matrix, Index rowFactor, Index colFactor)
const unsigned int RowMajorBit
internal::dense_xpr_base< Replicate >::type Base
EIGEN_DEVICE_FUNC Index cols() const
traits< MatrixType >::XprKind XprKind
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Expression of the multiple replication of a matrix or vector.
traits< MatrixType >::StorageKind StorageKind
EIGEN_DEVICE_FUNC const ReplicateReturnType replicate(Index factor) const
remove_reference< MatrixTypeNested >::type _MatrixTypeNested
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
MatrixTypeNested m_matrix
const internal::variable_if_dynamic< Index, ColFactor > m_colFactor
internal::traits< Replicate >::_MatrixTypeNested _MatrixTypeNested
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > replicate() const
internal::traits< Replicate >::MatrixTypeNested MatrixTypeNested
EIGEN_DEVICE_FUNC const _MatrixTypeNested & nestedExpression() const