]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix previous fix (make the condition more accurate).
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Jul 2008 22:34:40 +0000 (22:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Jul 2008 22:34:40 +0000 (22:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@16459 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/sparsity_pattern.cc

index 25b55c0ec602e28c517cf546c3c7ca91be928cf3..20a00b5356bfb703675ec9f00decb1cb0b0590b1 100644 (file)
@@ -657,7 +657,7 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix,
                                   // per row. if optimize_diag is set then we
                                   // also have to allocate memory for the
                                   // diagonal entry, unless we have already
-                                  // counted it
+                                  // counted it or the matrix isn't square
   std::vector<unsigned int> entries_per_row (matrix.m(), 0);
   for (unsigned int row=0; row<matrix.m(); ++row)
     {
@@ -666,7 +666,9 @@ void SparsityPattern::copy_from (const FullMatrix<number> &matrix,
          ++entries_per_row[row];
       if ((optimize_diag == true)
          &&
-         (matrix(row,row) == 0))
+         (matrix(row,row) == 0)
+         &&
+         (matrix.m() == matrix.n()))
        ++entries_per_row[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.