summaryrefslogtreecommitdiff
path: root/src/break_edge.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/break_edge.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/break_edge.c')
-rw-r--r--src/break_edge.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/break_edge.c b/src/break_edge.c
deleted file mode 100644
index 2f112c2..0000000
--- a/src/break_edge.c
+++ /dev/null
@@ -1,51 +0,0 @@
-
-#include "fracture.h"
-
-
-bool break_edge(net_t *net, uint_t edge, cholmod_common *c) {
- net->fuses[edge] = true;
- net->num_broken++;
-
- double *x = (double *)net->boundary_cond->x;
- const graph_t *g = net->graph;
-
- uint_t v1 = net->graph->ev[2 * edge];
- uint_t v2 = net->graph->ev[2 * edge + 1];
-
- uint_t s1 = v1 < v2 ? v1 : v2;
- uint_t s2 = v1 < v2 ? v2 : v1;
-
- if (net->graph->boundary == TORUS_BOUND) {
- if (net->graph->bq[edge]) {
- double v1y = g->vx[2 * v1 + 1];
- double v2y = g->vx[2 * v2 + 1];
- uint_t ind = v1y < v2y ? 0 : 1;
- x[g->ev[2 * edge + ind]] -= 1;
- x[g->ev[2 * edge + !ind]] += 1;
- }
- if (net->factor != NULL) {
- factor_update(net->factor, s1, s2, c);
- }
- } else if (net->voltage_bound) {
- if (g->bq[v1] || g->bq[v2]) {
- uint_t vv = g->bq[v1] ? v2 : v1;
- uint_t uu = v1 == vv ? v2 : v1;
- if (is_in(g->bi[1], g->b, uu)) {
- x[g->bni[vv]] -= 1;
- }
- if (net->factor != NULL) {
- factor_update2(net->factor, g->bni[vv], c);
- }
- } else {
- if (net->factor != NULL) {
- factor_update(net->factor, g->bni[s1], g->bni[s2], c);
- }
- }
- } else {
- if (net->factor != NULL) {
- factor_update(net->factor, s1, s2, c);
- }
- }
-
- return true;
-}