diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-06-23 00:00:14 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-06-23 00:00:14 -0400 |
commit | 3ece960188d478d71a880339dba70407a5d0f034 (patch) | |
tree | bc2596afc91526b4f768238fc1e0b5fd267c0462 /lib/get_dual_clusters.c | |
parent | 701cde10f6a43a4d0c3409e1a9bde74040baee22 (diff) | |
download | fuse_networks-3ece960188d478d71a880339dba70407a5d0f034.tar.gz fuse_networks-3ece960188d478d71a880339dba70407a5d0f034.tar.bz2 fuse_networks-3ece960188d478d71a880339dba70407a5d0f034.zip |
ran clang-format
Diffstat (limited to 'lib/get_dual_clusters.c')
-rw-r--r-- | lib/get_dual_clusters.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/get_dual_clusters.c b/lib/get_dual_clusters.c index eaf7562..9336106 100644 --- a/lib/get_dual_clusters.c +++ b/lib/get_dual_clusters.c @@ -2,29 +2,30 @@ #include "fracture.h" components_t *get_clusters(net_t *instance) { - components_t *c = graph_components_get(instance->graph, instance->fuses, true); - return c; + 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)); + 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++; - } + 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; + if (num_in_cluster == 0) + break; - cluster_dist[num_in_cluster - 1]++; - } + cluster_dist[num_in_cluster - 1]++; + } - graph_components_free(c); + graph_components_free(c); - return cluster_dist; + return cluster_dist; } |