summaryrefslogtreecommitdiff
path: root/lib/get_dual_clusters.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
commit07906baa42470bad14d2c40f57967691f6118969 (patch)
tree416ae624829967861c7c799103b3ff795e9e36b4 /lib/get_dual_clusters.c
parent8c4c42d81745ea33c31150fe22e834d97e29ede6 (diff)
downloadfuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.gz
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.bz2
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.zip
revamped and simplied fracture code with c++
Diffstat (limited to 'lib/get_dual_clusters.c')
-rw-r--r--lib/get_dual_clusters.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/get_dual_clusters.c b/lib/get_dual_clusters.c
deleted file mode 100644
index 9336106..0000000
--- a/lib/get_dual_clusters.c
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#include "fracture.h"
-
-components_t *get_clusters(net_t *instance) {
- components_t *c =
- graph_components_get(instance->graph, instance->fuses, true);
- return c;
-}
-
-unsigned int *get_cluster_dist(net_t *instance) {
- components_t *c = get_clusters(instance);
- unsigned int *cluster_dist =
- (unsigned int *)calloc(instance->graph->dnv, sizeof(unsigned int));
-
- for (uint32_t i = 1; i <= c->n; i++) {
- unsigned int num_in_cluster = 0;
- for (unsigned int j = 0; j < instance->graph->dnv; j++) {
- if (c->labels[j] == i)
- num_in_cluster++;
- }
-
- if (num_in_cluster == 0)
- break;
-
- cluster_dist[num_in_cluster - 1]++;
- }
-
- graph_components_free(c);
-
- return cluster_dist;
-}