10 #ifndef EIGEN_ARRAYWRAPPER_H
11 #define EIGEN_ARRAYWRAPPER_H
27 template<
typename ExpressionType>
29 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
36 Flags = (Flags0 & ~(NestByRefBit |
LvalueBit)) | LvalueBitFlag
41 template<
typename ExpressionType>
48 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
64 inline Index rows()
const {
return m_expression.rows(); }
66 inline Index cols()
const {
return m_expression.cols(); }
68 inline Index outerStride()
const {
return m_expression.outerStride(); }
70 inline Index innerStride()
const {
return m_expression.innerStride(); }
75 inline const Scalar* data()
const {
return m_expression.data(); }
78 inline const Scalar& coeffRef(
Index rowId,
Index colId)
const
80 return m_expression.coeffRef(rowId, colId);
84 inline const Scalar& coeffRef(
Index index)
const
86 return m_expression.coeffRef(index);
89 template<
typename Dest>
91 inline void evalTo(Dest& dst)
const { dst = m_expression; }
94 const typename internal::remove_all<NestedExpressionType>::type&
95 nestedExpression()
const
110 NestedExpressionType m_expression;
125 template<
typename ExpressionType>
127 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
134 Flags = (Flags0 & ~(NestByRefBit |
LvalueBit)) | LvalueBitFlag
139 template<
typename ExpressionType>
146 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
156 using Base::coeffRef;
159 explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
162 inline Index rows()
const {
return m_expression.rows(); }
164 inline Index cols()
const {
return m_expression.cols(); }
166 inline Index outerStride()
const {
return m_expression.outerStride(); }
168 inline Index innerStride()
const {
return m_expression.innerStride(); }
173 inline const Scalar* data()
const {
return m_expression.data(); }
176 inline const Scalar& coeffRef(
Index rowId,
Index colId)
const
178 return m_expression.derived().coeffRef(rowId, colId);
182 inline const Scalar& coeffRef(
Index index)
const
184 return m_expression.coeffRef(index);
188 const typename internal::remove_all<NestedExpressionType>::type&
189 nestedExpression()
const
204 NestedExpressionType m_expression;
209 #endif // EIGEN_ARRAYWRAPPER_H