From: Martin Kronbichler Date: Fri, 4 Oct 2024 16:34:01 +0000 (+0200) Subject: Fix with better performance X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17747%2Fhead;p=dealii.git Fix with better performance --- diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index d1e0aaa9fa..83671e16eb 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -824,7 +824,9 @@ namespace SparsityTools ++write_index; if (n_remaining_neighbors[node] < candidate_valence || (n_remaining_neighbors[node] == candidate_valence && - row_lengths[node] > candidate_row_length)) + (row_lengths[node] > candidate_row_length || + (row_lengths[node] == candidate_row_length && + node < candidate_index)))) { candidate_index = node; candidate_valence = n_remaining_neighbors[node]; @@ -878,7 +880,6 @@ namespace SparsityTools n_remaining_neighbors[it->column()]--; } } - std::sort(current_neighbors.begin(), current_neighbors.end()); } }