summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-12-20 00:52:34 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-12-20 00:52:34 -0500
commit2b96af4ceab629f2c7b24339266fadcfce055792 (patch)
tree48200026c048607048b879f94bfc1a684f18bc30
parentedc46c9a6e23da74bc80f41b79c928ce6edd06dd (diff)
downloadcode-2b96af4ceab629f2c7b24339266fadcfce055792.tar.gz
code-2b96af4ceab629f2c7b24339266fadcfce055792.tar.bz2
code-2b96af4ceab629f2c7b24339266fadcfce055792.zip
tweaks
-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++) {