10 #ifndef EIGEN_DENSECOEFFSBASE_H 11 #define EIGEN_DENSECOEFFSBASE_H 33 template<
typename Derived>
64 EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner)
const 66 return int(Derived::RowsAtCompileTime) == 1 ? 0
67 : int(Derived::ColsAtCompileTime) == 1 ? inner
72 EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner)
const 74 return int(Derived::ColsAtCompileTime) == 1 ? 0
75 : int(Derived::RowsAtCompileTime) == 1 ? inner
96 eigen_internal_assert(row >= 0 && row < rows()
97 && col >= 0 && col < cols());
98 return derived().coeff(row, col);
101 EIGEN_STRONG_INLINE
CoeffReturnType coeffByOuterInner(Index outer, Index inner)
const 103 return coeff(rowIndexByOuterInner(outer, inner),
104 colIndexByOuterInner(outer, inner));
113 eigen_assert(row >= 0 && row < rows()
114 && col >= 0 && col < cols());
115 return derived().coeff(row, col);
136 eigen_internal_assert(index >= 0 && index <
size());
137 return derived().coeff(index);
152 #ifndef EIGEN2_SUPPORT 153 EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
154 THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
156 eigen_assert(index >= 0 && index <
size());
157 return derived().coeff(index);
173 eigen_assert(index >= 0 && index <
size());
174 return derived().coeff(index);
180 x()
const {
return (*
this)[0]; }
185 y()
const {
return (*
this)[1]; }
190 z()
const {
return (*
this)[2]; }
195 w()
const {
return (*
this)[3]; }
207 template<
int LoadMode>
208 EIGEN_STRONG_INLINE PacketReturnType packet(Index row, Index col)
const 210 eigen_internal_assert(row >= 0 && row < rows()
211 && col >= 0 && col < cols());
212 return derived().template packet<LoadMode>(row,col);
217 template<
int LoadMode>
218 EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner(Index outer, Index inner)
const 220 return packet<LoadMode>(rowIndexByOuterInner(outer, inner),
221 colIndexByOuterInner(outer, inner));
234 template<
int LoadMode>
235 EIGEN_STRONG_INLINE PacketReturnType packet(Index index)
const 237 eigen_internal_assert(index >= 0 && index <
size());
238 return derived().template packet<LoadMode>(index);
248 void coeffRefByOuterInner();
250 void writePacketByOuterInner();
252 void copyCoeffByOuterInner();
254 void copyPacketByOuterInner();
273 template<
typename Derived>
291 using Base::rowIndexByOuterInner;
292 using Base::colIndexByOuterInner;
293 using Base::operator[];
294 using Base::operator();
314 EIGEN_STRONG_INLINE Scalar&
coeffRef(Index row, Index col)
316 eigen_internal_assert(row >= 0 && row < rows()
317 && col >= 0 && col < cols());
318 return derived().coeffRef(row, col);
321 EIGEN_STRONG_INLINE Scalar&
322 coeffRefByOuterInner(Index outer, Index inner)
324 return coeffRef(rowIndexByOuterInner(outer, inner),
325 colIndexByOuterInner(outer, inner));
333 EIGEN_STRONG_INLINE Scalar&
336 eigen_assert(row >= 0 && row < rows()
337 && col >= 0 && col < cols());
338 return derived().coeffRef(row, col);
357 EIGEN_STRONG_INLINE Scalar&
360 eigen_internal_assert(index >= 0 && index <
size());
361 return derived().coeffRef(index);
371 EIGEN_STRONG_INLINE Scalar&
374 #ifndef EIGEN2_SUPPORT 375 EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
376 THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
378 eigen_assert(index >= 0 && index <
size());
379 return derived().coeffRef(index);
391 EIGEN_STRONG_INLINE Scalar&
394 eigen_assert(index >= 0 && index <
size());
395 return derived().coeffRef(index);
400 EIGEN_STRONG_INLINE Scalar&
401 x() {
return (*
this)[0]; }
405 EIGEN_STRONG_INLINE Scalar&
406 y() {
return (*
this)[1]; }
410 EIGEN_STRONG_INLINE Scalar&
411 z() {
return (*
this)[2]; }
415 EIGEN_STRONG_INLINE Scalar&
416 w() {
return (*
this)[3]; }
428 template<
int StoreMode>
429 EIGEN_STRONG_INLINE
void writePacket
432 eigen_internal_assert(row >= 0 && row < rows()
433 && col >= 0 && col < cols());
434 derived().template writePacket<StoreMode>(row,col,val);
439 template<
int StoreMode>
440 EIGEN_STRONG_INLINE
void writePacketByOuterInner
443 writePacket<StoreMode>(rowIndexByOuterInner(outer, inner),
444 colIndexByOuterInner(outer, inner),
457 template<
int StoreMode>
458 EIGEN_STRONG_INLINE
void writePacket
461 eigen_internal_assert(index >= 0 && index <
size());
462 derived().template writePacket<StoreMode>(index,val);
465 #ifndef EIGEN_PARSED_BY_DOXYGEN 475 template<
typename OtherDerived>
478 eigen_internal_assert(row >= 0 && row < rows()
479 && col >= 0 && col < cols());
480 derived().coeffRef(row, col) = other.derived().coeff(row, col);
491 template<
typename OtherDerived>
494 eigen_internal_assert(index >= 0 && index <
size());
495 derived().coeffRef(index) = other.derived().coeff(index);
499 template<
typename OtherDerived>
502 const Index row = rowIndexByOuterInner(outer,inner);
503 const Index col = colIndexByOuterInner(outer,inner);
505 derived().copyCoeff(row, col, other);
516 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
519 eigen_internal_assert(row >= 0 && row < rows()
520 && col >= 0 && col < cols());
521 derived().template writePacket<StoreMode>(row, col,
522 other.derived().template packet<LoadMode>(row, col));
533 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
536 eigen_internal_assert(index >= 0 && index <
size());
537 derived().template writePacket<StoreMode>(index,
538 other.derived().template packet<LoadMode>(index));
542 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
543 EIGEN_STRONG_INLINE
void copyPacketByOuterInner(Index outer, Index inner,
const DenseBase<OtherDerived>& other)
545 const Index row = rowIndexByOuterInner(outer,inner);
546 const Index col = colIndexByOuterInner(outer,inner);
548 derived().template copyPacket< OtherDerived, StoreMode, LoadMode>(row, col, other);
565 template<
typename Derived>
586 return derived().innerStride();
596 return derived().outerStride();
600 inline Index stride()
const 602 return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
611 return Derived::IsRowMajor ? outerStride() : innerStride();
620 return Derived::IsRowMajor ? innerStride() : outerStride();
635 template<
typename Derived>
657 return derived().innerStride();
667 return derived().outerStride();
671 inline Index stride()
const 673 return Derived::IsVectorAtCompileTime ? innerStride() : outerStride();
682 return Derived::IsRowMajor ? outerStride() : innerStride();
691 return Derived::IsRowMajor ? innerStride() : outerStride();
697 template<
typename Derived,
bool JustReturnZero>
700 static inline typename Derived::Index run(
const Derived&)
704 template<
typename Derived>
707 static inline typename Derived::Index run(
const Derived& m)
709 return internal::first_aligned(&m.const_cast_derived().coeffRef(0,0), m.size());
718 template<
typename Derived>
719 static inline typename Derived::Index first_aligned(
const Derived& m)
726 template<typename Derived, bool HasDirectAccess = has_direct_access<Derived>::ret>
732 template<
typename Derived>
738 template<typename Derived, bool HasDirectAccess = has_direct_access<Derived>::ret>
744 template<
typename Derived>
754 #endif // EIGEN_DENSECOEFFSBASE_H EIGEN_STRONG_INLINE Scalar & operator[](Index index)
Definition: DenseCoeffsBase.h:372
Definition: DenseCoeffsBase.h:727
Read/write access via member functions.
Definition: Constants.h:312
EIGEN_STRONG_INLINE Scalar & operator()(Index index)
Definition: DenseCoeffsBase.h:392
EIGEN_STRONG_INLINE Scalar & w()
equivalent to operator[](3).
Definition: DenseCoeffsBase.h:416
EIGEN_STRONG_INLINE Scalar & z()
equivalent to operator[](2).
Definition: DenseCoeffsBase.h:411
Index rowStride() const
Definition: DenseCoeffsBase.h:609
Index outerStride() const
Definition: DenseCoeffsBase.h:594
Index innerStride() const
Definition: DenseCoeffsBase.h:584
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:142
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:131
EIGEN_STRONG_INLINE CoeffReturnType operator[](Index index) const
Definition: DenseCoeffsBase.h:150
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
Definition: ForwardDeclarations.h:50
EIGEN_STRONG_INLINE CoeffReturnType x() const
equivalent to operator[](0).
Definition: DenseCoeffsBase.h:180
Index colStride() const
Definition: DenseCoeffsBase.h:618
EIGEN_STRONG_INLINE CoeffReturnType operator()(Index row, Index col) const
Definition: DenseCoeffsBase.h:111
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
EIGEN_STRONG_INLINE Scalar & y()
equivalent to operator[](1).
Definition: DenseCoeffsBase.h:406
Definition: DenseCoeffsBase.h:16
EIGEN_STRONG_INLINE Scalar & operator()(Index row, Index col)
Definition: DenseCoeffsBase.h:334
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:26
EIGEN_STRONG_INLINE Scalar & coeffRef(Index row, Index col)
Short version: don't use this function, use operator()(Index,Index) instead.
Definition: DenseCoeffsBase.h:314
const unsigned int AlignedBit
means the first coefficient packet is guaranteed to be aligned
Definition: Constants.h:147
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
Read-only access via a member function.
Definition: Constants.h:310
EIGEN_STRONG_INLINE Scalar & x()
equivalent to operator[](0).
Definition: DenseCoeffsBase.h:401
EIGEN_STRONG_INLINE CoeffReturnType z() const
equivalent to operator[](2).
Definition: DenseCoeffsBase.h:190
Direct read-only access to the coefficients.
Definition: Constants.h:314
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:94
EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Short version: don't use this function, use operator[](Index) const instead.
Definition: DenseCoeffsBase.h:134
Index rowStride() const
Definition: DenseCoeffsBase.h:680
Direct read/write access to the coefficients.
Definition: Constants.h:316
Definition: BandTriangularSolver.h:13
EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Short version: don't use this function, use operator[](Index) instead.
Definition: DenseCoeffsBase.h:358
Index innerStride() const
Definition: DenseCoeffsBase.h:655
Definition: DenseCoeffsBase.h:739
EIGEN_STRONG_INLINE CoeffReturnType operator()(Index index) const
Definition: DenseCoeffsBase.h:171
Base class providing read-only coefficient access to matrices and arrays.
Definition: DenseCoeffsBase.h:34
EIGEN_STRONG_INLINE CoeffReturnType w() const
equivalent to operator[](3).
Definition: DenseCoeffsBase.h:195
Index outerStride() const
Definition: DenseCoeffsBase.h:665
Base class providing read/write coefficient access to matrices and arrays.
Definition: DenseCoeffsBase.h:274
Index colStride() const
Definition: DenseCoeffsBase.h:689
Definition: ForwardDeclarations.h:17
EIGEN_STRONG_INLINE CoeffReturnType y() const
equivalent to operator[](1).
Definition: DenseCoeffsBase.h:185
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48
Definition: DenseCoeffsBase.h:698