]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a recently introduced bug where we started counting from too high.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Jan 2010 23:43:31 +0000 (23:43 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Jan 2010 23:43:31 +0000 (23:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@20428 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_matrix.templates.h

index da1d17fae776a9ab5dd97f4297ec2551b11f76d2..204443ee5cc1f75f48cca17458e1f47843f48faa 100644 (file)
@@ -1509,7 +1509,8 @@ SparseMatrix<number>::TSOR (Vector<somenumber>& dst,
 
   Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
 
-  for (unsigned int row=m(); row!=0; --row)
+  unsigned int row=m()-1;
+  while (true)
     {
       somenumber s = dst(row);
       for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
@@ -1517,6 +1518,11 @@ SparseMatrix<number>::TSOR (Vector<somenumber>& dst,
          s -= val[j] * dst(cols->colnums[j]);
 
       dst(row) = s * om / val[cols->rowstart[row]];
+
+      if (row == 0)
+       break;
+
+      --row;
     }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.