summaryrefslogtreecommitdiff
path: root/lib/wolff.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-16 18:18:55 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-10-16 18:18:55 -0400
commitcea2351e7283099ebfd7d9d29688fe6c817bf4b8 (patch)
tree16c0b0bbc385f83ef93374e44a093e3a278873f1 /lib/wolff.h
parente0135494451d5026734f6d0df6bdfed50662b93e (diff)
downloadc++-cea2351e7283099ebfd7d9d29688fe6c817bf4b8.tar.gz
c++-cea2351e7283099ebfd7d9d29688fe6c817bf4b8.tar.bz2
c++-cea2351e7283099ebfd7d9d29688fe6c817bf4b8.zip
added new algorithm methods, specifically metropolis and wolff with a static ghost spin
Diffstat (limited to 'lib/wolff.h')
-rw-r--r--lib/wolff.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/wolff.h b/lib/wolff.h
index 82ccb9e..bd49bf0 100644
--- a/lib/wolff.h
+++ b/lib/wolff.h
@@ -18,6 +18,12 @@
#include "queue.h"
+typedef enum {
+ WOLFF,
+ WOLFF_GHOST,
+ METROPOLIS
+} sim_t;
+
typedef struct {
graph_t *g;
bool *spins;
@@ -29,6 +35,7 @@ typedef struct {
uint32_t nv;
int32_t dJb;
int32_t dHb;
+ bool hit_ghost;
} cluster_t;
typedef struct {
@@ -44,12 +51,12 @@ typedef struct {
int32_t sign(double x);
-cluster_t *flip_cluster(const graph_t *g, const double *ps, bool *x,
+cluster_t *flip_cluster(const graph_t *g, const double *ps, bool *x, bool stop_on_ghost,
gsl_rng *r);
graph_t *graph_add_ext(const graph_t *g);
-uint32_t wolff_step(double T, double H, ising_state_t *s, gsl_rng *r,
+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);