summaryrefslogtreecommitdiff
path: root/lib/wolff.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
commit2af9351db3aa97da9b0d3f23d53a593bc96c8a8e (patch)
tree684dfccba8d295c42ef6e2e070c8d6caca45f590 /lib/wolff.h
parent181db84a8ffb26e436a43bb268fe5ef060206e66 (diff)
downloadc++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.gz
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.bz2
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.zip
does potts now, no external libraries
Diffstat (limited to 'lib/wolff.h')
-rw-r--r--lib/wolff.h44
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);