diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-05-12 15:02:02 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-05-12 15:02:02 -0400 |
commit | 74a2f5da3321f045d3d023648077b2d4302f5689 (patch) | |
tree | 2491570d1952fe0e9f7550b05f070c69107af5ae | |
parent | d36995bf1d8012507f2f5096242eb3e7ed0aabb3 (diff) | |
download | code-74a2f5da3321f045d3d023648077b2d4302f5689.tar.gz code-74a2f5da3321f045d3d023648077b2d4302f5689.tar.bz2 code-74a2f5da3321f045d3d023648077b2d4302f5689.zip |
New variable in tuning that sets how much of new temperatures to use.
-rw-r--r-- | hadamard_pt.hpp | 4 |
1 files 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<double> tune(unsigned n0, unsigned m, double ε, double ε2) { + std::vector<double> 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²); |