From 2af9351db3aa97da9b0d3f23d53a593bc96c8a8e Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 2 Feb 2018 18:33:22 -0500 Subject: does potts now, no external libraries --- lib/wolff.h | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'lib/wolff.h') diff --git a/lib/wolff.h b/lib/wolff.h index dfe7b1c..dae907a 100644 --- a/lib/wolff.h +++ b/lib/wolff.h @@ -13,33 +13,25 @@ #include #include -#include -#include - -#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; @@ -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); -- cgit v1.2.3-70-g09d2