diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-17 14:42:43 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-17 14:42:43 -0400 |
commit | 1df6adf16e623570215defa2b22c10e343738edf (patch) | |
tree | 1e08db3358202e28536e0490bc6fa187221bbcc9 | |
parent | fc8e263f7298b20f1281ff01c1d244d3fb1aac9b (diff) | |
download | code-1df6adf16e623570215defa2b22c10e343738edf.tar.gz code-1df6adf16e623570215defa2b22c10e343738edf.tar.bz2 code-1df6adf16e623570215defa2b22c10e343738edf.zip |
Interactive choice for whether to finish tuning.
-rw-r--r-- | hadamard.cpp | 30 | ||||
m--------- | pcg-cpp | 0 |
2 files changed, 24 insertions, 6 deletions
diff --git a/hadamard.cpp b/hadamard.cpp index a2c4199..b311e2d 100644 --- a/hadamard.cpp +++ b/hadamard.cpp @@ -118,13 +118,31 @@ int main(int argc, char* argv[]) { sim.E = sim.M.energy(); } + std::vector<double> f; + std::cout << "Beginning simulation of " << n << ".\n"; - std::cout << "Beginning " << n_tuning << " tuning tempering updates of " << M - << " sweeps each.\n"; - std::vector<double> f = p.tune(n_tuning, M, ε, ε2); - std::cout << "Finished tuning, beginning " << m << " measurement tempering updates of " << M - << " sweeps each.\n"; - p.run(m, M); + bool still_tuning = true; + while (still_tuning) { + std::cout << "Beginning " << n_tuning << " tuning tempering updates of " << M + << " sweeps each.\n"; + f = p.tune(n_tuning, M, ε, ε2); + std::cout << "Finished tuning, beginning " << m << " measurement tempering updates of " << M + << " sweeps each.\n"; + std::cout << "βs: "; + for (const MCMC& M : p.Ms) { + std::cout << M.β << " "; + } + std::cout << std::endl; + std::cout << "Accept tuning as finished? (y/N): "; + char answer = getchar(); + if (answer == 'y') { + still_tuning = false; + } + ε /= 2; + ε2 /= 2; + } + std::cout << "Running " << m << " PT swaps of " << M << " sweeps each."; + p.run(m, M); std::cout << "Finished " << n << ".\n"; auto tag = std::chrono::high_resolution_clock::now(); diff --git a/pcg-cpp b/pcg-cpp -Subproject b263c73ec965ad515de8be8286086d78c67c2f0 +Subproject 5b5cac8d61339e810c5dbb4692d868a1d7ca1b2 |