]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix with better performance 17747/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Fri, 4 Oct 2024 16:34:01 +0000 (18:34 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Fri, 4 Oct 2024 16:34:01 +0000 (18:34 +0200)
source/lac/sparsity_tools.cc

index d1e0aaa9fa569a028f3e172930e3f028b174e280..83671e16eb81a5e91e885c3ba678c10c2488d2cf 100644 (file)
@@ -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());
             }
         }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.