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

Base class for non-const dense Map and Block expression with direct access. More...

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

Public Types

typedef MapBase< Derived, ReadOnlyAccessorsBase
 
typedef Base::PacketScalar PacketScalar
 
typedef Base::PointerType PointerType
 
typedef Base::Scalar Scalar
 
typedef std::conditional_t< internal::is_lvalue< Derived >::value, Scalar, const ScalarScalarWithConstIfNotLvalue
 
typedef Base::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::MapBase< Derived, ReadOnlyAccessors >
enum  {
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  InnerStrideAtCompileTime ,
  SizeAtCompileTime
}
 
typedef internal::dense_xpr_base< Derived >::type Base
 
typedef Base::CoeffReturnType CoeffReturnType
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef std::conditional_t< bool(internal::is_lvalue< Derived >::value), Scalar *, const Scalar * > PointerType
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

ScalarWithConstIfNotLvaluecoeffRef (Index index)
 
ScalarWithConstIfNotLvaluecoeffRef (Index row, Index col)
 
ScalarWithConstIfNotLvaluedata ()
 
const Scalardata () const
 
 MapBase (PointerType dataPtr)
 
 MapBase (PointerType dataPtr, Index rows, Index cols)
 
 MapBase (PointerType dataPtr, Index vecSize)
 
Derived & operator= (const MapBase &other)
 
template<int StoreMode>
void writePacket (Index index, const PacketScalar &val)
 
template<int StoreMode>
void writePacket (Index row, Index col, const PacketScalar &val)
 
- Public Member Functions inherited from Eigen::MapBase< Derived, ReadOnlyAccessors >
const Scalarcoeff (Index index) const
 
const Scalarcoeff (Index rowId, Index colId) const
 
const ScalarcoeffRef (Index index) const
 
const ScalarcoeffRef (Index rowId, Index colId) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
const Scalardata () const
 
 MapBase (PointerType dataPtr)
 
 MapBase (PointerType dataPtr, Index rows, Index cols)
 
 MapBase (PointerType dataPtr, Index vecSize)
 
template<int LoadMode>
PacketScalar packet (Index index) const
 
template<int LoadMode>
PacketScalar packet (Index rowId, Index colId) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 

Private Types

typedef MapBase< Derived, ReadOnlyAccessorsReadOnlyMapBase
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::MapBase< Derived, ReadOnlyAccessors >
template<typename T >
void checkSanity (std::enable_if_t< internal::traits< T >::Alignment==0, void * >=0) const
 
template<typename T >
void checkSanity (std::enable_if_t<(internal::traits< T >::Alignment >0), void * >=0) const
 
- Protected Attributes inherited from Eigen::MapBase< Derived, ReadOnlyAccessors >
const internal::variable_if_dynamic< Index, ColsAtCompileTimem_cols
 
PointerType m_data
 
const internal::variable_if_dynamic< Index, RowsAtCompileTimem_rows
 

Detailed Description

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

Base class for non-const dense Map and Block expression with direct access.

This base class provides the non-const low-level accessors (e.g. coeff and coeffRef) of dense Map and Block objects with direct access. It inherits MapBase<Derived, ReadOnlyAccessors> which defines the const variant for reading specific entries.

See also
class Map, class Block

Definition at line 225 of file MapBase.h.

Member Typedef Documentation

◆ Base

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

Definition at line 231 of file MapBase.h.

◆ PacketScalar

template<typename Derived >
typedef Base::PacketScalar Eigen::MapBase< Derived, WriteAccessors >::PacketScalar

Definition at line 234 of file MapBase.h.

◆ PointerType

template<typename Derived >
typedef Base::PointerType Eigen::MapBase< Derived, WriteAccessors >::PointerType

Definition at line 236 of file MapBase.h.

◆ ReadOnlyMapBase

template<typename Derived >
typedef MapBase<Derived, ReadOnlyAccessors> Eigen::MapBase< Derived, WriteAccessors >::ReadOnlyMapBase
private

