mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
*forward port fix in MapBase::coeff(int) and coeffRef(int)
*forward port expanded map.cpp unit test *fix unused variable warnings
This commit is contained in:
@@ -382,7 +382,7 @@ template <bool IsAligned = false>
|
||||
struct ei_unaligned_assign_impl
|
||||
{
|
||||
template <typename Derived, typename OtherDerived>
|
||||
static EIGEN_STRONG_INLINE void run(const Derived& src, OtherDerived& dst, int start, int end) {}
|
||||
static EIGEN_STRONG_INLINE void run(const Derived&, OtherDerived&, int, int) {}
|
||||
};
|
||||
|
||||
template <>
|
||||
|
||||
@@ -88,7 +88,7 @@ template<typename Derived, typename Base> class MapBase
|
||||
inline const Scalar& coeff(int index) const
|
||||
{
|
||||
ei_assert(Derived::IsVectorAtCompileTime || (ei_traits<Derived>::Flags & LinearAccessBit));
|
||||
if ( ((RowsAtCompileTime == 1) == IsRowMajor) )
|
||||
if ( ((RowsAtCompileTime == 1) == IsRowMajor) || !int(Derived::IsVectorAtCompileTime) )
|
||||
return m_data[index];
|
||||
else
|
||||
return m_data[index*stride()];
|
||||
@@ -97,7 +97,7 @@ template<typename Derived, typename Base> class MapBase
|
||||
inline Scalar& coeffRef(int index)
|
||||
{
|
||||
ei_assert(Derived::IsVectorAtCompileTime || (ei_traits<Derived>::Flags & LinearAccessBit));
|
||||
if ( ((RowsAtCompileTime == 1) == IsRowMajor) )
|
||||
if ( ((RowsAtCompileTime == 1) == IsRowMajor) || !int(Derived::IsVectorAtCompileTime) )
|
||||
return const_cast<Scalar*>(m_data)[index];
|
||||
else
|
||||
return const_cast<Scalar*>(m_data)[index*stride()];
|
||||
|
||||
Reference in New Issue
Block a user