summaryrefslogtreecommitdiff
path: root/hadamard_pt.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'hadamard_pt.hpp')
-rw-r--r--hadamard_pt.hpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp
index 3eee153..3a1eaf1 100644
--- a/hadamard_pt.hpp
+++ b/hadamard_pt.hpp
@@ -2,6 +2,7 @@
#pragma once
#include "hadamard_mcmc.hpp"
#include <list>
+#include <iostream>
void swap(MCMC& s1, MCMC& s2) {
std::swap(s1.M, s2.M);
@@ -84,17 +85,19 @@ 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;
-
- for (unsigned j = 0; j < Ms.size(); j++) {
- if (colors[j] == up) {
- nu[j]++;
- } else if (colors[j] == down) {
- nd[j]++;
+ colors.front() = down;
+ colors.back() = up;
+
+ 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]++;
+ }
}
}
}
@@ -109,7 +112,9 @@ 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++) {