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>
53 inline Index rows()
const {
return m_expression.rows(); }
54 inline Index cols()
const {
return m_expression.cols(); }
58 inline ScalarWithConstIfNotLvalue*
data() {
return m_expression.const_cast_derived().data(); }
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>
173 inline Index rows()
const {
return m_expression.rows(); }
174 inline Index cols()
const {
return m_expression.cols(); }
178 inline ScalarWithConstIfNotLvalue*
data() {
return m_expression.const_cast_derived().data(); }
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 NestedExpressionType m_expression
const Scalar & coeffRef(Index rowId, Index colId) const
void resize(Index newSize)
Scalar & coeffRef(Index rowId, Index colId)
internal::packet_traits< Scalar >::type PacketScalar
internal::conditional< internal::is_lvalue< ExpressionType >::value, Scalar, const Scalar >::type ScalarWithConstIfNotLvalue
internal::traits< Derived >::Scalar Scalar
Expression of a mathematical vector or matrix as an array object.
const internal::remove_all< NestedExpressionType >::type & nestedExpression() const
Base::CoeffReturnType CoeffReturnType
Scalar & coeffRef(Index rowId, Index colId)
void resize(Index nbRows, Index nbCols)
internal::conditional< internal::is_lvalue< ExpressionType >::value, Scalar, const Scalar >::type ScalarWithConstIfNotLvalue
const PacketScalar packet(Index index) const
internal::traits< Derived >::Index Index
The type of indices.
CoeffReturnType coeff(Index rowId, Index colId) const
Index outerStride() const
Index innerStride() const
iterative scaling algorithm to equilibrate rows and column norms in matrices
const PacketScalar packet(Index rowId, Index colId) const
const Scalar * data() const
CoeffReturnType coeff(Index index) const
const PacketScalar packet(Index rowId, Index colId) const
Scalar & coeffRef(Index index)
MatrixBase< MatrixWrapper< ExpressionType > > Base
const internal::remove_all< NestedExpressionType >::type & nestedExpression() const
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
internal::nested< ExpressionType >::type NestedExpressionType
Scalar & coeffRef(Index index)
CoeffReturnType coeff(Index rowId, Index colId) const
Expression of an array as a mathematical vector or matrix.
Index innerStride() const
NestedExpressionType m_expression
const Scalar & coeffRef(Index rowId, Index colId) const
Index outerStride() const
void writePacket(Index rowId, Index colId, const PacketScalar &val)
CoeffReturnType coeff(Index index) const
ArrayWrapper(ExpressionType &matrix)
void writePacket(Index index, const PacketScalar &val)
void resize(Index nbRows, Index nbCols)
const Scalar * data() const
const Scalar & coeffRef(Index index) const
ArrayBase< ArrayWrapper > Base
MatrixWrapper(ExpressionType &a_matrix)
Base class for all 1D and 2D array, and related expressions.
internal::nested< ExpressionType >::type NestedExpressionType
void writePacket(Index index, const PacketScalar &val)
const PacketScalar packet(Index index) const
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
void resize(Index newSize)
const Scalar & coeffRef(Index index) const
ScalarWithConstIfNotLvalue * data()
ScalarWithConstIfNotLvalue * data()
void evalTo(Dest &dst) const
void writePacket(Index rowId, Index colId, const PacketScalar &val)
Base class for all dense matrices, vectors, and expressions.