summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-05-25 14:03:21 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-05-25 14:03:21 -0400
commit1a7f1381bc89b66b66600ed534a5e23be08b2344 (patch)
treea0aee0a738f2c6643b98ca58e126e25f68a118c1 /lib
parentf7a21799194f6626994195302ac95449158bdcd9 (diff)
downloadc++-1a7f1381bc89b66b66600ed534a5e23be08b2344.tar.gz
c++-1a7f1381bc89b66b66600ed534a5e23be08b2344.tar.bz2
c++-1a7f1381bc89b66b66600ed534a5e23be08b2344.zip
fixed bug in wolff_step that modified the system energy incorrectly
Diffstat (limited to 'lib')
-rw-r--r--lib/wolff_tools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/wolff_tools.c b/lib/wolff_tools.c
index 72cf9f7..4fc096e 100644
--- a/lib/wolff_tools.c
+++ b/lib/wolff_tools.c
@@ -168,7 +168,7 @@ int32_t wolff_step(double T, double H, ising_state_t *s, gsl_rng *r, double *ps)
cluster_t *c = flip_cluster(s->g, ps, H, s->spins, r);
s->M += 2 * c->nv;
- s->H += c->dH;
+ s->H += 2 * c->dH;
int32_t n_flipped = c->nv;