10 #ifndef EIGEN_REPLICATE_H 11 #define EIGEN_REPLICATE_H 31 template<
typename MatrixType,
int RowFactor,
int ColFactor>
44 RowsAtCompileTime = RowFactor==
Dynamic || int(MatrixType::RowsAtCompileTime)==
Dynamic 46 : RowFactor * MatrixType::RowsAtCompileTime,
47 ColsAtCompileTime = ColFactor==
Dynamic || int(MatrixType::ColsAtCompileTime)==
Dynamic 49 : ColFactor * MatrixType::ColsAtCompileTime,
51 MaxRowsAtCompileTime = RowsAtCompileTime,
52 MaxColsAtCompileTime = ColsAtCompileTime,
53 IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1
54 : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0
57 CoeffReadCost = _MatrixTypeNested::CoeffReadCost
62 template<
typename MatrixType,
int RowFactor,
int ColFactor>
class Replicate 72 template<
typename OriginalMatrixType>
73 inline explicit Replicate(
const OriginalMatrixType& a_matrix)
74 : m_matrix(a_matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor)
77 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
81 template<
typename OriginalMatrixType>
82 inline Replicate(
const OriginalMatrixType& a_matrix, Index rowFactor, Index colFactor)
83 : m_matrix(a_matrix), m_rowFactor(rowFactor), m_colFactor(colFactor)
86 THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE)
89 inline Index rows()
const {
return m_matrix.rows() * m_rowFactor.value(); }
90 inline Index cols()
const {
return m_matrix.cols() * m_colFactor.value(); }
92 inline Scalar coeff(Index rowId, Index colId)
const 96 : RowFactor==1 ? rowId
97 : rowId%m_matrix.rows();
99 : ColFactor==1 ? colId
100 : colId%m_matrix.cols();
102 return m_matrix.coeff(actual_row, actual_col);
104 template<
int LoadMode>
105 inline PacketScalar packet(Index rowId, Index colId)
const 108 : RowFactor==1 ? rowId
109 : rowId%m_matrix.rows();
111 : ColFactor==1 ? colId
112 : colId%m_matrix.cols();
114 return m_matrix.template packet<LoadMode>(actual_row, actual_col);
117 const _MatrixTypeNested& nestedExpression()
const 123 MatrixTypeNested m_matrix;
136 template<
typename Derived>
137 template<
int RowFactor,
int ColFactor>
152 template<
typename Derived>
167 template<
typename ExpressionType,
int Direction>
177 #endif // EIGEN_REPLICATE_H Definition: gtest_unittest.cc:5031
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns...
Definition: Constants.h:209
internal::traits< Derived >::Index Index
The type of indices.
Definition: DenseBase.h:60
const ReplicateReturnType replicate(Index factor) const
Definition: Replicate.h:169
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Definition: XprHelper.h:350
const Replicate< Derived, RowFactor, ColFactor > replicate() const
Definition: Replicate.h:139
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:62
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows...
Definition: Constants.h:212
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
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48