Eigen::DenseCoeffsBase< Derived, WriteAccessors > Class Template Reference

Base class providing read/write coefficient access to matrices and arrays. More...

#include <DenseCoeffsBase.h>

+ Inheritance diagram for Eigen::DenseCoeffsBase< Derived, WriteAccessors >:

Public Types

typedef DenseCoeffsBase< Derived, ReadOnlyAccessorsBase
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
- Public Types inherited from Eigen::DenseCoeffsBase< Derived, ReadOnlyAccessors >
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef std::conditional_t< bool(internal::traits< Derived >::Flags &LvalueBit), const Scalar &, std::conditional_t< internal::is_arithmetic< Scalar >::value, Scalar, const Scalar > > CoeffReturnType
 
typedef internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type PacketReturnType
 
typedef EigenBase< Derived > Base
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index row, Index col)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarcoeffRefByOuterInner (Index outer, Index inner)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalaroperator() (Index row, Index col)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
 
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalaroperator[] (Index index)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalaroperator() (Index index)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalarx ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalary ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalarz ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalarw ()
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
constexpr EIGEN_DEVICE_FUNC Derived & derived ()
 
constexpr EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
- Public Member Functions inherited from Eigen::DenseCoeffsBase< Derived, ReadOnlyAccessors >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowIndexByOuterInner (Index outer, Index inner) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colIndexByOuterInner (Index outer, Index inner) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff (Index row, Index col) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeffByOuterInner (Index outer, Index inner) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator() (Index row, Index col) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff (Index index) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator[] (Index index) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator() (Index index) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType x () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType y () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType z () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType w () const
 
template<int LoadMode>
EIGEN_STRONG_INLINE PacketReturnType packet (Index row, Index col) const
 
template<int LoadMode>
EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner (Index outer, Index inner) const
 
template<int LoadMode>
EIGEN_STRONG_INLINE PacketReturnType packet (Index index) const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
constexpr EIGEN_DEVICE_FUNC Derived & derived ()
 
constexpr EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
constexpr EIGEN_DEVICE_FUNC Derived & derived ()
 
constexpr EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > device (Device &device)
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > device (Device &device) const
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::DenseCoeffsBase< Derived, ReadOnlyAccessors >
void coeffRef ()
 
void coeffRefByOuterInner ()
 
void writePacket ()
 
void writePacketByOuterInner ()
 
void copyCoeff ()
 
void copyCoeffByOuterInner ()
 
void copyPacket ()
 
void copyPacketByOuterInner ()
 
void stride ()
 
void innerStride ()
 
void outerStride ()
 
void rowStride ()
 
void colStride ()
 

Detailed Description

template<typename Derived>
class Eigen::DenseCoeffsBase< Derived, WriteAccessors >

Base class providing read/write coefficient access to matrices and arrays.

Template Parameters
DerivedType of the derived class
Note
WriteAccessors Constant indicating read/write access

This class defines the non-const operator() function and friends, which can be used to write specific entries of a matrix or array. This class inherits DenseCoeffsBase<Derived, ReadOnlyAccessors> which defines the const variant for reading specific entries.

See also
DenseCoeffsBase<Derived, DirectAccessors>, The class hierarchy

Member Typedef Documentation

◆ Base

template<typename Derived >
typedef DenseCoeffsBase<Derived, ReadOnlyAccessors> Eigen::DenseCoeffsBase< Derived, WriteAccessors >::Base

◆ PacketScalar

template<typename Derived >
typedef internal::packet_traits<Scalar>::type Eigen::DenseCoeffsBase< Derived, WriteAccessors >::PacketScalar

◆ RealScalar

template<typename Derived >
typedef NumTraits<Scalar>::Real Eigen::DenseCoeffsBase< Derived, WriteAccessors >::RealScalar

◆ Scalar

template<typename Derived >
typedef internal::traits<Derived>::Scalar Eigen::DenseCoeffsBase< Derived, WriteAccessors >::Scalar

◆ StorageKind

template<typename Derived >
typedef internal::traits<Derived>::StorageKind Eigen::DenseCoeffsBase< Derived, WriteAccessors >::StorageKind

Member Function Documentation

◆ coeffRef() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRef ( Index  index)
inlineconstexpr

Short version: don't use this function, use operator[](Index) instead.

