summaryrefslogtreecommitdiff
path: root/src/get_dual_clusters.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-02-10 12:19:46 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-02-10 12:19:46 -0500
commit0ef0c0ce1d904be2b4e1f4da62dc029d8572c983 (patch)
tree12978013d870186240c08d1fdd6a7ce8781bca93 /src/get_dual_clusters.c
parent9a93a3b88a604672f557950e6c7f3fe815bcf163 (diff)
parent901b9f16494f37890be17ef4bb66e6efc6873340 (diff)
downloadfuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.gz
fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.bz2
fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.zip
Merge branch 'tmp'
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;
-}