10 #ifndef EIGEN_REPLICATE_H
11 #define EIGEN_REPLICATE_H
18 template<
typename MatrixType,
int RowFactor,
int ColFactor>
19 struct traits<Replicate<
MatrixType,RowFactor,ColFactor> >
23 typedef typename traits<MatrixType>::StorageKind StorageKind;
24 typedef typename traits<MatrixType>::XprKind XprKind;
25 typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
26 typedef std::remove_reference_t<MatrixTypeNested> MatrixTypeNested_;
28 RowsAtCompileTime = RowFactor==
Dynamic || int(MatrixType::RowsAtCompileTime)==
Dynamic
30 : RowFactor * MatrixType::RowsAtCompileTime,
31 ColsAtCompileTime = ColFactor==
Dynamic || int(MatrixType::ColsAtCompileTime)==
Dynamic
33 : ColFactor * MatrixType::ColsAtCompileTime,
35 MaxRowsAtCompileTime = RowsAtCompileTime,
36 MaxColsAtCompileTime = ColsAtCompileTime,
37 IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1
38 : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0
63 template<
typename MatrixType,
int RowFactor,
int ColFactor>
class Replicate
64 :
public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
70 typedef typename internal::dense_xpr_base<Replicate>::type
Base;
74 template<typename OriginalMatrixType>
76 inline explicit
Replicate(const OriginalMatrixType& matrix)
79 EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>,OriginalMatrixType>::value),
80 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
84 template<
typename OriginalMatrixType>
89 EIGEN_STATIC_ASSERT((internal::is_same<std::remove_const_t<MatrixType>,OriginalMatrixType>::value),
90 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
106 const internal::variable_if_dynamic<Index, RowFactor>
m_rowFactor;
107 const internal::variable_if_dynamic<Index, ColFactor>
m_colFactor;
118 template<
typename Derived>
119 template<
int RowFactor,
int ColFactor>
134 template<
typename ExpressionType,
int Direction>
#define EIGEN_DEVICE_FUNC
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
#define EIGEN_STATIC_ASSERT(X, MSG)
Matrix< float, 1, Dynamic > MatrixType
internal::traits< Derived >::Scalar Scalar
const Replicate< Derived, RowFactor, ColFactor > replicate() const
The matrix class, also used for vectors and row-vectors.
Expression of the multiple replication of a matrix or vector.
internal::traits< Replicate >::MatrixTypeNested_ MatrixTypeNested_
internal::traits< Replicate >::MatrixTypeNested MatrixTypeNested
EIGEN_CONSTEXPR Index rows() const
internal::dense_xpr_base< Replicate >::type Base
const internal::variable_if_dynamic< Index, ColFactor > m_colFactor
Replicate(const OriginalMatrixType &matrix, Index rowFactor, Index colFactor)
const internal::variable_if_dynamic< Index, RowFactor > m_rowFactor
internal::remove_all_t< MatrixType > NestedExpression
EIGEN_CONSTEXPR Index cols() const
MatrixTypeNested m_matrix
const MatrixTypeNested_ & nestedExpression() const
const ReplicateReturnType replicate(Index factor) const
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
const unsigned int RowMajorBit
typename remove_all< T >::type remove_all_t
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.