From 1876db12716de09472ecfd646277d2b895ca4b71 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 22 Jun 2021 17:44:47 -0700 Subject: [PATCH] remove unnecessary do_swapping parameter to country_graph_coloring_internal This function is only ever called with do_swapping == DO_SWAPPING. --- cmd/gvmap/country_graph_coloring.c | 14 +++----------- cmd/gvmap/country_graph_coloring.h | 2 -- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/cmd/gvmap/country_graph_coloring.c b/cmd/gvmap/country_graph_coloring.c index b6b798fcc..e7e6e895b 100644 --- a/cmd/gvmap/country_graph_coloring.c +++ b/cmd/gvmap/country_graph_coloring.c @@ -271,7 +271,7 @@ void improve_antibandwidth_by_swapping(SparseMatrix A, int *p){ } } -static void country_graph_coloring_internal(int seed, SparseMatrix A, int **p, real *norm_1, int do_swapping){ +static void country_graph_coloring_internal(int seed, SparseMatrix A, int **p, real *norm_1){ int n = A->m, i, j, jj; SparseMatrix L, A2; int *ia = A->ia, *ja = A->ja; @@ -317,15 +317,7 @@ static void country_graph_coloring_internal(int seed, SparseMatrix A, int **p, r start2 = clock(); /* swapping */ - if (do_swapping) { - if (do_swapping == DO_SWAPPING){ - improve_antibandwidth_by_swapping(A2, *p); - } else if (do_swapping == DO_SWAPPING_CHEAP) { - improve_antibandwidth_by_swapping_cheap(A2, *p); - } else { - assert(0); - } - } + improve_antibandwidth_by_swapping(A2, *p); if (Verbose) { fprintf(stderr, "cpu time for greedy refinement = %f\n", ((double)(clock() - start2)) / CLOCKS_PER_SEC); @@ -341,5 +333,5 @@ static void country_graph_coloring_internal(int seed, SparseMatrix A, int **p, r SparseMatrix_delete(L); } void country_graph_coloring(int seed, SparseMatrix A, int **p, real *norm_1){ - country_graph_coloring_internal(seed, A, p, norm_1, DO_SWAPPING); + country_graph_coloring_internal(seed, A, p, norm_1); } diff --git a/cmd/gvmap/country_graph_coloring.h b/cmd/gvmap/country_graph_coloring.h index 578b43955..9d8a0d476 100644 --- a/cmd/gvmap/country_graph_coloring.h +++ b/cmd/gvmap/country_graph_coloring.h @@ -13,8 +13,6 @@ #include -enum {DO_SWAPPING = 1, DO_SWAPPING_CHEAP}; - void country_graph_coloring(int seed, SparseMatrix A, int **p, real *norm_1); void improve_antibandwidth_by_swapping(SparseMatrix A, int *p); -- 2.40.0