From 342d83d6f24d5b063864f883ec05e7c9fff1301c Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 12 Dec 2019 11:12:35 -0500 Subject: bug fix: parallel measurements recorded during dry runs --- hadamard_pt.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp index bddd8b7..a3d4657 100644 --- a/hadamard_pt.hpp +++ b/hadamard_pt.hpp @@ -48,7 +48,7 @@ public: } } - bool step(unsigned i, unsigned j) { + bool step(unsigned i, unsigned j, bool dry = false) { double Δβ = Ms[i].β - Ms[j].β; double ΔE = Ms[i].E - Ms[j].E; @@ -57,14 +57,16 @@ public: if (accepted) swap(Ms[i], Ms[j]); - B.after_step(accepted, i, j, Δβ, ΔE, Ms[i], Ms[j]); + if (!dry) { + B.after_step(accepted, i, j, Δβ, ΔE, Ms[i], Ms[j]); + } return accepted; } - void sweep() { + void sweep(bool dry = false) { for (unsigned i = 0; i < Ms.size() - 1; i++) { for (unsigned j = i + 1; j < Ms.size(); j++) { - this->step(i, j); + this->step(i, j, dry); } } } @@ -75,7 +77,7 @@ public: for (unsigned j = 0; j < Ms.size(); j++) { Ms[j].run(m, dry); } - this->sweep(); + this->sweep(dry); if (!dry) { B.after_sweep(this->Ms); } -- cgit v1.2.3-70-g09d2