From 49ac78a6c04e215950bc9c0f97368605e63da15b Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 14 Jan 2019 15:47:59 -0500 Subject: Large refactoring around changes in the graph class. - Graphs now use lists of references instead of vectors of indicies. - Vertices and edges have associated classes that can be given arbitrary properties via template specification. - All essential library headers have been combined into one, wolff.hpp. --- lib/src/graph.cpp | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 lib/src/graph.cpp (limited to 'lib/src') diff --git a/lib/src/graph.cpp b/lib/src/graph.cpp deleted file mode 100644 index 4f91be4..0000000 --- a/lib/src/graph.cpp +++ /dev/null @@ -1,55 +0,0 @@ - -#include - -namespace wolff { - -graph::graph() { - D = 0; - L = 0; - nv = 0; - ne = 0; -} - -graph::graph(D_t D, L_t L) : D(D), L(L) { - nv = pow(L, D); - ne = D * nv; - - adjacency.resize(nv); - coordinate.resize(nv); - - for (std::vector adj_i : adjacency) { - adj_i.reserve(2 * D); - } - - for (v_t i = 0; i < nv; i++) { - coordinate[i].resize(D); - for (D_t j = 0; j < D; j++) { - coordinate[i][j] = (i / (v_t)pow(L, D - j - 1)) % L; - - adjacency[i].push_back(pow(L, j + 1) * (i / ((v_t)pow(L, j + 1))) + fmod(i + pow(L, j), pow(L, j + 1))); - adjacency[i].push_back(pow(L, j + 1) * (i / ((v_t)pow(L, j + 1))) + fmod(pow(L, j+1) + i - pow(L, j), pow(L, j + 1))); - } - } -} - -void graph::add_ghost() { - for (std::vector& adj_i : adjacency) { - adj_i.push_back(nv); - } - - adjacency.resize(nv + 1); - coordinate.resize(nv + 1); - adjacency[nv].reserve(nv); - - for (v_t i = 0; i < nv; i++) { - adjacency[nv].push_back(i); - } - - coordinate[nv].resize(coordinate[0].size()); - - ne += nv; - nv++; -} - -} - -- cgit v1.2.3-70-g09d2