10 #ifndef EIGEN_ARRAYWRAPPER_H 11 #define EIGEN_ARRAYWRAPPER_H 27 template<
typename ExpressionType>
28 struct traits<ArrayWrapper<ExpressionType> >
29 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
31 typedef ArrayXpr XprKind;
34 Flags0 = traits<typename remove_all<typename ExpressionType::Nested>::type >::Flags,
35 LvalueBitFlag = is_lvalue<ExpressionType>::value ?
LvalueBit : 0,
36 Flags = (Flags0 & ~(NestByRefBit |
LvalueBit)) | LvalueBitFlag
41 template<
typename ExpressionType>
48 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
50 typedef typename internal::conditional<
51 internal::is_lvalue<ExpressionType>::value,
54 >::type ScalarWithConstIfNotLvalue;
56 typedef typename internal::ref_selector<ExpressionType>::non_const_type NestedExpressionType;
61 explicit EIGEN_STRONG_INLINE
ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
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(); }
73 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.data(); }
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; }
93 const typename internal::remove_all<NestedExpressionType>::type&
95 nestedExpression()
const 110 NestedExpressionType m_expression;
125 template<
typename ExpressionType>
126 struct traits<MatrixWrapper<ExpressionType> >
127 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
132 Flags0 = traits<typename remove_all<typename ExpressionType::Nested>::type >::Flags,
133 LvalueBitFlag = is_lvalue<ExpressionType>::value ?
LvalueBit : 0,
134 Flags = (Flags0 & ~(NestByRefBit |
LvalueBit)) | LvalueBitFlag
139 template<
typename ExpressionType>
146 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
148 typedef typename internal::conditional<
149 internal::is_lvalue<ExpressionType>::value,
152 >::type ScalarWithConstIfNotLvalue;
154 typedef typename internal::ref_selector<ExpressionType>::non_const_type NestedExpressionType;
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(); }
171 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.data(); }
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 void resize(Index newSize)
Definition: ArrayWrapper.h:197
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:66
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:42
const unsigned int LvalueBit
Definition: Constants.h:139
Namespace containing all symbols from the Eigen library.
Definition: Core:287
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:38
void resize(Index rows, Index cols)
Definition: ArrayWrapper.h:201
Definition: Constants.h:506
Expression of an array as a mathematical vector or matrix.
Definition: ArrayBase.h:15
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:39
void resize(Index rows, Index cols)
Definition: ArrayWrapper.h:107
Definition: Eigen_Colamd.h:50
void resize(Index newSize)
Definition: ArrayWrapper.h:103
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48