From 1e69e3139e7c846828de049879677a5b359a3ae1 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 20 Dec 2019 01:38:04 -0500 Subject: tweaks --- hadamard_pt.hpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp index 3a1eaf1..9f50e1e 100644 --- a/hadamard_pt.hpp +++ b/hadamard_pt.hpp @@ -73,9 +73,6 @@ public: std::vector nu(Ms.size(), 0); std::vector nd(Ms.size(), 0); - colors.front() = down; - colors.back() = up; - for (unsigned i = 0; i < n; i++) { #pragma omp parallel for for (unsigned j = 0; j < Ms.size(); j++) { @@ -85,19 +82,17 @@ public: for (unsigned j = 0; j < Ms.size() - 1; j++) { if (this->step(j, j + 1, true)) { std::swap(colors[j], colors[j + 1]); - colors.front() = down; - colors.back() = up; - + } + } + colors.front() = down; + colors.back() = up; + for (unsigned j = 0; j < Ms.size(); j++) { + if (i > n / 2) { if (colors[j] == up) { nu[j]++; } else if (colors[j] == down) { nd[j]++; } - if (colors[j + 1] == up) { - nu[j + 1]++; - } else if (colors[j + 1] == down) { - nd[j + 1]++; - } } } } @@ -112,9 +107,7 @@ public: f_keep.push_back(i); f_last = f[i]; } - std::cout << f[i] << " "; } - std::cout << "\n"; for (signed i = 0; i < f_keep.size() - 1; i++) { for (unsigned j = f_keep[i]; j < f_keep[i + 1]; j++) { -- cgit v1.2.3-70-g09d2