]> 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:21 +0000 (07:12 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Apr 2015 11:42:55 +0000 (06:42 -0500)
source/lac/trilinos_sparsity_pattern.cc

index 247389a79600f23342ea1c8554b080da950989d3..12113ddeff6ddc99e3fe171a7f74acba502474eb 100644 (file)
@@ -558,36 +558,6 @@ namespace TrilinosWrappers
 
 
 
-  namespace internal
-  {
-    namespace
-    {
-      typedef dealii::types::global_dof_index size_type;
-      // distinguish between compressed sparsity types that define row_begin()
-      // and SparsityPattern that uses begin() as iterator type
-      template <typename Sparsity>
-      void copy_row (const Sparsity     &dsp,
-                     const size_type     row,
-                     std::vector<TrilinosWrappers::types::int_type>   &row_indices)
-      {
-        typename Sparsity::row_iterator col_num = dsp.row_begin (row);
-        for (size_type col=0; col_num != dsp.row_end (row); ++col_num, ++col)
-          row_indices[col] = *col_num;
-      }
-
-      void copy_row (const dealii::SparsityPattern &dsp,
-                     const size_type                row,
-                     std::vector<TrilinosWrappers::types::int_type>          &row_indices)
-      {
-        dealii::SparsityPattern::iterator col_num = dsp.begin (row);
-        for (size_type col=0; col_num != dsp.end (row); ++col_num, ++col)
-          row_indices[col] = col_num->column();
-      }
-    }
-  }
-
-
-
   template <typename SparsityType>
   void
   SparsityPattern::reinit (const Epetra_Map   &input_row_map,
@@ -641,7 +611,11 @@ namespace TrilinosWrappers
             continue;
 
           row_indices.resize (row_length, -1);
-          internal::copy_row(sp, row, row_indices);
+          {
+            typename SparsityType::iterator p = sp.begin(row);
+            for (size_type col=0; p != sp.end(row); ++p, ++col)
+              row_indices[col] = p->column();
+          }
           graph->Epetra_CrsGraph::InsertGlobalIndices (row, row_length,
                                                        &row_indices[0]);
         }
@@ -653,7 +627,11 @@ namespace TrilinosWrappers
             continue;
 
           row_indices.resize (row_length, -1);
-          internal::copy_row(sp, row, row_indices);
+          {
+            typename SparsityType::iterator p = sp.begin(row);
+            for (size_type col=0; p != sp.end(row); ++p, ++col)
+              row_indices[col] = p->column();
+          }
           graph->InsertGlobalIndices (1,
                                       reinterpret_cast<TrilinosWrappers::types::int_type *>(&row),
                                       row_length, &row_indices[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.