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

index 4d929a227372c77232dc98a9ba2963ce481bd568..629d2801ab733a7f967d20385bc3532d2f9ee343 100644 (file)
@@ -477,35 +477,6 @@ namespace TrilinosWrappers
 
 
 
-  namespace internal
-  {
-    namespace
-    {
-      // 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
   SparseMatrix::reinit (const Epetra_Map    &input_row_map,
@@ -585,7 +556,11 @@ namespace TrilinosWrappers
           continue;
 
         row_indices.resize (row_length, -1);
-        internal::copy_row(sparsity_pattern, row, row_indices);
+        {
+          typename SparsityType::iterator p = sparsity_pattern.begin(row);
+          for (size_type col=0; p != sparsity_pattern.end(row); ++p, ++col)
+            row_indices[col] = p->column();
+        }
         graph->Epetra_CrsGraph::InsertGlobalIndices (row, row_length,
                                                      &row_indices[0]);
       }
@@ -718,7 +693,11 @@ namespace TrilinosWrappers
           continue;
 
         row_indices.resize (row_length, -1);
-        internal::copy_row(sparsity_pattern, global_row, row_indices);
+        {
+          typename dealii::DynamicSparsityPattern::iterator p = sparsity_pattern.begin(global_row);
+          for (size_type col=0; p != sparsity_pattern.end(global_row); ++p, ++col)
+            row_indices[col] = p->column();
+        }
 
         if (input_row_map.MyGID(global_row))
           graph->InsertGlobalIndices (global_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.