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.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gen_laplacian.c b/src/gen_laplacian.c
index 6034a82..4196937 100644
--- a/src/gen_laplacian.c
+++ b/src/gen_laplacian.c
@@ -3,14 +3,9 @@
cholmod_sparse *gen_adjacency(const net_t *instance, bool dual, bool breakv,
unsigned int pad, cholmod_common *c) {
- unsigned int ne;
- if (dual)
- ne = ((int)instance->graph->ne);
- else {
- ne = instance->num_remaining_edges;
- if (!breakv && instance->graph->boundary != TORUS_BOUND) {
- ne += instance->graph->bound_inds[2];
- }
+ unsigned int ne = instance->graph->ne;
+ if (!breakv && instance->graph->boundary != TORUS_BOUND && !dual) {
+ ne += instance->graph->bound_inds[2];
}
unsigned int nnz = 2 * ne;
@@ -58,7 +53,7 @@ cholmod_sparse *gen_adjacency(const net_t *instance, bool dual, bool breakv,
ai[2 * count + 1] = 1;
count++;
- } else if (dual) {
+ } else {
unsigned int v1 = etv[2 * i];
unsigned int v2 = etv[2 * i + 1];
@@ -99,7 +94,7 @@ cholmod_sparse *gen_laplacian(const net_t *instance, cholmod_common *c,
bool symmetric) {
const graph_t *network = instance->graph;
unsigned int num_verts = network->nv_break;
- double *vert_coords = network->vert_coords;
+ double *vert_coords = network->vx;
unsigned int num_bounds = network->num_bounds;
double inf = instance->inf;
bool voltage_bound = instance->voltage_bound;