]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix BlockSparsityPattern::column_number
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Jun 2013 20:04:27 +0000 (20:04 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 16 Jun 2013 20:04:27 +0000 (20:04 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29825 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_sparsity_pattern.h

index ce4208355d514cc2580a207a844caf99dc9dcc85..810d913f192896c06bb922e659db6d6a81f4148b 100644 (file)
@@ -1350,12 +1350,14 @@ BlockCompressedSimpleSparsityPattern::column_number (const size_type row,
   Assert(index<row_length(row), ExcIndexRange(index, 0, row_length(row)));
 
   size_type c = 0;
+  size_type block_columns = 0; //sum of n_cols for all blocks to the left
   for (unsigned int b=0; b<columns; ++b)
     {
       unsigned int rowlen = sub_objects[row_index.first][b]->row_length (row_index.second);
       if (index<c+rowlen)
-        return c+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
+        return block_columns+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
       c += rowlen;
+      block_columns += sub_objects[row_index.first][b]->n_cols();
     }
 
   Assert(false, ExcInternalError());

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.