From a264723b23d9ad6c3cb13450a6cf4b131f8d7338 Mon Sep 17 00:00:00 2001 From: pants Date: Thu, 8 Sep 2016 11:46:00 -0400 Subject: fixed some problems with square networks --- src/graph_create.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/graph_create.c') diff --git a/src/graph_create.c b/src/graph_create.c index 5573064..7348142 100644 --- a/src/graph_create.c +++ b/src/graph_create.c @@ -246,10 +246,10 @@ graph_t *ini_square_network(uint_t width, bound_t boundary, bool side_bounds, network->dvx = (double *)malloc(2 * network->dnv * sizeof(double)); for (uint_t i = 0; i < network->dnv; i++) { - network->dvx[2 * i] = - 2*dual_vert_to_coord(width, periodic, i, 0); network->dvx[2 * i + 1] = - 2*dual_vert_to_coord(width, periodic, i, 1); + dual_vert_to_coord(width, periodic, i, 0) / width; + network->dvx[2 * i] = + dual_vert_to_coord(width, periodic, i, 1) / width; } network->voltcurmat = gen_voltcurmat(network->ne, @@ -665,7 +665,6 @@ graph_t *ini_voro_graph(uint_t L, bound_t boundary, bool use_dual, return g; } - graph_t *graph_create(lattice_t lattice, bound_t bound, uint_t L, bool dual, cholmod_common *c) { bool side_bounds; switch (lattice) { -- cgit v1.2.3-70-g09d2