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

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

index 757cb8847749803653f2bed273e8dd153bad0a37..b1fb3f81c8f4531b000a1726639a97004e8d950d 100644 (file)
@@ -478,7 +478,7 @@ SparseMatrix Import_coord_clusters_from_dot(Agraph_t* g, int maxcluster, int dim
     if (!clust_sym) clust_sym = agattr(g,AGNODE,"cluster","-1");
 
     if (clustering_scheme == CLUSTERING_MQ){
-      mq_clustering(A, maxcluster, use_value,
+      mq_clustering(A, maxcluster,
                    &nc, clusters, &modularity);
     } else if (clustering_scheme == CLUSTERING_MODULARITY){ 
       modularity_clustering(A, FALSE, maxcluster, use_value,
@@ -665,7 +665,7 @@ void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme){
     if (!clust_sym) clust_sym = agattr(g,AGNODE,"cluster","-1");
     
     if (clustering_scheme == CLUSTERING_MQ){
-      mq_clustering(A, maxcluster, use_value,
+      mq_clustering(A, maxcluster,
                    &nc, &clusters, &modularity);
     } else if (clustering_scheme == CLUSTERING_MODULARITY){ 
       modularity_clustering(A, FALSE, maxcluster, use_value,
index 1b1303cac9509683fadaa8514868a4b61ab46086..997df77446de0698a891fe36792c160d7d466277 100644 (file)
@@ -589,7 +589,7 @@ static void hierachical_mq_clustering(SparseMatrix A, int maxcluster,
 
 
 
-void mq_clustering(SparseMatrix A, int maxcluster, int use_value,
+void mq_clustering(SparseMatrix A, int maxcluster,
                           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.
@@ -610,7 +610,7 @@ void mq_clustering(SparseMatrix A, int maxcluster, int use_value,
 
   B = SparseMatrix_remove_diagonal(B);
 
-  if (B->type != MATRIX_TYPE_REAL || !use_value) B = SparseMatrix_set_entries_to_real_one(B);
+  if (B->type != MATRIX_TYPE_REAL) B = SparseMatrix_set_entries_to_real_one(B);
 
   hierachical_mq_clustering(B, maxcluster, nclusters, assignment, mq);
 
index acc30ef574423dd1c6db808d02aa2464ea4eced3..351aab1e230199e93f4aa0531d7fe6920319f977 100644 (file)
@@ -50,13 +50,12 @@ struct Multilevel_MQ_Clustering_struct {
    maxcluster: used to specify the maximum number of cluster desired, e.g., maxcluster=10 means that a maximum of 10 clusters
    .   is desired. this may not always be realized, and modularity quality may be low when this is specified. Default: maxcluster = 0 (no limit)
 
-   use_value: whether to use the entry value, or treat edge weights as 1.
    nclusters: on output the number of clusters
    assignment: dimension n. Node i is assigned to cluster "assignment[i]". 0 <= assignment < nclusters.
    .   If *assignment = NULL on entry, it will be allocated. Otherwise used.
    mq: achieve modularity
 */
-void mq_clustering(SparseMatrix A, int maxcluster, int use_value,
+void mq_clustering(SparseMatrix A, int maxcluster,
                           int *nclusters, int **assignment, double *mq);
 
 #ifdef __cplusplus