summaryrefslogtreecommitdiff
path: root/src/get_dual_clusters.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-02-10 12:18:11 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-02-10 12:18:11 -0500
commit901b9f16494f37890be17ef4bb66e6efc6873340 (patch)
tree03e5f1769cbdb89eb1b4c45c16dc7d867184efaf /src/get_dual_clusters.c
parent1e1fdfc2e3892667bccaf317a01defd8832041c7 (diff)
downloadfuse_networks-901b9f16494f37890be17ef4bb66e6efc6873340.tar.gz
fuse_networks-901b9f16494f37890be17ef4bb66e6efc6873340.tar.bz2
fuse_networks-901b9f16494f37890be17ef4bb66e6efc6873340.zip
changed code to rely on jst
Diffstat (limited to 'src/get_dual_clusters.c')
-rw-r--r--src/get_dual_clusters.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/get_dual_clusters.c b/src/get_dual_clusters.c
deleted file mode 100644
index 78bf185..0000000
--- a/src/get_dual_clusters.c
+++ /dev/null
@@ -1,36 +0,0 @@
-
-#include "fracture.h"
-
-unsigned int *get_clusters(net_t *instance, cholmod_common *c) {
- cholmod_sparse *s_dual = gen_adjacency(instance, true, false, true, c);
-
- unsigned int *dual_marks = find_components(s_dual, 0);
- CHOL_F(free_sparse)(&s_dual, c);
-
- return dual_marks;
-}
-
-unsigned int *get_cluster_dist(net_t *instance, cholmod_common *c) {
- unsigned int *clusters = get_clusters(instance, c);
- unsigned int *cluster_dist = (unsigned int *)calloc(
- instance->graph->dnv, sizeof(unsigned int));
-
- unsigned int cur_mark = 0;
- while (true) {
- cur_mark++;
- unsigned int num_in_cluster = 0;
- for (unsigned int i = 0; i < instance->graph->dnv; i++) {
- if (clusters[i] == cur_mark)
- num_in_cluster++;
- }
-
- if (num_in_cluster == 0)
- break;
-
- cluster_dist[num_in_cluster - 1]++;
- }
-
- free(clusters);
-
- return cluster_dist;
-}