Skip to content
Snippets Groups Projects
Commit b6409900 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Speed up MatrixIndestSet::exportIdx()

Before this patch `BCRSMatrix::addindex()` was used on individual
column indices. This is slow because each insertion does a binary
search although the inserted indices are already sorted. Bulk-inserting
whole rows with `setIndices()` improves on this significantly but still
does a non-necessary sort. The latter is avoided by the new
`BCRSMatrix::setIndicesNoSort()` method.
parent e0622c3b
Branches
Tags
1 merge request!550Add BCRSMatrix::setIndicesNoSort() and speedup MatrixIndexSet::exportIdx()
......@@ -193,8 +193,7 @@ namespace Dune {
for (size_type row=0; row<rows_; row++) {
std::visit([&](const auto& rowIndices) {
for(size_type col : rowIndices)
matrix.addindex(row, col);
matrix.setIndicesNoSort(row, rowIndices.begin(), rowIndices.end());
}, indices_[row]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment