10#ifndef EIGEN_INDEXED_VIEW_H
11#define EIGEN_INDEXED_VIEW_H
17template<
typename XprType,
typename RowIndices,
typename ColIndices>
24 MaxRowsAtCompileTime = RowsAtCompileTime !=
Dynamic ? int(RowsAtCompileTime) :
Dynamic,
25 MaxColsAtCompileTime = ColsAtCompileTime !=
Dynamic ? int(ColsAtCompileTime) :
Dynamic,
28 IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1
29 : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0
34 InnerIncr = IsRowMajor ? ColIncr : RowIncr,
35 OuterIncr = IsRowMajor ? RowIncr : ColIncr,
37 HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor),
41 InnerSize = XprTypeIsRowMajor ? ColsAtCompileTime : RowsAtCompileTime,
42 IsBlockAlike = InnerIncr==1 && OuterIncr==1,
45 InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==
DynamicIndex || XprInnerStride==
Dynamic ?
Dynamic : XprInnerStride * InnerIncr,
46 OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==
DynamicIndex || XprOuterstride==
Dynamic ?
Dynamic : XprOuterstride * OuterIncr,
49 ReturnAsBlock = (!ReturnAsScalar) && IsBlockAlike,
50 ReturnAsIndexedView = (!ReturnAsScalar) && (!ReturnAsBlock),
57 FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ?
LinearAccessBit : 0,
58 Flags = (
traits<XprType>::Flags & (
HereditaryBits | DirectAccessMask )) | FlagsLvalueBit | FlagsRowMajorBit | FlagsLinearAccessBit
66template<
typename XprType,
typename RowIndices,
typename ColIndices,
typename StorageKind>
108template<
typename XprType,
typename RowIndices,
typename ColIndices>
119 template<typename T0, typename T1>
120 IndexedView(XprType& xpr, const T0& rowIndices, const T1& colIndices)
121 : m_xpr(xpr), m_rowIndices(rowIndices), m_colIndices(colIndices)
139 const RowIndices&
rowIndices()
const {
return m_rowIndices; }
142 const ColIndices&
colIndices()
const {
return m_colIndices; }
152template<
typename XprType,
typename RowIndices,
typename ColIndices,
typename StorageKind>
163template<
typename ArgType,
typename RowIndices,
typename ColIndices>
192 return m_argImpl.coeff(m_xpr.rowIndices()[
row], m_xpr.colIndices()[
col]);
198 return m_argImpl.coeffRef(m_xpr.rowIndices()[
row], m_xpr.colIndices()[
col]);
207 return m_argImpl.coeffRef( m_xpr.rowIndices()[
row], m_xpr.colIndices()[
col]);
215 return m_argImpl.coeffRef( m_xpr.rowIndices()[
row], m_xpr.colIndices()[
col]);
223 return m_argImpl.coeff( m_xpr.rowIndices()[
row], m_xpr.colIndices()[
col]);
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i)
This is the const version of col().
Definition: BlockMethods.h:1097
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Just a side note.
Definition: Macros.h:1274
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Definition: Macros.h:1241
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:202
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Definition: StaticAssert.h:218
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:105
Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices.
Definition: IndexedView.h:110
const RowIndices & rowIndices() const
Definition: IndexedView.h:139
RowIndices m_rowIndices
Definition: IndexedView.h:146
IndexedViewImpl< XprType, RowIndices, ColIndices, typenameinternal::traits< XprType >::StorageKind >::Base Base
Definition: IndexedView.h:112
const ColIndices & colIndices() const
Definition: IndexedView.h:142
Index cols() const
Definition: IndexedView.h:128
internal::remove_reference< XprType >::type & nestedExpression()
Definition: IndexedView.h:136
internal::remove_all< XprType >::type NestedExpression
Definition: IndexedView.h:117
ColIndices m_colIndices
Definition: IndexedView.h:147
const internal::remove_all< XprType >::type & nestedExpression() const
Definition: IndexedView.h:132
Index rows() const
Definition: IndexedView.h:125
MatrixTypeNested m_xpr
Definition: IndexedView.h:145
Definition: IndexedView.h:155
internal::generic_xpr_base< IndexedView< XprType, RowIndices, ColIndices > >::type Base
Definition: IndexedView.h:157
type
Definition: core.h:575
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:130
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array.
Definition: Constants.h:155
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:144
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
Namespace containing all symbols from the Eigen library.
Definition: Core:141
const int UndefinedIncr
This value means that the increment to go from one value to another in a sequence is not constant for...
Definition: Constants.h:31
const unsigned int HereditaryBits
Definition: Constants.h:195
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int DynamicIndex
This value means that a signed quantity (e.g., a signed index) is not known at compile-time,...
Definition: Constants.h:27
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition: Constants.h:22
Definition: Eigen_Colamd.h:50
Definition: IndexedViewHelper.h:141
Definition: Constants.h:542
Definition: IndexedViewHelper.h:97
Definition: CoreEvaluators.h:111
Definition: CoreEvaluators.h:91
Definition: XprHelper.h:501
Definition: IndexedViewHelper.h:75
Definition: DenseCoeffsBase.h:659
Definition: XprHelper.h:660
Definition: DenseCoeffsBase.h:671
T type
Definition: Meta.h:126
T type
Definition: Meta.h:114
Block< XprType, RowsAtCompileTime, ColsAtCompileTime, IsInnerPannel > BlockType
Definition: IndexedView.h:61
Definition: ForwardDeclarations.h:17
IndexedView< ArgType, RowIndices, ColIndices > XprType
Definition: IndexedView.h:167
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
Definition: IndexedView.h:190
evaluator< ArgType > m_argImpl
Definition: IndexedView.h:228
XprType::CoeffReturnType CoeffReturnType
Definition: IndexedView.h:187
const XprType & m_xpr
Definition: IndexedView.h:229
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeffRef(Index index) const
Definition: IndexedView.h:211
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: IndexedView.h:202
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
Definition: IndexedView.h:196
XprType::Scalar Scalar
Definition: IndexedView.h:186
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &xpr)
Definition: IndexedView.h:181
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index index) const
Definition: IndexedView.h:219
Definition: CoreEvaluators.h:65