diff options
Diffstat (limited to 'lib/wolff.h')
-rw-r--r-- | lib/wolff.h | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/lib/wolff.h b/lib/wolff.h index dfe7b1c..dae907a 100644 --- a/lib/wolff.h +++ b/lib/wolff.h @@ -13,34 +13,26 @@ #include <string.h> #include <sys/types.h> -#include <jst/graph.h> -#include <jst/rand.h> - -#include "queue.h" +#include "types.h" +#include "rand.h" +#include "stack.h" #include "convex.h" - -typedef enum { - WOLFF, - WOLFF_GHOST, - METROPOLIS -} sim_t; +#include "graph.h" +#include "tree.h" typedef struct { graph_t *g; - bool *spins; - int32_t M; - double H; + q_t *spins; + double T; + double *H; + double T_prob; + double *H_probs; + double E; + v_t *M; + q_t q; } ising_state_t; typedef struct { - uint32_t nv; - int32_t dJb; - int32_t dHb; - bool hit_ghost; - ll_t *spins; -} cluster_t; - -typedef struct { uint64_t n; double x; double dx; @@ -60,21 +52,13 @@ typedef struct { double O2; } autocorr_t; -int8_t sign(double x); - -cluster_t *flip_cluster(const graph_t *g, const double *ps, bool *x, bool stop_on_ghost, - gsl_rng *r); +v_t flip_cluster(ising_state_t *s, v_t v0, q_t s1, gsl_rng *r); graph_t *graph_add_ext(const graph_t *g); -uint32_t wolff_step(double T, double H, ising_state_t *s, sim_t sim, gsl_rng *r, - double *ps); - void update_meas(meas_t *m, double x); void update_autocorr(autocorr_t *OO, double O); -double add_to_avg(double mx, double x, uint64_t n); - double rho(autocorr_t *o, uint64_t i); |