From 82c5f7335c7bd9327586b39dac3adfe7fcc9efc3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 1 Jan 2023 16:19:12 -0800 Subject: [PATCH] sparse: remove unnecessary casts --- lib/sparse/clustering.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/sparse/clustering.c b/lib/sparse/clustering.c index ae947c481..33435e10b 100644 --- a/lib/sparse/clustering.c +++ b/lib/sparse/clustering.c @@ -42,7 +42,7 @@ static Multilevel_Modularity_Clustering Multilevel_Modularity_Clustering_init(Sp double modularity = 0; int *ia = A->ia, *ja = A->ja; double deg_total = 0; - double *deg, *a = (double*) (A->a); + double *deg, *a = A->a; double *indeg; grid->deg_total = 0.; @@ -97,7 +97,6 @@ static Multilevel_Modularity_Clustering Multilevel_Modularity_Clustering_establi int n = grid->n, level = grid->level, nc = 0; double modularity = 0; int *ia = A->ia, *ja = A->ja; - double *a; double *deg = grid->deg; double *deg_new; int i, j, jj, jc, jmax; @@ -119,7 +118,7 @@ static Multilevel_Modularity_Clustering Multilevel_Modularity_Clustering_establi /* gain in merging node i into cluster j is deg(i,j)/deg_total - 2*deg(i)*deg(j)/deg_total^2 */ - a = (double*) A->a; + double *a = A->a; for (i = 0; i < n; i++){ if (matching[i] != UNMATCHED) continue; /* accumulate connections between i and clusters */ -- 2.40.0