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 Flags = Flags0 & ~NestByRefBit
40 template<
typename ExpressionType>
47 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
49 typedef typename internal::conditional<
50 internal::is_lvalue<ExpressionType>::value,
53 >::type ScalarWithConstIfNotLvalue;
55 typedef typename internal::ref_selector<ExpressionType>::non_const_type NestedExpressionType;
60 explicit EIGEN_STRONG_INLINE
ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
63 inline Index rows()
const {
return m_expression.rows(); }
65 inline Index cols()
const {
return m_expression.cols(); }
67 inline Index outerStride()
const {
return m_expression.outerStride(); }
69 inline Index innerStride()
const {
return m_expression.innerStride(); }
72 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.data(); }
74 inline const Scalar* data()
const {
return m_expression.data(); }
77 inline const Scalar& coeffRef(
Index rowId,
Index colId)
const 79 return m_expression.coeffRef(rowId, colId);
83 inline const Scalar& coeffRef(
Index index)
const 85 return m_expression.coeffRef(index);
88 template<
typename Dest>
90 inline void evalTo(Dest& dst)
const { dst = m_expression; }
92 const typename internal::remove_all<NestedExpressionType>::type&
94 nestedExpression()
const 109 NestedExpressionType m_expression;
124 template<
typename ExpressionType>
125 struct traits<MatrixWrapper<ExpressionType> >
126 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
131 Flags0 = traits<typename remove_all<typename ExpressionType::Nested>::type >::Flags,
132 Flags = Flags0 & ~NestByRefBit
137 template<
typename ExpressionType>
144 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
146 typedef typename internal::conditional<
147 internal::is_lvalue<ExpressionType>::value,
150 >::type ScalarWithConstIfNotLvalue;
152 typedef typename internal::ref_selector<ExpressionType>::non_const_type NestedExpressionType;
154 using Base::coeffRef;
157 explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
160 inline Index rows()
const {
return m_expression.rows(); }
162 inline Index cols()
const {
return m_expression.cols(); }
164 inline Index outerStride()
const {
return m_expression.outerStride(); }
166 inline Index innerStride()
const {
return m_expression.innerStride(); }
169 inline ScalarWithConstIfNotLvalue* data() {
return m_expression.data(); }
171 inline const Scalar* data()
const {
return m_expression.data(); }
174 inline const Scalar& coeffRef(
Index rowId,
Index colId)
const 176 return m_expression.derived().coeffRef(rowId, colId);
180 inline const Scalar& coeffRef(
Index index)
const 182 return m_expression.coeffRef(index);
186 const typename internal::remove_all<NestedExpressionType>::type&
187 nestedExpression()
const 202 NestedExpressionType m_expression;
207 #endif // EIGEN_ARRAYWRAPPER_H void resize(Index newSize)
Definition: ArrayWrapper.h:195
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:66
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:41
Namespace containing all symbols from the Eigen library.
Definition: Core:287
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:37
void resize(Index rows, Index cols)
Definition: ArrayWrapper.h:199
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:106
Definition: Eigen_Colamd.h:50
void resize(Index newSize)
Definition: ArrayWrapper.h:102
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48