summaryrefslogtreecommitdiff
path: root/lib/src/network.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-12 10:52:17 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-12 10:52:17 -0500
commit7984b8dbde1d44fc18b6026693c387d2d433872d (patch)
treecb7575c35be8a160ebe022aa0fd81c018d12cc6a /lib/src/network.cpp
parentb8772d61229a68cf231286128d079ad9c7310357 (diff)
downloadfuse_networks-7984b8dbde1d44fc18b6026693c387d2d433872d.tar.gz
fuse_networks-7984b8dbde1d44fc18b6026693c387d2d433872d.tar.bz2
fuse_networks-7984b8dbde1d44fc18b6026693c387d2d433872d.zip
changes
Diffstat (limited to 'lib/src/network.cpp')
-rw-r--r--lib/src/network.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/src/network.cpp b/lib/src/network.cpp
index 9addfdd..a27ca39 100644
--- a/lib/src/network.cpp
+++ b/lib/src/network.cpp
@@ -1,7 +1,7 @@
#include "network.hpp"
-network::network(const graph& G, cholmod_common *c) : G(G), c(c), fuses(G.edges.size(), false), thresholds(G.edges.size(), 1) {
+network::network(const graph& G, cholmod_common *c) : c(c), G(G), fuses(G.edges.size(), false), thresholds(G.edges.size(), 1) {
b = CHOL_F(zeros)(G.vertices.size(), 1, CHOLMOD_REAL, c);
for (unsigned int i = 0; i < G.edges.size(); i++) {
double v0y = G.vertices[G.edges[i][0]].r.y;
@@ -36,8 +36,8 @@ network::network(const graph& G, cholmod_common *c) : G(G), c(c), fuses(G.edges.
unsigned int s0 = v0 < v1 ? v0 : v1;
unsigned int s1 = v0 < v1 ? v1 : v0;
- ((CHOL_INT *)t->i)[terms] = v1;
- ((CHOL_INT *)t->j)[terms] = v0;
+ ((CHOL_INT *)t->i)[terms] = s1;
+ ((CHOL_INT *)t->j)[terms] = s0;
((double *)t->x)[terms] = -1.0;
((double *)t->x)[v0]++;
@@ -74,7 +74,7 @@ network::network(const graph& G, cholmod_common *c) : G(G), c(c), fuses(G.edges.
CHOL_F(free_triplet)(&t, c);
}
-network::network(const network &other) : G(other.G), thresholds(other.thresholds), fuses(other.fuses), c(other.c) {
+network::network(const network &other) : c(other.c), G(other.G), fuses(other.fuses), thresholds(other.thresholds) {
b = CHOL_F(copy_dense)(other.b, c);
factor = CHOL_F(copy_factor)(other.factor, c);
voltcurmat = CHOL_F(copy_sparse)(other.voltcurmat, c);