diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-12-05 12:49:30 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-12-05 12:49:30 +0100 |
commit | 80ed5bd90c245655ce0f892f6a679a0278ccbbab (patch) | |
tree | e889cbd54790fc2a72e94a8ee4d5884d2b0cfd28 /Eigen/src/SparseCore/SparseMatrix.h | |
parent | 6ccf97f3e6ce39c210e225ba7aae66da15b71660 (diff) |
Workaround various "returning reference to temporary" warnings.
Diffstat (limited to 'Eigen/src/SparseCore/SparseMatrix.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseMatrix.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 4c79c7dc3..93677c786 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -179,7 +179,7 @@ class SparseMatrix /** \returns the value of the matrix at position \a i, \a j * This function returns Scalar(0) if the element is an explicit \em zero */ - inline const Scalar& coeff(Index row, Index col) const + inline Scalar coeff(Index row, Index col) const { eigen_assert(row>=0 && row<rows() && col>=0 && col<cols()); @@ -1297,7 +1297,7 @@ struct evaluator<SparseMatrix<_Scalar,_Options,_Index> > operator const SparseMatrixType&() const { return *m_matrix; } typedef typename DenseCoeffsBase<SparseMatrixType,ReadOnlyAccessors>::CoeffReturnType CoeffReturnType; - CoeffReturnType coeff(Index row, Index col) const + Scalar coeff(Index row, Index col) const { return m_matrix->coeff(row,col); } Scalar& coeffRef(Index row, Index col) |