Skip to content
Snippets Groups Projects
Commit 2301ac4b authored by Max Kahnt's avatar Max Kahnt
Browse files

Pass const reference instead of const pointers.

parent f5b98a99
Branches
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment