From 7984b8dbde1d44fc18b6026693c387d2d433872d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 12 Nov 2018 10:52:17 -0500 Subject: changes --- lib/src/network.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3-54-g00ecf