From 7423dcb2938c3883abdc949411fcedc47b0e4705 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 29 Dec 2020 14:40:04 +0100 Subject: New parameter to control length of Langevin simulation. --- langevin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/langevin.cpp b/langevin.cpp index 8660330..241abaf 100644 --- a/langevin.cpp +++ b/langevin.cpp @@ -192,14 +192,18 @@ int main(int argc, char* argv[]) { // simulation parameters double δ = 1e-2; // threshold for determining saddle double γ = 1e-2; // step size + unsigned t = 1000; // number of Langevin steps int opt; - while ((opt = getopt(argc, argv, "N:T:E:e:r:i:g:")) != -1) { + while ((opt = getopt(argc, argv, "N:T:e:r:i:g:t:")) != -1) { switch (opt) { case 'N': N = (unsigned)atof(optarg); break; + case 't': + t = (unsigned)atof(optarg); + break; case 'T': T = atof(optarg); break; @@ -232,7 +236,7 @@ int main(int argc, char* argv[]) { std::cout << zz(0) << std::endl; gradientDescent(J, z, ε, δ, γ); - langevin(J, z, ε, T, 1000, γ, r); + langevin(J, z, ε, T, t, γ, r); zz = z.pow(2).sum(); double a = norm(z); -- cgit v1.2.3-70-g09d2