diff options
Diffstat (limited to 'lib/src')
-rw-r--r-- | lib/src/network.cpp | 8 |
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); |