diff options
Diffstat (limited to 'lib/src')
-rw-r--r-- | lib/src/graph.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
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 <wolff/graph.hpp> - -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<v_t> 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<v_t>& 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++; -} - -} - |