mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-16 13:45:58 +08:00
backporting rev925153 (bugfix in MapBase::coeffRef(int) )
This commit is contained in:
parent
b064b5e68e
commit
95e4508b04
@ -96,7 +96,11 @@ template<typename Derived> class MapBase
|
|||||||
|
|
||||||
inline Scalar& coeffRef(int index)
|
inline Scalar& coeffRef(int index)
|
||||||
{
|
{
|
||||||
return *const_cast<Scalar*>(m_data + index);
|
ei_assert(Derived::IsVectorAtCompileTime || (ei_traits<Derived>::Flags & LinearAccessBit));
|
||||||
|
if ( ((RowsAtCompileTime == 1) == IsRowMajor) )
|
||||||
|
return const_cast<Scalar*>(m_data)[index];
|
||||||
|
else
|
||||||
|
return const_cast<Scalar*>(m_data)[index*stride()];
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int LoadMode>
|
template<int LoadMode>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user