- 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,
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]);
}
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]);