diff options
author | 2009-04-01 00:39:56 +0000 | |
---|---|---|
committer | 2009-04-01 00:39:56 +0000 | |
commit | 113fc3a2606997533287921ccec49e320bf9f79b (patch) | |
tree | 8b957dca70499806ee0ed756d3a817a3db0b0604 /Eigen/src/Core/MapBase.h | |
parent | 2f45eeb0c6cfb607767886d295e1de3e59c958fb (diff) |
now if Derived has the DirectAccess flag, then MatrixBase<Derived>::coeff() const returns a const Scalar& and not a Scalar as before.
useful for people doing direct access. + 1 bugfix thanks to Patrick Mihelich, forgot a & in MapBase::coeff(int).
Diffstat (limited to 'Eigen/src/Core/MapBase.h')
-rw-r--r-- | Eigen/src/Core/MapBase.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index ed3d2cbf8..bc666878a 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -96,7 +96,7 @@ template<typename Derived> class MapBase return const_cast<Scalar*>(m_data)[row + col * stride()]; } - inline const Scalar coeff(int index) const + inline const Scalar& coeff(int index) const { ei_assert(Derived::IsVectorAtCompileTime || (ei_traits<Derived>::Flags & LinearAccessBit)); if ( ((RowsAtCompileTime == 1) == IsRowMajor) ) |