summaryrefslogtreecommitdiff
path: root/hadamard_pt.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'hadamard_pt.hpp')
-rw-r--r--hadamard_pt.hpp19
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++) {