aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/SelfCwiseBinaryOp.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-12-22 17:45:37 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-12-22 17:45:37 -0500
commit75b7d98665dd144c44d7a113c6613f5f998be626 (patch)
treebc75d316e2ed8e679e744bc34f159dcb0f285243 /Eigen/src/Core/SelfCwiseBinaryOp.h
parent3b6d97b51a7e7a4b0c69ae6be44b1c16d72c2e80 (diff)
bug #54 - really fix const correctness except in Sparse
Diffstat (limited to 'Eigen/src/Core/SelfCwiseBinaryOp.h')
-rw-r--r--Eigen/src/Core/SelfCwiseBinaryOp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h
index 213983588..4e9ca8874 100644
--- a/Eigen/src/Core/SelfCwiseBinaryOp.h
+++ b/Eigen/src/Core/SelfCwiseBinaryOp.h
@@ -77,13 +77,23 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp
// TODO make Assign use .data()
inline Scalar& coeffRef(Index row, Index col)
{
+ EIGEN_STATIC_ASSERT_LVALUE(Lhs)
return m_matrix.const_cast_derived().coeffRef(row, col);
}
+ inline const Scalar& coeffRef(Index row, Index col) const
+ {
+ return m_matrix.coeffRef(row, col);
+ }
// note that this function is needed by assign to correctly align loads/stores
// TODO make Assign use .data()
inline Scalar& coeffRef(Index index)
{
+ EIGEN_STATIC_ASSERT_LVALUE(Lhs)
+ return m_matrix.const_cast_derived().coeffRef(index);
+ }
+ inline const Scalar& coeffRef(Index index) const
+ {
return m_matrix.const_cast_derived().coeffRef(index);
}