From: Wolfgang Bangerth Date: Wed, 22 Apr 2015 12:12:21 +0000 (-0500) Subject: Avoid using the deprecated row_iterator types of sparsity patterns. Replace them... X-Git-Tag: v8.3.0-rc1~211^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba4f384c0e286dc03a964a4f84d1ef0bd0ebd053;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_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index 247389a796..12113ddeff 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -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 - 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 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(&row), row_length, &row_indices[0]);