]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Now really fix collective adding.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Sep 2010 16:07:40 +0000 (16:07 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Sep 2010 16:07:40 +0000 (16:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@21892 0785d39b-7218-0410-832d-ea1e28bc413d

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

index fa50806a8780b10d85d65e67f44fa8a3911c5836..c639ba0a78130d72419e99fe105d3671d0aac6b0 100644 (file)
@@ -415,7 +415,7 @@ SparseMatrix<number>::add (const unsigned int  row,
 
       const unsigned int * this_cols =
        &cols->get_column_numbers()[cols->get_rowstart_indices()[row]];
-      const unsigned int row_length = cols->row_length(row);
+      const unsigned int row_length_1 = cols->row_length(row)-1;
       number * val_ptr = &val[cols->get_rowstart_indices()[row]];
 
       if (cols->optimize_diagonal() == true)
@@ -439,8 +439,7 @@ SparseMatrix<number>::add (const unsigned int  row,
          unsigned int counter = 1;
          for (unsigned int i=0; i<diag; ++i)
            {
-             while (this_cols[counter] < col_indices[i] &&
-                    this_cols[counter] < row_length)
+             while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                ++counter;
 
              Assert (this_cols[counter] == col_indices[i] || values[i] == 0,
@@ -452,8 +451,7 @@ SparseMatrix<number>::add (const unsigned int  row,
                                   // add indices after diagonal
          for (unsigned int i=post_diag; i<n_cols; ++i)
            {
-             while (this_cols[counter] < col_indices[i] &&
-                    this_cols[counter] < row_length)
+             while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                ++counter;
 
              Assert (this_cols[counter] == col_indices[i] || values[i] == 0,
@@ -470,8 +468,7 @@ SparseMatrix<number>::add (const unsigned int  row,
          unsigned int counter = 0;
          for (unsigned int i=0; i<n_cols; ++i)
            {
-             while (this_cols[counter] < col_indices[i] &&
-                    this_cols[counter] < row_length)
+             while (this_cols[counter]<col_indices[i] && counter<row_length_1)
                ++counter;
 
              Assert (this_cols[counter] == col_indices[i] || values[i] == 0,

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.