From: Matthew Fernandez Date: Mon, 2 Jan 2023 00:34:06 +0000 (-0800) Subject: sparse mq_clustering: remove 'use_value' parameter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d074c5a86c715a968d4382fe22c8b066e378b58;p=graphviz sparse mq_clustering: remove 'use_value' parameter This is always set to true. --- diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 757cb8847..b1fb3f81c 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -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, diff --git a/lib/sparse/mq.c b/lib/sparse/mq.c index 1b1303cac..997df7744 100644 --- a/lib/sparse/mq.c +++ b/lib/sparse/mq.c @@ -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); diff --git a/lib/sparse/mq.h b/lib/sparse/mq.h index acc30ef57..351aab1e2 100644 --- a/lib/sparse/mq.h +++ b/lib/sparse/mq.h @@ -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