From 873a9f9bedbbfb07d475e271923a7b86464e515f Mon Sep 17 00:00:00 2001 From: pants Date: Wed, 7 Sep 2016 14:55:30 -0400 Subject: more major refactoring --- src/gen_laplacian.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/gen_laplacian.c') 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; -- cgit v1.2.3-70-g09d2