summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/wolff.h3
-rw-r--r--lib/wolff_tools.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/wolff.h b/lib/wolff.h
index 29286ba..18ae6dd 100644
--- a/lib/wolff.h
+++ b/lib/wolff.h
@@ -42,7 +42,8 @@ typedef struct {
double *spins;
double T;
double (*J)(double);
- double (*H)(double *);
+ double (*H)(q_t, double *, double *);
+ double *H_info;
double *R;
double E;
double *M;
diff --git a/lib/wolff_tools.c b/lib/wolff_tools.c
index e63623c..7a52546 100644
--- a/lib/wolff_tools.c
+++ b/lib/wolff_tools.c
@@ -131,7 +131,7 @@ v_t flip_cluster_vector(vector_state_t *s, v_t v0, double *rot, gsl_rng *r) {
rs_old = vector_rotate_inverse(s->n, s->R, sn);
rs_new = vector_rotate_inverse(s->n, R_tmp, sn);
}
- double dE = s->H(rs_old) - s->H(rs_new);
+ double dE = s->H(s->n, s->H_info, rs_old) - s->H(s->n, s->H_info, rs_new);
prob = 1.0 - exp(-dE / s->T);
vector_subtract(s->n, s->M, rs_old);
vector_add(s->n, s->M, rs_new);