Long version: this function is similar to operator[](Index), but without the assertion. Use this for limiting the performance cost of debugging code when doing repeated coefficient access. Only use this when it is guaranteed that the parameters row and col are in range.

If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this function equivalent to operator[](Index).

See also
operator[](Index), coeff(Index) const, coeffRef(Index,Index)
335  {
336  EIGEN_STATIC_ASSERT(internal::evaluator<Derived>::Flags & LinearAccessBit,
337  THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
338  eigen_internal_assert(index >= 0 && index < size());
339  return internal::evaluator<Derived>(derived()).coeffRef(index);
340  }
#define eigen_internal_assert(x)
Definition: Macros.h:916
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:64
const unsigned int LinearAccessBit
Definition: Constants.h:133

References eigen_internal_assert, EIGEN_STATIC_ASSERT, Eigen::LinearAccessBit, and size.

◆ coeffRef() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRef ( Index  row,
Index  col 
)
inlineconstexpr

Short version: don't use this function, use operator()(Index,Index) instead.

Long version: this function is similar to operator()(Index,Index), but without the assertion. Use this for limiting the performance cost of debugging code when doing repeated coefficient access. Only use this when it is guaranteed that the parameters row and col are in range.

If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this function equivalent to operator()(Index,Index).

See also
operator()(Index,Index), coeff(Index, Index) const, coeffRef(Index)
301  {
302  eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
303  return internal::evaluator<Derived>(derived()).coeffRef(row, col);
304  }
m col(1)
m row(1)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:61
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:59

References col(), cols, eigen_internal_assert, row(), and rows.

◆ coeffRefByOuterInner()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRefByOuterInner ( Index  outer,
Index  inner 
)
inline
306  {
307  return coeffRef(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner));
308  }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:71
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const
Definition: DenseCoeffsBase.h:64

◆ cols()

◆ derived() [1/2]

template<typename Derived >
constexpr EIGEN_DEVICE_FUNC Derived& Eigen::EigenBase< Derived >::derived
inlineconstexpr
Returns
a reference to the derived object
49 { return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived >
constexpr EIGEN_DEVICE_FUNC const Derived& Eigen::EigenBase< Derived >::derived
inlineconstexpr
Returns
a const reference to the derived object
51 { return *static_cast<const Derived*>(this); }

◆ operator()() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::operator() ( Index  index)
inline
Returns
a reference to the coefficient at given index.

This is synonymous to operator[](Index).

This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit.

See also
operator[](Index) const, operator()(Index,Index), x(), y(), z(), w()
365  {
366  eigen_assert(index >= 0 && index < size());
367  return coeffRef(index);
368  }
#define eigen_assert(x)
Definition: Macros.h:910

References eigen_assert, and size.

◆ operator()() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::operator() ( Index  row,
Index  col 
)
inlineconstexpr
Returns
a reference to the coefficient at given the given row and column.
See also
operator[](Index)
315  {
316  eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols());
317  return coeffRef(row, col);
318  }

References col(), cols, eigen_assert, row(), and rows.

◆ operator[]()

template<typename Derived >
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::operator[] ( Index  index)
inlineconstexpr
Returns
a reference to the coefficient at given index.

This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit.

See also
operator[](Index) const, operator()(Index,Index), x(), y(), z(), w()
349  {
350  EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
351  THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
352  eigen_assert(index >= 0 && index < size());
353  return coeffRef(index);
354  }

References eigen_assert, EIGEN_STATIC_ASSERT, and size.

◆ rows()

◆ size()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::EigenBase< Derived >::size
inline
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols(), SizeAtCompileTime.
64 { return rows() * cols(); }

◆ w()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::w ( )
inline

equivalent to operator[](3).

390  {
391  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS);
392  return (*this)[3];
393  }

References EIGEN_STATIC_ASSERT.

◆ x()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::x ( )
inline

equivalent to operator[](0).

372 { return (*this)[0]; }

◆ y()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::y ( )
inline

equivalent to operator[](1).

376  {
377  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS);
378  return (*this)[1];
379  }

References EIGEN_STATIC_ASSERT.

◆ z()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::z ( )
inline

equivalent to operator[](2).

383  {
384  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS);
385  return (*this)[2];
386  }

References EIGEN_STATIC_ASSERT.


The documentation for this class was generated from the following file: