From 2b96af4ceab629f2c7b24339266fadcfce055792 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 20 Dec 2019 00:52:34 -0500 Subject: tweaks --- hadamard_pt.hpp | 27 ++++++++++++++++----------- 1 file 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 +#include 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++) { -- cgit v1.2.3-54-g00ecf