summaryrefslogtreecommitdiff
path: root/src/gen_laplacian.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen_laplacian.c')
-rw-r--r--src/gen_laplacian.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gen_laplacian.c b/src/gen_laplacian.c
index d8f0c6d..97a2c9d 100644
--- a/src/gen_laplacian.c
+++ b/src/gen_laplacian.c
@@ -159,14 +159,15 @@ cholmod_sparse *gen_laplacian(const finst *instance, cholmod_common *c,
}
if (network->boundary != TORUS_BOUND) {
+ if (network->boundary != EMBEDDED_BOUND) acoo[0]++;
+
if (voltage_bound) {
- for (unsigned int i = 0; i < 2; i++) {
+ for (unsigned int i = 0; i < num_bounds; i++) {
for (unsigned int j = 0; j < bound_inds[i + 1] - bound_inds[i]; j++) {
acoo[bound_verts[bound_inds[i] + j]]++;
}
}
} else {
- acoo[0]++;
for (unsigned int i = 0; i < num_bounds; i++) {
rowind[num_verts + i] = num_verts + i;
colind[num_verts + i] = num_verts + i;
@@ -181,7 +182,7 @@ cholmod_sparse *gen_laplacian(const finst *instance, cholmod_common *c,
unsigned int start = num_gverts;
- for (unsigned int i = 0; i < num_bounds; i++) {
+ for (unsigned int i = 0; i < 2; i++) {
for (unsigned int j = 0; j < bound_inds[i + 1] - bound_inds[i]; j++) {
rowind[start + bound_inds[i] + j] = bound_verts[bound_inds[i] + j];
colind[start + bound_inds[i] + j] = num_verts + i;