This is always set to 0.
}
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;
/* 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);
&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);
}
&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);
}
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.
*/
SparseMatrix B;
- *flag = 0;
-
assert(A->m == A->n);
B = SparseMatrix_symmetrize(A, false);
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
}