From: Wolfgang Bangerth Date: Wed, 22 Apr 2015 12:12:20 +0000 (-0500) Subject: Avoid using the deprecated row_iterator types of sparsity patterns. Replace them... X-Git-Tag: v8.3.0-rc1~211^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55e0b12eb5a82b0da67277ff31b8e29ab6c6e2a7;p=dealii.git Avoid using the deprecated row_iterator types of sparsity patterns. Replace them with uses of regular iterators. --- diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 4d929a2273..629d2801ab 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -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 - void copy_row (const Sparsity &dsp, - const size_type row, - std::vector &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 &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 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]);