From: Matthew Fernandez Date: Mon, 2 Jan 2023 00:25:16 +0000 (-0800) Subject: sparse modularity_clustering: remove 'flag' parameter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7153953bbbe009ca5f28d3bf07a09047ffe642c;p=graphviz sparse modularity_clustering: remove 'flag' parameter This is always set to 0. --- diff --git a/lib/mingle/edge_bundling.cpp b/lib/mingle/edge_bundling.cpp index 19cf62aa7..1003d1105 100644 --- a/lib/mingle/edge_bundling.cpp +++ b/lib/mingle/edge_bundling.cpp @@ -490,7 +490,7 @@ static pedge* force_directed_edge_bundling(SparseMatrix A, pedge* edges, int max } static pedge* modularity_ink_bundling(int dim, int ne, SparseMatrix B, pedge* edges, double angle_param, double angle){ - int *assignment = NULL, flag, nclusters; + int *assignment = NULL, nclusters; double modularity; int *clusterp, *clusters; SparseMatrix D, C; @@ -505,10 +505,9 @@ static pedge* modularity_ink_bundling(int dim, int ne, SparseMatrix B, pedge* ed /* B may contain negative entries */ BB = SparseMatrix_copy(B); BB = SparseMatrix_apply_fun(BB, fabs); - modularity_clustering(BB, TRUE, 0, use_value_for_clustering, &nclusters, &assignment, &modularity, &flag); + modularity_clustering(BB, TRUE, 0, use_value_for_clustering, &nclusters, &assignment, &modularity); SparseMatrix_delete(BB); - assert(!flag); if (Verbose > 1) fprintf(stderr, "there are %d clusters, modularity = %f\n",nclusters, modularity); C = SparseMatrix_new(1, 1, 1, MATRIX_TYPE_PATTERN, FORMAT_COORD); diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 17f58f6df..483d57cbd 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -482,7 +482,7 @@ SparseMatrix Import_coord_clusters_from_dot(Agraph_t* g, int maxcluster, int dim &nc, clusters, &modularity, &flag); } else if (clustering_scheme == CLUSTERING_MODULARITY){ modularity_clustering(A, FALSE, maxcluster, use_value, - &nc, clusters, &modularity, &flag); + &nc, clusters, &modularity); } else { assert(0); } @@ -669,7 +669,7 @@ void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme){ &nc, &clusters, &modularity, &flag); } else if (clustering_scheme == CLUSTERING_MODULARITY){ modularity_clustering(A, FALSE, maxcluster, use_value, - &nc, &clusters, &modularity, &flag); + &nc, &clusters, &modularity); } else { assert(0); } diff --git a/lib/sparse/clustering.c b/lib/sparse/clustering.c index 75b66d2fc..ab9b2472f 100644 --- a/lib/sparse/clustering.c +++ b/lib/sparse/clustering.c @@ -347,7 +347,7 @@ static void hierachical_modularity_clustering(SparseMatrix A, int ncluster_targe void modularity_clustering(SparseMatrix A, int inplace, int ncluster_target, int use_value, - int *nclusters, int **assignment, double *modularity, int *flag){ + int *nclusters, int **assignment, double *modularity){ /* find a clustering of vertices by maximize modularity A: symmetric square matrix n x n. If real value, value will be used as edges weights, otherwise edge weights are considered as 1. inplace: whether A can e modified. If true, A will be modified by removing diagonal. @@ -363,8 +363,6 @@ void modularity_clustering(SparseMatrix A, int inplace, int ncluster_target, int */ SparseMatrix B; - *flag = 0; - assert(A->m == A->n); B = SparseMatrix_symmetrize(A, false); diff --git a/lib/sparse/clustering.h b/lib/sparse/clustering.h index 1606cb047..13e6b28e7 100644 --- a/lib/sparse/clustering.h +++ b/lib/sparse/clustering.h @@ -52,7 +52,7 @@ enum {CLUSTERING_MODULARITY = 0, CLUSTERING_MQ}; modularity: achieve modularity */ void modularity_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value, - int *nclusters, int **assignment, double *modularity, int *flag); + int *nclusters, int **assignment, double *modularity); #ifdef __cplusplus }