diff --git a/dune/matrix-vector/singlenonzerocolumnmatrix.hh b/dune/matrix-vector/singlenonzerocolumnmatrix.hh index 7e3ffc366cc7e6ccc420fd59bcef21922bfeb3ed..afe07c8cd0190ab3047852546cbf245859a1289e 100644 --- a/dune/matrix-vector/singlenonzerocolumnmatrix.hh +++ b/dune/matrix-vector/singlenonzerocolumnmatrix.hh @@ -25,23 +25,23 @@ class SingleNonZeroColumnMatrix typedef IndexedSliceIterator<const K*, const K> ConstIterator; typedef ConstIterator const_iterator; - RowProxy(const K* value, size_type nzCol) : + RowProxy(const K& value, size_type nzCol) : value_(value), nzCol_(nzCol) {} ConstIterator begin() const { - return ConstIterator(value_, nzCol_, 0, 1); + return ConstIterator(&value_, nzCol_, 0, 1); } ConstIterator end() const { - return ConstIterator(value_, nzCol_+1, 0, 1); + return ConstIterator(&value_, nzCol_+1, 0, 1); } protected: - const K* value_; + const K& value_; size_type nzCol_; }; @@ -96,7 +96,7 @@ public: const_row_reference operator[] (size_type rowIndex) const { - return const_row_reference(&(static_cast<const K&>(nonZeroColumn_[rowIndex])), columnIndex_); + return const_row_reference(static_cast<const K&>(nonZeroColumn_[rowIndex]), columnIndex_); } size_type nonZeroColumnIndex() const