10#ifndef EIGEN_ARRAYWRAPPER_H
11#define EIGEN_ARRAYWRAPPER_H
27template<
typename ExpressionType>
29 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
35 Flags = Flags0 & ~NestByRefBit
40template<
typename ExpressionType>
47 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
61 inline Index rows()
const {
return m_expression.rows(); }
63 inline Index cols()
const {
return m_expression.cols(); }
65 inline Index outerStride()
const {
return m_expression.outerStride(); }
67 inline Index innerStride()
const {
return m_expression.innerStride(); }
72 inline const Scalar* data()
const {
return m_expression.data(); }
75 inline CoeffReturnType coeff(Index
rowId, Index
colId)
const
81 inline Scalar& coeffRef(Index
rowId, Index
colId)
83 return m_expression.const_cast_derived().coeffRef(
rowId,
colId);
87 inline const Scalar& coeffRef(Index
rowId, Index
colId)
const
89 return m_expression.const_cast_derived().coeffRef(
rowId,
colId);
93 inline CoeffReturnType coeff(Index index)
const
95 return m_expression.coeff(index);
99 inline Scalar& coeffRef(Index index)
101 return m_expression.const_cast_derived().coeffRef(index);
105 inline const Scalar& coeffRef(Index index)
const
107 return m_expression.const_cast_derived().coeffRef(index);
110 template<
int LoadMode>
111 inline const PacketScalar packet(Index
rowId, Index
colId)
const
116 template<
int LoadMode>
117 inline void writePacket(Index
rowId, Index
colId,
const PacketScalar& val)
122 template<
int LoadMode>
123 inline const PacketScalar packet(Index index)
const
128 template<
int LoadMode>
129 inline void writePacket(Index index,
const PacketScalar& val)
134 template<
typename Dest>
136 inline void evalTo(
Dest&
dst)
const {
dst = m_expression; }
138 const typename internal::remove_all<NestedExpressionType>::type&
140 nestedExpression()
const
152 void resize(Index rows, Index cols) { m_expression.const_cast_derived().resize(rows,cols); }
155 NestedExpressionType m_expression;
170template<
typename ExpressionType>
172 :
public traits<typename remove_all<typename ExpressionType::Nested>::type >
178 Flags = Flags0 & ~NestByRefBit
183template<
typename ExpressionType>
190 typedef typename internal::remove_all<ExpressionType>::type NestedExpression;
201 explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
204 inline Index rows()
const {
return m_expression.rows(); }
206 inline Index cols()
const {
return m_expression.cols(); }
208 inline Index outerStride()
const {
return m_expression.outerStride(); }
210 inline Index innerStride()
const {
return m_expression.innerStride(); }
215 inline const Scalar* data()
const {
return m_expression.data(); }
218 inline CoeffReturnType coeff(Index
rowId, Index
colId)
const
224 inline Scalar& coeffRef(Index
rowId, Index
colId)
226 return m_expression.const_cast_derived().coeffRef(
rowId,
colId);
230 inline const Scalar& coeffRef(Index
rowId, Index
colId)
const
232 return m_expression.derived().coeffRef(
rowId,
colId);
236 inline CoeffReturnType coeff(Index index)
const
238 return m_expression.coeff(index);
242 inline Scalar& coeffRef(Index index)
244 return m_expression.const_cast_derived().coeffRef(index);
248 inline const Scalar& coeffRef(Index index)
const
250 return m_expression.const_cast_derived().coeffRef(index);
253 template<
int LoadMode>
254 inline const PacketScalar packet(Index
rowId, Index
colId)
const
259 template<
int LoadMode>
260 inline void writePacket(Index
rowId, Index
colId,
const PacketScalar& val)
265 template<
int LoadMode>
266 inline const PacketScalar packet(Index index)
const
271 template<
int LoadMode>
272 inline void writePacket(Index index,
const PacketScalar& val)
278 const typename internal::remove_all<NestedExpressionType>::type&
279 nestedExpression()
const
291 void resize(Index rows, Index cols) { m_expression.const_cast_derived().resize(rows,cols); }
294 NestedExpressionType m_expression;
Base class for all 1D and 2D array, and related expressions.
Definition ArrayBase.h:41
EIGEN_DEVICE_FUNC MatrixWrapper< ArrayWrapper< ExpressionType > > matrix()
Definition ArrayBase.h:148
Expression of a mathematical vector or matrix as an array object.
Definition ArrayWrapper.h:42
EIGEN_DEVICE_FUNC void resize(Index newSize)
Forwards the resizing request to the nested expression.
Definition ArrayWrapper.h:148
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols)
Forwards the resizing request to the nested expression.
Definition ArrayWrapper.h:152
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Expression of an array as a mathematical vector or matrix.
Definition ArrayWrapper.h:185
EIGEN_DEVICE_FUNC void resize(Index newSize)
Forwards the resizing request to the nested expression.
Definition ArrayWrapper.h:287
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols)
Forwards the resizing request to the nested expression.
Definition ArrayWrapper.h:291
Pseudo expression representing a solving operation.
Definition Solve.h:63
The type used to identify an array expression.
Definition Constants.h:508
The type used to identify a matrix expression.
Definition Constants.h:505
Definition XprHelper.h:628
Definition ForwardDeclarations.h:17