diff options
-rw-r--r-- | langevin.cpp | 8 |
1 files 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); |