From: Wolfgang Bangerth Date: Fri, 7 Apr 2023 19:05:30 +0000 (-0600) Subject: Optimize insertion of elements into a matrix. X-Git-Tag: v9.5.0-rc1~358^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89eb234788d4d35edf249f328ac686d7054a4e45;p=dealii.git Optimize insertion of elements into a matrix. --- diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 3277bf8536..9cf52a12f2 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -1997,7 +1997,8 @@ SparseMatrix::add(const size_type row, col_indices.size(), col_indices.data(), values.data(), - elide_zero_values); + elide_zero_values, + std::is_sorted(col_indices.begin(), col_indices.end())); }