summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadamard_pt.hpp12
1 files 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);
}