summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-11 12:44:47 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-11 12:44:47 -0400
commit969e9dd60bf2966ec696120df61317ecb5961f35 (patch)
tree0826e9f4984f1fb6a9ae1ce939c67660577be036 /src
parent531f544b1163ef878a5a8cb9be98318d7029e7a8 (diff)
downloadc++-969e9dd60bf2966ec696120df61317ecb5961f35.tar.gz
c++-969e9dd60bf2966ec696120df61317ecb5961f35.tar.bz2
c++-969e9dd60bf2966ec696120df61317ecb5961f35.zip
added ability to use M to stop execution instead of chi
Diffstat (limited to 'src')
-rw-r--r--src/wolff.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/wolff.c b/src/wolff.c
index 7b764d3..3b07a13 100644
--- a/src/wolff.c
+++ b/src/wolff.c
@@ -3,7 +3,7 @@
int main(int argc, char *argv[]) {
int opt;
- bool output_state, use_dual;
+ bool output_state, use_dual, M_stop;
lattice_t lat;
uint16_t L;
uint32_t min_runs, lattice_i;
@@ -14,13 +14,14 @@ int main(int argc, char *argv[]) {
N = 1000;
lat = SQUARE_LATTICE;
use_dual = false;
+ M_stop = false;
T = 2.3;
H = 0;
eps = 1e30;
output_state = false;
min_runs = 10;
- while ((opt = getopt(argc, argv, "N:L:T:H:m:e:oq:D")) != -1) {
+ while ((opt = getopt(argc, argv, "N:L:T:H:m:e:oq:DM")) != -1) {
switch (opt) {
case 'N':
N = (uint64_t)atof(optarg);
@@ -37,6 +38,9 @@ int main(int argc, char *argv[]) {
case 'm':
min_runs = atoi(optarg);
break;
+ case 'M':
+ M_stop = true;
+ break;
case 'e':
eps = atof(optarg);
break;
@@ -172,7 +176,11 @@ int main(int argc, char *argv[]) {
dM1 = sqrt(Msigma2 / n_runs);
daM1 = sqrt(aMsigma2 / n_runs);
- diff = fabs(dX / X);
+ if (M_stop) {
+ diff = fabs(dM1 / M1);
+ } else {
+ diff = fabs(dX / X);
+ }
}
clust_per_sweep = clust_per_sweep * (n_runs / (n_runs + 1.)) +