mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
Add a data() function in Map and Block
This commit is contained in:
parent
ccdcebcf03
commit
48df9ed715
@ -146,8 +146,6 @@ template<typename MatrixType, int BlockRows, int BlockCols, int PacketAccess, in
|
|||||||
inline int rows() const { return m_blockRows.value(); }
|
inline int rows() const { return m_blockRows.value(); }
|
||||||
inline int cols() const { return m_blockCols.value(); }
|
inline int cols() const { return m_blockCols.value(); }
|
||||||
|
|
||||||
inline int stride(void) const { return m_matrix.stride(); }
|
|
||||||
|
|
||||||
inline Scalar& coeffRef(int row, int col)
|
inline Scalar& coeffRef(int row, int col)
|
||||||
{
|
{
|
||||||
return m_matrix.const_cast_derived()
|
return m_matrix.const_cast_derived()
|
||||||
|
@ -63,6 +63,7 @@ template<typename Derived> class MapBase
|
|||||||
inline int cols() const { return m_cols.value(); }
|
inline int cols() const { return m_cols.value(); }
|
||||||
|
|
||||||
inline int stride() const { return derived().stride(); }
|
inline int stride() const { return derived().stride(); }
|
||||||
|
inline const Scalar* data() const { return m_data; }
|
||||||
|
|
||||||
/** \returns an expression equivalent to \c *this but having the \c PacketAccess constant
|
/** \returns an expression equivalent to \c *this but having the \c PacketAccess constant
|
||||||
* set to \c ForceAligned. Must be reimplemented by the derived class. */
|
* set to \c ForceAligned. Must be reimplemented by the derived class. */
|
||||||
@ -149,7 +150,7 @@ template<typename Derived> class MapBase
|
|||||||
|| ( rows > 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows)
|
|| ( rows > 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows)
|
||||||
&& cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)));
|
&& cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
Derived& operator+=(const MatrixBase<OtherDerived>& other)
|
Derived& operator+=(const MatrixBase<OtherDerived>& other)
|
||||||
{ return derived() = forceAligned() + other; }
|
{ return derived() = forceAligned() + other; }
|
||||||
|
Loading…
Reference in New Issue
Block a user