]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid using the deprecated row_iterator types of sparsity patterns. Replace them...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 22 Apr 2015 12:12:19 +0000 (07:12 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Apr 2015 11:42:54 +0000 (06:42 -0500)
source/lac/chunk_sparsity_pattern.cc

index 0db23e750414837bdd387a285011a75f23c7f362..2d61672c55e3fff78e1426300966c5565d90906b 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2008 - 2014 by the deal.II authors
+// Copyright (C) 2008 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -203,10 +203,14 @@ ChunkSparsityPattern::copy_from (const SparsityType &dsp,
 
   for (size_type row = 0; row<dsp.n_rows(); ++row)
     {
-      typename SparsityType::row_iterator col_num = dsp.row_begin (row);
       const size_type reduced_row = row/chunk_size;
-      for (; col_num != dsp.row_end (row); ++col_num)
-        temporary_sp.add (reduced_row, *col_num/chunk_size);
+
+      // TODO: This could be made more efficient if we cached the
+      // previous column and only called add() if the previous and the
+      // current column lead to different chunk columns
+      for (typename SparsityType::iterator col_num = dsp.begin(row);
+           col_num != dsp.end(row); ++col_num)
+        temporary_sp.add (reduced_row, col_num->column()/chunk_size);
     }
 
   sparsity_pattern.copy_from (temporary_sp);

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.