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

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

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

Public Types

typedef DenseCoeffsBase< Derived, ReadOnlyAccessorsBase
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
- Public Types inherited from Eigen::DenseCoeffsBase< Derived, ReadOnlyAccessors >
typedef EigenBase< Derived > Base
 
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 internal::packet_traits< Scalar >::type PacketScalar
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
- 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

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

Additional Inherited Members

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

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

Definition at line 304 of file DenseCoeffsBase.h.

Member Typedef Documentation

◆ Base

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

Definition at line 308 of file DenseCoeffsBase.h.

◆ PacketScalar

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

Definition at line 312 of file DenseCoeffsBase.h.

◆ RealScalar

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

Definition at line 313 of file DenseCoeffsBase.h.

◆ Scalar

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

Definition at line 311 of file DenseCoeffsBase.h.

◆ StorageKind

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

Definition at line 310 of file DenseCoeffsBase.h.

Member Function Documentation

◆ coeffRef() [1/2]

template<typename Derived >
Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRef ( Index  index)
inline

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)

Definition at line 391 of file DenseCoeffsBase.h.

392  {
393  EIGEN_STATIC_ASSERT(internal::evaluator<Derived>::Flags & LinearAccessBit,
394  THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS)
395  eigen_internal_assert(index >= 0 && index < size());
396  return internal::evaluator<Derived>(derived()).coeffRef(index);
397  }
#define eigen_internal_assert(x)
Definition: Macros.h:908
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:69
const unsigned int LinearAccessBit
Definition: Constants.h:132

◆ coeffRef() [2/2]

template<typename Derived >
Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRef ( Index  row,
Index  col 
)
inline

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)

Definition at line 344 of file DenseCoeffsBase.h.

345  {
346  eigen_internal_assert(row >= 0 && row < rows()
347  && col >= 0 && col < cols());
348  return internal::evaluator<Derived>(derived()).coeffRef(row,col);
349  }
RowXpr row(Index i)
This is the const version of row(). *‍/.
ColXpr col(Index i)
This is the const version of col().
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:65
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:62

◆ coeffRefByOuterInner()

template<typename Derived >
Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::coeffRefByOuterInner ( Index  outer,
Index  inner 
)
inline

Definition at line 353 of file DenseCoeffsBase.h.

354  {
355  return coeffRef(rowIndexByOuterInner(outer, inner),
356  colIndexByOuterInner(outer, inner));
357  }
Index colIndexByOuterInner(Index outer, Index inner) const
Index rowIndexByOuterInner(Index outer, Index inner) const

◆ cols()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::EigenBase< Derived >::cols ( void  )
inline
Returns
the number of columns.
See also
rows(), ColsAtCompileTime

Definition at line 65 of file EigenBase.h.

65 { return derived().cols(); }

◆ derived() [1/2]

template<typename Derived >
Derived& Eigen::EigenBase< Derived >::derived
inline
Returns
a reference to the derived object

Definition at line 48 of file EigenBase.h.

48 { return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived >
const Derived& Eigen::EigenBase< Derived >::derived
inline
Returns
a const reference to the derived object

Definition at line 51 of file EigenBase.h.

51 { return *static_cast<const Derived*>(this); }

◆ operator()() [1/2]

template<typename Derived >
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()

Definition at line 427 of file DenseCoeffsBase.h.

428  {
429  eigen_assert(index >= 0 && index < size());
430  return coeffRef(index);
431  }
#define eigen_assert(x)
Definition: Macros.h:902

◆ operator()() [2/2]

template<typename Derived >
Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::operator() ( Index  row,
Index  col 
)
inline
Returns
a reference to the coefficient at given the given row and column.
See also
operator[](Index)

Definition at line 366 of file DenseCoeffsBase.h.

367  {
368  eigen_assert(row >= 0 && row < rows()
369  && col >= 0 && col < cols());
370  return coeffRef(row, col);
371  }

◆ operator[]()

template<typename Derived >
Scalar& Eigen::DenseCoeffsBase< Derived, WriteAccessors >::operator[] ( Index  index)
inline
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()

Definition at line 408 of file DenseCoeffsBase.h.

409  {
410  EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime,
411  THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD)
412  eigen_assert(index >= 0 && index < size());
413  return coeffRef(index);
414  }

◆ rows()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::EigenBase< Derived >::rows ( void  )
inline
Returns
the number of rows.
See also
cols(), RowsAtCompileTime

Definition at line 62 of file EigenBase.h.

62 { return derived().rows(); }

◆ size()

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

Definition at line 69 of file EigenBase.h.

69 { return rows() * cols(); }

◆ w()

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

equivalent to operator[](3).

Definition at line 463 of file DenseCoeffsBase.h.

464  {
465  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS);
466  return (*this)[3];
467  }

◆ x()

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

equivalent to operator[](0).

Definition at line 437 of file DenseCoeffsBase.h.

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

◆ y()

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

equivalent to operator[](1).

Definition at line 443 of file DenseCoeffsBase.h.

444  {
445  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS);
446  return (*this)[1];
447  }

◆ z()

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

equivalent to operator[](2).

Definition at line 453 of file DenseCoeffsBase.h.

454  {
455  EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS);
456  return (*this)[2];
457  }

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