]> granicus.if.org Git - graphviz/commitdiff
sparse: remove unnecessary casts
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 2 Jan 2023 00:19:12 +0000 (16:19 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 3 Jan 2023 02:57:45 +0000 (18:57 -0800)
lib/sparse/clustering.c

index ae947c4810647641beafb077b827553ac1f4cbea..33435e10ba5544004d1ca7f1b50c78f4782623a4 100644 (file)
@@ -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 */