Definition at line 228 of file MapBase.h.

◆ Scalar

template<typename Derived >
typedef Base::Scalar Eigen::MapBase< Derived, WriteAccessors >::Scalar

Definition at line 233 of file MapBase.h.

◆ ScalarWithConstIfNotLvalue

template<typename Derived >
typedef std::conditional_t< internal::is_lvalue<Derived>::value, Scalar, const Scalar > Eigen::MapBase< Derived, WriteAccessors >::ScalarWithConstIfNotLvalue

Definition at line 254 of file MapBase.h.

◆ StorageIndex

template<typename Derived >
typedef Base::StorageIndex Eigen::MapBase< Derived, WriteAccessors >::StorageIndex

Definition at line 235 of file MapBase.h.

Constructor & Destructor Documentation

◆ MapBase() [1/3]

template<typename Derived >
Eigen::MapBase< Derived, WriteAccessors >::MapBase ( PointerType  dataPtr)
inlineexplicit

Definition at line 289 of file MapBase.h.

289 : Base(dataPtr) {}
MapBase< Derived, ReadOnlyAccessors > Base
Definition: MapBase.h:231

◆ MapBase() [2/3]

template<typename Derived >
Eigen::MapBase< Derived, WriteAccessors >::MapBase ( PointerType  dataPtr,
Index  vecSize 
)
inline

Definition at line 290 of file MapBase.h.

290 : Base(dataPtr, vecSize) {}

◆ MapBase() [3/3]

template<typename Derived >
Eigen::MapBase< Derived, WriteAccessors >::MapBase ( PointerType  dataPtr,
Index  rows,
Index  cols 
)
inline

Definition at line 291 of file MapBase.h.

291 : Base(dataPtr, rows, cols) {}
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: MapBase.h:93
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: MapBase.h:96

Member Function Documentation

◆ coeffRef() [1/2]

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

Definition at line 268 of file MapBase.h.

269  {
271  return this->m_data[index * innerStride()];
272  }
#define EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived)
Definition: MapBase.h:14

◆ coeffRef() [2/2]

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

Definition at line 262 of file MapBase.h.

263  {
264  return this->m_data[col * colStride() + row * rowStride()];
265  }
RowXpr row(Index i)
This is the const version of row(). *‍/.
ColXpr col(Index i)
This is the const version of col().

◆ data() [1/2]

template<typename Derived >
ScalarWithConstIfNotLvalue* Eigen::MapBase< Derived, WriteAccessors >::data ( )
inline

Definition at line 259 of file MapBase.h.

259 { return this->m_data; } // no const-cast here so non-const-correct code will give a compile error

◆ data() [2/2]

template<typename Derived >
const Scalar* Eigen::MapBase< Derived, WriteAccessors >::data ( ) const
inline

Definition at line 257 of file MapBase.h.

257 { return this->m_data; }

◆ operator=()

template<typename Derived >
Derived& Eigen::MapBase< Derived, WriteAccessors >::operator= ( const MapBase< Derived, WriteAccessors > &  other)
inline

Definition at line 294 of file MapBase.h.

295  {
296  ReadOnlyMapBase::Base::operator=(other);
297  return derived();
298  }

◆ writePacket() [1/2]

template<typename Derived >
template<int StoreMode>
void Eigen::MapBase< Derived, WriteAccessors >::writePacket ( Index  index,
const PacketScalar val 
)
inline

Definition at line 282 of file MapBase.h.

283  {
285  internal::pstoret<Scalar, PacketScalar, StoreMode>
286  (this->m_data + index * innerStride(), val);
287  }

◆ writePacket() [2/2]

template<typename Derived >
template<int StoreMode>
void Eigen::MapBase< Derived, WriteAccessors >::writePacket ( Index  row,
Index  col,
const PacketScalar val 
)
inline

Definition at line 275 of file MapBase.h.

276  {
277  internal::pstoret<Scalar, PacketScalar, StoreMode>
278  (this->m_data + (col * colStride() + row * rowStride()), val);
279  }

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