From: Matthew Fernandez Date: Mon, 2 Jan 2023 00:30:59 +0000 (-0800) Subject: sparse mq_clustering: remove 'flag' parameter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b271ef1a8147a0e23207dc6ffd2e4587c82811f0;p=graphviz sparse mq_clustering: remove 'flag' parameter This is always set to 0. --- diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 483d57cbd..dc02da4d0 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -473,13 +473,13 @@ SparseMatrix Import_coord_clusters_from_dot(Agraph_t* g, int maxcluster, int dim MAX_GRPS = nc; if (noclusterinfo) { - int use_value = TRUE, flag = 0; + int use_value = TRUE; double modularity; if (!clust_sym) clust_sym = agattr(g,AGNODE,"cluster","-1"); if (clustering_scheme == CLUSTERING_MQ){ mq_clustering(A, FALSE, maxcluster, use_value, - &nc, clusters, &modularity, &flag); + &nc, clusters, &modularity); } else if (clustering_scheme == CLUSTERING_MODULARITY){ modularity_clustering(A, FALSE, maxcluster, use_value, &nc, clusters, &modularity); @@ -660,13 +660,13 @@ void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme){ clusters = MALLOC(sizeof(int)*nnodes); { - int use_value = TRUE, flag = 0; + int use_value = TRUE; double modularity; if (!clust_sym) clust_sym = agattr(g,AGNODE,"cluster","-1"); if (clustering_scheme == CLUSTERING_MQ){ mq_clustering(A, FALSE, maxcluster, use_value, - &nc, &clusters, &modularity, &flag); + &nc, &clusters, &modularity); } else if (clustering_scheme == CLUSTERING_MODULARITY){ modularity_clustering(A, FALSE, maxcluster, use_value, &nc, &clusters, &modularity); diff --git a/lib/sparse/mq.c b/lib/sparse/mq.c index 475d81ced..b27326712 100644 --- a/lib/sparse/mq.c +++ b/lib/sparse/mq.c @@ -590,7 +590,7 @@ static void hierachical_mq_clustering(SparseMatrix A, int maxcluster, void mq_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value, - int *nclusters, int **assignment, double *mq, int *flag){ + int *nclusters, int **assignment, double *mq){ /* find a clustering of vertices by maximize mq 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. @@ -601,8 +601,6 @@ void mq_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value, */ SparseMatrix B; - *flag = 0; - assert(A->m == A->n); B = SparseMatrix_symmetrize(A, false); diff --git a/lib/sparse/mq.h b/lib/sparse/mq.h index fb57eec34..da68d05bb 100644 --- a/lib/sparse/mq.h +++ b/lib/sparse/mq.h @@ -58,7 +58,7 @@ struct Multilevel_MQ_Clustering_struct { mq: achieve modularity */ void mq_clustering(SparseMatrix A, int inplace, int maxcluster, int use_value, - int *nclusters, int **assignment, double *mq, int *flag); + int *nclusters, int **assignment, double *mq); #ifdef __cplusplus }