aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Flagged.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/Flagged.h')
-rw-r--r--Eigen/src/Core/Flagged.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/Eigen/src/Core/Flagged.h b/Eigen/src/Core/Flagged.h
index 208f51afb..458213ab5 100644
--- a/Eigen/src/Core/Flagged.h
+++ b/Eigen/src/Core/Flagged.h
@@ -55,6 +55,7 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
public:
typedef MatrixBase<Flagged> Base;
+
EIGEN_DENSE_PUBLIC_INTERFACE(Flagged)
typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
@@ -67,19 +68,29 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
inline Index outerStride() const { return m_matrix.outerStride(); }
inline Index innerStride() const { return m_matrix.innerStride(); }
- inline const Scalar coeff(Index row, Index col) const
+ inline CoeffReturnType coeff(Index row, Index col) const
{
return m_matrix.coeff(row, col);
}
- inline Scalar& coeffRef(Index row, Index col)
+ inline CoeffReturnType coeff(Index index) const
+ {
+ return m_matrix.coeff(index);
+ }
+
+ inline const Scalar& coeffRef(Index row, Index col) const
{
return m_matrix.const_cast_derived().coeffRef(row, col);
}
- inline const Scalar coeff(Index index) const
+ inline const Scalar& coeffRef(Index index) const
{
- return m_matrix.coeff(index);
+ return m_matrix.const_cast_derived().coeffRef(index);
+ }
+
+ inline Scalar& coeffRef(Index row, Index col)
+ {
+ return m_matrix.const_cast_derived().coeffRef(row, col);
}
inline Scalar& coeffRef(Index index)