diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-02-08 15:55:35 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-02-08 15:55:35 -0500 |
commit | 6e4ad4fbf13f5c8d329ad3a0512c17efd790674c (patch) | |
tree | f1532f3f62d5c6a05e4ba950f9ea67177fcff87a /src/wolff.c | |
parent | bcae0db3ac84f3b1f7b0d93b2aa3b7af46ae7420 (diff) | |
download | c++-6e4ad4fbf13f5c8d329ad3a0512c17efd790674c.tar.gz c++-6e4ad4fbf13f5c8d329ad3a0512c17efd790674c.tar.bz2 c++-6e4ad4fbf13f5c8d329ad3a0512c17efd790674c.zip |
added silent flag
Diffstat (limited to 'src/wolff.c')
-rw-r--r-- | src/wolff.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wolff.c b/src/wolff.c index 6dc5c48..d0fbe6d 100644 --- a/src/wolff.c +++ b/src/wolff.c @@ -16,12 +16,13 @@ int main(int argc, char *argv[]) { double eps = 0; bool pretend_ising = false; bool planar_potts = false; + bool silent = false; int opt; q_t J_ind = 0; q_t H_ind = 0; - while ((opt = getopt(argc, argv, "N:n:D:L:q:T:J:H:m:e:Ip")) != -1) { + while ((opt = getopt(argc, argv, "N:n:D:L:q:T:J:H:m:e:Ips")) != -1) { switch (opt) { case 'N': N = (count_t)atof(optarg); @@ -61,6 +62,9 @@ int main(int argc, char *argv[]) { case 'p': planar_potts = true; break; + case 's': + silent = true; + break; default: exit(EXIT_FAILURE); } @@ -135,9 +139,9 @@ int main(int argc, char *argv[]) { } } - printf("\n"); + if (!silent) printf("\n"); while (((diff > eps || diff != diff) && n_runs < N) || n_runs < min_runs) { - printf("\033[F\033[JWOLFF: sweep %" PRIu64 + if (!silent) printf("\033[F\033[JWOLFF: sweep %" PRIu64 ", dH/H = %.4f, dM/M = %.4f, dC/C = %.4f, dX/X = %.4f, cps: %.1f\n", n_runs, fabs(E->dx / E->x), M[0]->dx / M[0]->x, E->dc / E->c, M[0]->dc / M[0]->c, h->nv / clust->x); @@ -184,7 +188,7 @@ int main(int argc, char *argv[]) { n_runs++; } - printf("\033[F\033[JWOLFF: sweep %" PRIu64 + if (!silent) printf("\033[F\033[JWOLFF: sweep %" PRIu64 ", dH/H = %.4f, dM/M = %.4f, dC/C = %.4f, dX/X = %.4f, cps: %.1f\n", n_runs, fabs(E->dx / E->x), M[0]->dx / M[0]->x, E->dc / E->c, M[0]->dc / M[0]->c, h->nv / clust->x); |