From 74a2f5da3321f045d3d023648077b2d4302f5689 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 12 May 2020 15:02:02 -0400 Subject: New variable in tuning that sets how much of new temperatures to use. --- hadamard_pt.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp index b73afe0..0d902f9 100644 --- a/hadamard_pt.hpp +++ b/hadamard_pt.hpp @@ -50,7 +50,7 @@ public: return accepted; } - std::vector tune(unsigned n0, unsigned m, double ε, double ε2) { + std::vector tune(unsigned n0, unsigned m, double ε, double ε2, double y = 0.2) { unsigned n = n0; while (true) { @@ -146,7 +146,7 @@ public: double err = 0; for (unsigned i = 0; i < T1.size(); i++) { err += fabs(T1[i] - 1 / Ms[Ms.size() - i - 2].β); - Ms[Ms.size() - i - 2].β = 1.0 / T1[i]; + Ms[Ms.size() - i - 2].β = (1 - y) * Ms[Ms.size() - i - 2].β + y / T1[i]; } double Δf = sqrt(Δf²); -- cgit v1.2.3-70-g09d2