summaryrefslogtreecommitdiff
path: root/src/get_dual_clusters.c
diff options
context:
space:
mode:
authorJaron <jaron@kent-dobias.com>2017-06-22 22:40:47 -0400
committerJaron <jaron@kent-dobias.com>2017-06-22 22:40:47 -0400
commitd59fc339a40a47405bfef8c1313e324adca70479 (patch)
treeaddf46044c3a1507bd4069797c6218c457b67e5f /src/get_dual_clusters.c
parentf4a50f1332ff323c42aa9664292910fd78933c15 (diff)
parent4764d5d407347d4dd5990411b243b3ec4bd75bff (diff)
downloadfuse_networks-d59fc339a40a47405bfef8c1313e324adca70479.tar.gz
fuse_networks-d59fc339a40a47405bfef8c1313e324adca70479.tar.bz2
fuse_networks-d59fc339a40a47405bfef8c1313e324adca70479.zip
lots of changes for merge
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 6090fb8..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, false, 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;
-}