diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-12-20 01:38:04 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-12-20 01:38:04 -0500 |
commit | 1e69e3139e7c846828de049879677a5b359a3ae1 (patch) | |
tree | 9e27d166513555db8d9bb3775a5342971f4f4390 | |
parent | 2b96af4ceab629f2c7b24339266fadcfce055792 (diff) | |
download | code-1e69e3139e7c846828de049879677a5b359a3ae1.tar.gz code-1e69e3139e7c846828de049879677a5b359a3ae1.tar.bz2 code-1e69e3139e7c846828de049879677a5b359a3ae1.zip |
tweaks
-rw-r--r-- | hadamard_pt.hpp | 19 |
1 files 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<unsigned> nu(Ms.size(), 0); std::vector<unsigned> 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++) { |