10 #ifndef EIGEN_ARRAYWRAPPER_H 11 #define EIGEN_ARRAYWRAPPER_H 27 template<
typename ExpressionType>
29 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
35 Flags = Flags0 & ~NestByRefBit
40 template<
typename ExpressionType>
56 inline ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
58 inline Index rows()
const {
return m_expression.rows(); }
59 inline Index cols()
const {
return m_expression.cols(); }
60 inline Index outerStride()
const {
return m_expression.outerStride(); }
61 inline Index innerStride()
const {
return m_expression.innerStride(); }
63 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.const_cast_derived().data(); }
64 inline const Scalar* data()
const {
return m_expression.data(); }
66 inline CoeffReturnType coeff(
Index rowId,
Index colId)
const 68 return m_expression.coeff(rowId, colId);
71 inline Scalar& coeffRef(
Index rowId,
Index colId)
73 return m_expression.const_cast_derived().coeffRef(rowId, colId);
76 inline const Scalar& coeffRef(
Index rowId,
Index colId)
const 78 return m_expression.const_cast_derived().coeffRef(rowId, colId);
81 inline CoeffReturnType coeff(
Index index)
const 83 return m_expression.coeff(index);
86 inline Scalar& coeffRef(
Index index)
88 return m_expression.const_cast_derived().coeffRef(index);
91 inline const Scalar& coeffRef(
Index index)
const 93 return m_expression.const_cast_derived().coeffRef(index);
96 template<
int LoadMode>
99 return m_expression.template packet<LoadMode>(rowId, colId);
102 template<
int LoadMode>
105 m_expression.const_cast_derived().template writePacket<LoadMode>(rowId, colId, val);
108 template<
int LoadMode>
111 return m_expression.template packet<LoadMode>(index);
114 template<
int LoadMode>
117 m_expression.const_cast_derived().template writePacket<LoadMode>(index, val);
120 template<
typename Dest>
121 inline void evalTo(Dest& dst)
const { dst = m_expression; }
124 nestedExpression()
const 131 void resize(
Index newSize) { m_expression.const_cast_derived().resize(newSize); }
134 void resize(
Index nbRows,
Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); }
137 NestedExpressionType m_expression;
152 template<
typename ExpressionType>
154 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
160 Flags = Flags0 & ~NestByRefBit
165 template<
typename ExpressionType>
177 >::type ScalarWithConstIfNotLvalue;
181 inline MatrixWrapper(ExpressionType& a_matrix) : m_expression(a_matrix) {}
183 inline Index rows()
const {
return m_expression.rows(); }
184 inline Index cols()
const {
return m_expression.cols(); }
185 inline Index outerStride()
const {
return m_expression.outerStride(); }
186 inline Index innerStride()
const {
return m_expression.innerStride(); }
188 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.const_cast_derived().data(); }
189 inline const Scalar* data()
const {
return m_expression.data(); }
191 inline CoeffReturnType coeff(Index rowId, Index colId)
const 193 return m_expression.coeff(rowId, colId);
196 inline Scalar& coeffRef(Index rowId, Index colId)
198 return m_expression.const_cast_derived().coeffRef(rowId, colId);
201 inline const Scalar& coeffRef(Index rowId, Index colId)
const 203 return m_expression.derived().coeffRef(rowId, colId);
206 inline CoeffReturnType coeff(Index index)
const 208 return m_expression.coeff(index);
211 inline Scalar& coeffRef(Index index)
213 return m_expression.const_cast_derived().coeffRef(index);
216 inline const Scalar& coeffRef(Index index)
const 218 return m_expression.const_cast_derived().coeffRef(index);
221 template<
int LoadMode>
222 inline const PacketScalar packet(Index rowId, Index colId)
const 224 return m_expression.template packet<LoadMode>(rowId, colId);
227 template<
int LoadMode>
228 inline void writePacket(Index rowId, Index colId,
const PacketScalar& val)
230 m_expression.const_cast_derived().template writePacket<LoadMode>(rowId, colId, val);
233 template<
int LoadMode>
234 inline const PacketScalar packet(Index index)
const 236 return m_expression.template packet<LoadMode>(index);
239 template<
int LoadMode>
240 inline void writePacket(Index index,
const PacketScalar& val)
242 m_expression.const_cast_derived().template writePacket<LoadMode>(index, val);
246 nestedExpression()
const 253 void resize(
Index newSize) { m_expression.const_cast_derived().resize(newSize); }
256 void resize(
Index nbRows,
Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); }
259 NestedExpressionType m_expression;
264 #endif // EIGEN_ARRAYWRAPPER_H Definition: gtest_unittest.cc:5031
void resize(Index newSize)
Forwards the resizing request to the nested expression.
Definition: ArrayWrapper.h:253
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:41
void resize(Index nbRows, Index nbCols)
Forwards the resizing request to the nested expression.
Definition: ArrayWrapper.h:134
internal::traits< Derived >::Index Index
The type of indices.
Definition: DenseBase.h:60
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
The type used to identify a matrix expression.
Definition: Constants.h:431
Expression of an array as a mathematical vector or matrix.
Definition: ArrayBase.h:15
void resize(Index nbRows, Index nbCols)
Forwards the resizing request to the nested expression.
Definition: ArrayWrapper.h:256
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:39
Definition: BandTriangularSolver.h:13
void resize(Index newSize)
Forwards the resizing request to the nested expression.
Definition: ArrayWrapper.h:131
The type used to identify an array expression.
Definition: Constants.h:434
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:459
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48