Skip to content
Snippets Groups Projects
Commit 2619e3a8 authored by Oliver Sander's avatar Oliver Sander
Browse files

bugfixes

[[Imported from SVN: r680]]
parent 737aed14
Branches
Tags
No related merge requests found
......@@ -77,8 +77,8 @@ void testMatrix(MatrixType& matrix)
for (; constRowIt!=constRowEndIt; ++constRowIt) {
typename MatrixType::ConstColIterator constColIt = rowIt->begin();
typename MatrixType::ConstColIterator constColEndIt = rowIt->end();
typename MatrixType::ConstColIterator constColIt = constRowIt->begin();
typename MatrixType::ConstColIterator constColEndIt = constRowIt->end();
for (; constColIt!=constColEndIt; ++constColIt)
numEntries++;
......@@ -87,6 +87,8 @@ void testMatrix(MatrixType& matrix)
}
assert (numRows == matrix.N());
// ////////////////////////////////////////////////////////
// Count number of rows, columns, and nonzero entries
// This time we're counting backwards
......@@ -98,12 +100,12 @@ void testMatrix(MatrixType& matrix)
numRows = 0;
numEntries = 0;
for (; rowIt!=rowEndIt; ++rowIt) {
for (; rowIt!=rowEndIt; --rowIt) {
typename MatrixType::ColIterator colIt = rowIt->rbegin();
typename MatrixType::ColIterator colEndIt = rowIt->rend();
for (; colIt!=colEndIt; ++colIt) {
for (; colIt!=colEndIt; --colIt) {
assert(matrix.exists(rowIt.index(), colIt.index()));
numEntries++;
}
......@@ -112,6 +114,8 @@ void testMatrix(MatrixType& matrix)
}
assert (numRows == matrix.N());
// ///////////////////////////////////////////////////////////////
// Count number of rows, columns, and nonzero entries again.
// This time use the const iterators and count backwards.
......@@ -123,18 +127,20 @@ void testMatrix(MatrixType& matrix)
numRows = 0;
numEntries = 0;
for (; constRowIt!=constRowEndIt; ++constRowIt) {
for (; constRowIt!=constRowEndIt; --constRowIt) {
typename MatrixType::ConstColIterator constColIt = rowIt->rbegin();
typename MatrixType::ConstColIterator constColEndIt = rowIt->rend();
typename MatrixType::ConstColIterator constColIt = constRowIt->rbegin();
typename MatrixType::ConstColIterator constColEndIt = constRowIt->rend();
for (; constColIt!=constColEndIt; ++constColIt)
for (; constColIt!=constColEndIt; --constColIt)
numEntries++;
numRows++;
}
assert (numRows == matrix.N());
// ///////////////////////////////////////////////////////
// More dimension stuff
// ///////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment