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 template<
typename ExpressionType>
43 typedef typename
internal::conditional<
44 internal::is_lvalue<ExpressionType>::value,
51 inline
ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
53 inline Index rows()
const {
return m_expression.rows(); }
54 inline Index cols()
const {
return m_expression.cols(); }
59 inline const Scalar*
data()
const {
return m_expression.data(); }
63 return m_expression.coeff(rowId, colId);
68 return m_expression.const_cast_derived().coeffRef(rowId, colId);
73 return m_expression.const_cast_derived().coeffRef(rowId, colId);
78 return m_expression.coeff(index);
83 return m_expression.const_cast_derived().coeffRef(index);
88 return m_expression.const_cast_derived().coeffRef(index);
91 template<
int LoadMode>
94 return m_expression.template packet<LoadMode>(rowId, colId);
97 template<
int LoadMode>
100 m_expression.const_cast_derived().template writePacket<LoadMode>(rowId, colId, val);
103 template<
int LoadMode>
106 return m_expression.template packet<LoadMode>(index);
109 template<
int LoadMode>
112 m_expression.const_cast_derived().template writePacket<LoadMode>(index, val);
115 template<
typename Dest>
116 inline void evalTo(Dest& dst)
const { dst = m_expression; }
126 void resize(
Index newSize) { m_expression.const_cast_derived().resize(newSize); }
129 void resize(
Index nbRows,
Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); }
147 template<
typename ExpressionType>
149 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
155 template<
typename ExpressionType>
163 typedef typename
internal::conditional<
164 internal::is_lvalue<ExpressionType>::value,
173 inline Index rows()
const {
return m_expression.rows(); }
174 inline Index cols()
const {
return m_expression.cols(); }
179 inline const Scalar*
data()
const {
return m_expression.data(); }
183 return m_expression.coeff(rowId, colId);
188 return m_expression.const_cast_derived().coeffRef(rowId, colId);
193 return m_expression.derived().coeffRef(rowId, colId);
198 return m_expression.coeff(index);
203 return m_expression.const_cast_derived().coeffRef(index);
208 return m_expression.const_cast_derived().coeffRef(index);
211 template<
int LoadMode>
214 return m_expression.template packet<LoadMode>(rowId, colId);
217 template<
int LoadMode>
220 m_expression.const_cast_derived().template writePacket<LoadMode>(rowId, colId, val);
223 template<
int LoadMode>
226 return m_expression.template packet<LoadMode>(index);
229 template<
int LoadMode>
232 m_expression.const_cast_derived().template writePacket<LoadMode>(index, val);
243 void resize(
Index newSize) { m_expression.const_cast_derived().resize(newSize); }
246 void resize(
Index nbRows,
Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); }
254 #endif // EIGEN_ARRAYWRAPPER_H const Scalar * data() const
NestedExpressionType m_expression
void resize(Index newSize)
Scalar & coeffRef(Index rowId, Index colId)
internal::packet_traits< Scalar >::type PacketScalar
internal::traits< Derived >::Scalar Scalar
Expression of a mathematical vector or matrix as an array object.
Base::CoeffReturnType CoeffReturnType
Scalar & coeffRef(Index rowId, Index colId)
void resize(Index nbRows, Index nbCols)
internal::traits< Derived >::Index Index
The type of indices.
const PacketScalar packet(Index index) const
const internal::remove_all< NestedExpressionType >::type & nestedExpression() const
const Scalar & coeffRef(Index rowId, Index colId) const
CoeffReturnType coeff(Index rowId, Index colId) const
const PacketScalar packet(Index rowId, Index colId) const
const Scalar & coeffRef(Index rowId, Index colId) const
CoeffReturnType coeff(Index index) const
Scalar & coeffRef(Index index)
const Scalar & coeffRef(Index index) const
MatrixBase< MatrixWrapper< ExpressionType > > Base
void evalTo(Dest &dst) const
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Scalar & coeffRef(Index index)
Expression of an array as a mathematical vector or matrix.
NestedExpressionType m_expression
const PacketScalar packet(Index rowId, Index colId) const
void writePacket(Index rowId, Index colId, const PacketScalar &val)
void writePacket(Index index, const PacketScalar &val)
void resize(Index nbRows, Index nbCols)
ArrayBase< ArrayWrapper > Base
const Scalar * data() const
Base class for all 1D and 2D array, and related expressions.
CoeffReturnType coeff(Index rowId, Index colId) const
void writePacket(Index index, const PacketScalar &val)
Index innerStride() const
const PacketScalar packet(Index index) const
CoeffReturnType coeff(Index index) const
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
void resize(Index newSize)
Index outerStride() const
Index innerStride() const
ScalarWithConstIfNotLvalue * data()
const internal::remove_all< NestedExpressionType >::type & nestedExpression() const
ScalarWithConstIfNotLvalue * data()
Index outerStride() const
const Scalar & coeffRef(Index index) const
void writePacket(Index rowId, Index colId, const PacketScalar &val)
Base class for all dense matrices, vectors, and expressions.