diff options
author | 2010-01-27 07:11:49 -0500 | |
---|---|---|
committer | 2010-01-27 07:11:49 -0500 | |
commit | 35bacf7cb864d4cb6d74ec1fa6ed84006b00ddf2 (patch) | |
tree | 3b6ddd2e8f1b489787c33297193ea4062926fa78 /Eigen/src/Core/MapBase.h | |
parent | 7ba9dc07edb356d1a7d81bf4ef62378099a509ca (diff) |
*forward port fix in MapBase::coeff(int) and coeffRef(int)
*forward port expanded map.cpp unit test
*fix unused variable warnings
Diffstat (limited to 'Eigen/src/Core/MapBase.h')
-rw-r--r-- | Eigen/src/Core/MapBase.h | 4 |
1 files changed, 2 insertions, 2 deletions
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<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()]; |