aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MapBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-27 07:11:49 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-27 07:11:49 -0500
commit35bacf7cb864d4cb6d74ec1fa6ed84006b00ddf2 (patch)
tree3b6ddd2e8f1b489787c33297193ea4062926fa78 /Eigen/src/Core/MapBase.h
parent7ba9dc07edb356d1a7d81bf4ef62378099a509ca (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.h4
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()];