aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2011-01-04 15:35:50 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2011-01-04 15:35:50 +0100
commit4ba0ec5e0e82e970c4918ba13f5d2090f9a32f4a (patch)
treee24ad1d4f34acf8d3fb3138a9f73833c746fa567
parentd7e1eeaece4e872c804eb594539ae536c8187372 (diff)
Fixed #148 where a const-accessor for coefficients was missing in the MatrixWrapper.
-rw-r--r--Eigen/src/Core/ArrayWrapper.h5
-rw-r--r--Eigen/src/Core/Block.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/Eigen/src/Core/ArrayWrapper.h b/Eigen/src/Core/ArrayWrapper.h
index d5b8c6804..f6b7f90a4 100644
--- a/Eigen/src/Core/ArrayWrapper.h
+++ b/Eigen/src/Core/ArrayWrapper.h
@@ -160,6 +160,11 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
return m_expression.const_cast_derived().coeffRef(row, col);
}
+ inline const Scalar& coeffRef(Index row, Index col) const
+ {
+ return m_expression.derived().coeffRef(row, col);
+ }
+
inline const CoeffReturnType coeff(Index index) const
{
return m_expression.coeff(index);
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index 00d5d8b4e..de384b025 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -174,7 +174,7 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool H
inline const Scalar& coeffRef(Index row, Index col) const
{
- return m_xpr.const_cast_derived()
+ return m_xpr.derived()
.coeffRef(row + m_startRow.value(), col + m_startCol.value());
}