From 35bacf7cb864d4cb6d74ec1fa6ed84006b00ddf2 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 27 Jan 2010 07:11:49 -0500 Subject: *forward port fix in MapBase::coeff(int) and coeffRef(int) *forward port expanded map.cpp unit test *fix unused variable warnings --- Eigen/src/Core/MapBase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Eigen/src/Core/MapBase.h') diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 4d5ec1eeb..81feb0b5a 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -88,7 +88,7 @@ template class MapBase inline const Scalar& coeff(int index) const { ei_assert(Derived::IsVectorAtCompileTime || (ei_traits::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 class MapBase inline Scalar& coeffRef(int index) { ei_assert(Derived::IsVectorAtCompileTime || (ei_traits::Flags & LinearAccessBit)); - if ( ((RowsAtCompileTime == 1) == IsRowMajor) ) + if ( ((RowsAtCompileTime == 1) == IsRowMajor) || !int(Derived::IsVectorAtCompileTime) ) return const_cast(m_data)[index]; else return const_cast(m_data)[index*stride()]; -- cgit v1.2.3