10#ifndef EIGEN_DENSECOEFFSBASE_H
11#define EIGEN_DENSECOEFFSBASE_H
34template<
typename Derived>
67 return int(Derived::RowsAtCompileTime) == 1 ? 0
68 : int(Derived::ColsAtCompileTime) == 1 ? inner
76 return int(Derived::ColsAtCompileTime) == 1 ? 0
77 : int(Derived::RowsAtCompileTime) == 1 ? inner
100 &&
col >= 0 &&
col < cols());
107 return coeff(rowIndexByOuterInner(outer, inner),
108 colIndexByOuterInner(outer, inner));
119 &&
col >= 0 &&
col < cols());
143 THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
162 THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
189 x()
const {
return (*
this)[0]; }
197 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS);
207 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS);
217 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS);
231 template<
int LoadMode>
241 template<
int LoadMode>
244 return packet<LoadMode>(rowIndexByOuterInner(outer, inner),
245 colIndexByOuterInner(outer, inner));
258 template<
int LoadMode>
262 THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
301template<
typename Derived>
318 using Base::rowIndexByOuterInner;
319 using Base::colIndexByOuterInner;
320 using Base::operator[];
321 using Base::operator();
345 &&
col >= 0 &&
col < cols());
353 return coeffRef(rowIndexByOuterInner(outer, inner),
354 colIndexByOuterInner(outer, inner));
367 &&
col >= 0 &&
col < cols());
368 return coeffRef(
row,
col);
392 THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
409 THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
411 return coeffRef(
index);
428 return coeffRef(
index);
435 x() {
return (*
this)[0]; }
443 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS);
453 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS);
463 EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS);
480template<
typename Derived>
501 return derived().innerStride();
512 return derived().outerStride();
518 return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
528 return Derived::IsRowMajor ? outerStride() : innerStride();
538 return Derived::IsRowMajor ? innerStride() : outerStride();
554template<
typename Derived>
576 return derived().innerStride();
587 return derived().outerStride();
593 return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
603 return Derived::IsRowMajor ? outerStride() : innerStride();
613 return Derived::IsRowMajor ? innerStride() : outerStride();
619template<
int Alignment,
typename Derived,
bool JustReturnZero>
626template<
int Alignment,
typename Derived>
631 return internal::first_aligned<Alignment>(m.data(), m.size());
642template<
int Alignment,
typename Derived>
649template<
typename Derived>
652 typedef typename Derived::Scalar Scalar;
657template<typename Derived, bool HasDirectAccess = has_direct_access<Derived>::ret>
663template<
typename Derived>
669template<typename Derived, bool HasDirectAccess = has_direct_access<Derived>::ret>
675template<
typename Derived>
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_internal_assert(x)
Definition: Macros.h:1053
#define EIGEN_NOEXCEPT
Definition: Macros.h:1428
#define EIGEN_CONSTEXPR
Definition: Macros.h:797
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define eigen_assert(x)
Definition: Macros.h:1047
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:47
EIGEN_CONSTEXPR Index stride() const
Definition: DenseCoeffsBase.h:516
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index colStride() const
Definition: DenseCoeffsBase.h:536
DenseCoeffsBase< Derived, ReadOnlyAccessors > Base
Definition: DenseCoeffsBase.h:485
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const
Definition: DenseCoeffsBase.h:510
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rowStride() const
Definition: DenseCoeffsBase.h:526
NumTraits< Scalar >::Real RealScalar
Definition: DenseCoeffsBase.h:487
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const
Definition: DenseCoeffsBase.h:499
internal::traits< Derived >::Scalar Scalar
Definition: DenseCoeffsBase.h:486
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:574
NumTraits< Scalar >::Real RealScalar
Definition: DenseCoeffsBase.h:562
DenseCoeffsBase< Derived, WriteAccessors > Base
Definition: DenseCoeffsBase.h:560
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rowStride() const EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:601
internal::traits< Derived >::Scalar Scalar
Definition: DenseCoeffsBase.h:561
EIGEN_CONSTEXPR Index stride() const EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:591
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:585
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index colStride() const EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:611
Base class providing read-only coefficient access to matrices and arrays.
Definition: DenseCoeffsBase.h:36
internal::packet_traits< Scalar >::type PacketScalar
Definition: DenseCoeffsBase.h:40
internal::add_const_on_value_type_if_arithmetic< typenameinternal::packet_traits< Scalar >::type >::type PacketReturnType
Definition: DenseCoeffsBase.h:56
internal::traits< Derived >::StorageKind StorageKind
Definition: DenseCoeffsBase.h:38
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType operator()(Index row, Index col) const
Definition: DenseCoeffsBase.h:116
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType x() const
equivalent to operator[](0).
Definition: DenseCoeffsBase.h:189
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType w() const
equivalent to operator[](3).
Definition: DenseCoeffsBase.h:215
void coeffRefByOuterInner()
internal::conditional< bool(internal::traits< Derived >::Flags &LvalueBit), constScalar &, typenameinternal::conditional< internal::is_arithmetic< Scalar >::value, Scalar, constScalar >::type >::type CoeffReturnType
Definition: DenseCoeffsBase.h:52
EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: DenseCoeffsBase.h:259
void copyCoeffByOuterInner()
void writePacketByOuterInner()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType operator()(Index index) const
Definition: DenseCoeffsBase.h:179
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:74
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeffByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:105
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType z() const
equivalent to operator[](2).
Definition: DenseCoeffsBase.h:205
EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:242
EIGEN_STRONG_INLINE PacketReturnType packet(Index row, Index col) const
Definition: DenseCoeffsBase.h:232
internal::traits< Derived >::Scalar Scalar
Definition: DenseCoeffsBase.h:39
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:65
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType operator[](Index index) const
Definition: DenseCoeffsBase.h:159
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const
Short version: don't use this function, use operator()(Index,Index) const instead.
Definition: DenseCoeffsBase.h:97
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Short version: don't use this function, use operator[](Index) const instead.
Definition: DenseCoeffsBase.h:140
EigenBase< Derived > Base
Definition: DenseCoeffsBase.h:58
void copyPacketByOuterInner()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType y() const
equivalent to operator[](1).
Definition: DenseCoeffsBase.h:195
Base class providing read/write coefficient access to matrices and arrays.
Definition: DenseCoeffsBase.h:303
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & x()
equivalent to operator[](0).
Definition: DenseCoeffsBase.h:435
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator[](Index index)
Definition: DenseCoeffsBase.h:406
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & y()
equivalent to operator[](1).
Definition: DenseCoeffsBase.h:441
NumTraits< Scalar >::Real RealScalar
Definition: DenseCoeffsBase.h:311
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
Short version: don't use this function, use operator()(Index,Index) instead.
Definition: DenseCoeffsBase.h:342
DenseCoeffsBase< Derived, ReadOnlyAccessors > Base
Definition: DenseCoeffsBase.h:306
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index row, Index col)
Definition: DenseCoeffsBase.h:364
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & z()
equivalent to operator[](2).
Definition: DenseCoeffsBase.h:451
internal::packet_traits< Scalar >::type PacketScalar
Definition: DenseCoeffsBase.h:310
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index index)
Definition: DenseCoeffsBase.h:425
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Short version: don't use this function, use operator[](Index) instead.
Definition: DenseCoeffsBase.h:389
internal::traits< Derived >::Scalar Scalar
Definition: DenseCoeffsBase.h:309
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRefByOuterInner(Index outer, Index inner)
Definition: DenseCoeffsBase.h:351
internal::traits< Derived >::StorageKind StorageKind
Definition: DenseCoeffsBase.h:308
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & w()
equivalent to operator[](3).
Definition: DenseCoeffsBase.h:461
Definition: ForwardDeclarations.h:50
type
Definition: core.h:575
@ DirectAccessors
Direct read-only access to the coefficients.
Definition: Constants.h:380
@ ReadOnlyAccessors
Read-only access via a member function.
Definition: Constants.h:376
@ WriteAccessors
Read/write access via member functions.
Definition: Constants.h:378
@ DirectWriteAccessors
Direct read/write access to the coefficients.
Definition: Constants.h:382
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
const Scalar & y
Definition: MathFunctions.h:821
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
EIGEN_DEVICE_FUNC Index first_aligned(const Scalar *array, Index size)
Definition: Memory.h:469
EIGEN_DEVICE_FUNC Index first_default_aligned(const Scalar *array, Index size)
Definition: Memory.h:497
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:30
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:39
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
Definition: DenseCoeffsBase.h:17
conditional< is_arithmetic< T >::value, T, typenameadd_const_on_value_type< T >::type >::type type
Definition: DenseCoeffsBase.h:18
const T type
Definition: Meta.h:214
Definition: CoreEvaluators.h:91
static Index run(const Derived &m)
Definition: DenseCoeffsBase.h:629
Definition: DenseCoeffsBase.h:621
static EIGEN_CONSTEXPR Index run(const Derived &) EIGEN_NOEXCEPT
Definition: DenseCoeffsBase.h:622
Definition: DenseCoeffsBase.h:659
@ ret
Definition: DenseCoeffsBase.h:660
Definition: DenseCoeffsBase.h:671
@ ret
Definition: DenseCoeffsBase.h:672
T type
Definition: GenericPacketMath.h:108
Definition: ForwardDeclarations.h:17
Definition: GenericPacketMath.h:133