From 89eb234788d4d35edf249f328ac686d7054a4e45 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 7 Apr 2023 13:05:30 -0600 Subject: [PATCH] Optimize insertion of elements into a matrix. --- include/deal.II/lac/sparse_matrix.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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())); } -- 2.39.5