]> granicus.if.org Git - graphviz/commitdiff
sparse mq_clustering: remove 'flag' parameter
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 2 Jan 2023 00:30:59 +0000 (16:30 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 3 Jan 2023 02:57:45 +0000 (18:57 -0800)
This is always set to 0.

lib/sparse/DotIO.c
lib/sparse/mq.c
lib/sparse/mq.h

index 483d57cbd379097ba360926e9440239e6331743e..dc02da4d08ff6053b3e9f80991ff49f88fbd1144 100644 (file)
@@ -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);
index 475d81ced676b927e45a290d6cc629c6669552c0..b27326712a62cd2767a7db86155bff082a905dfd 100644 (file)
@@ -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);
index fb57eec34704f523f65d479cd53c5c0c6f66a481..da68d05bb56e89e035b98ca55e1e2328c9ec4a5e 100644 (file)
@@ -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
 }