summaryrefslogtreecommitdiff
path: root/src/wolff.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2017-05-25 13:26:38 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2017-05-25 13:26:38 -0400
commitf7a21799194f6626994195302ac95449158bdcd9 (patch)
tree1b65f643f239f8abc8de015fe660486b11b3071e /src/wolff.h
downloadc++-f7a21799194f6626994195302ac95449158bdcd9.tar.gz
c++-f7a21799194f6626994195302ac95449158bdcd9.tar.bz2
c++-f7a21799194f6626994195302ac95449158bdcd9.zip
started wolff code in new repository
Diffstat (limited to 'src/wolff.h')
-rw-r--r--src/wolff.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/wolff.h b/src/wolff.h
new file mode 100644
index 0000000..9619a4d
--- /dev/null
+++ b/src/wolff.h
@@ -0,0 +1,52 @@
+
+#include <string.h>
+#include <math.h>
+#include <getopt.h>
+#include <float.h>
+#include <sys/types.h>
+#include <inttypes.h>
+#include <gsl/gsl_randist.h>
+#include <gsl/gsl_rng.h>
+#include <stdbool.h>
+#include <assert.h>
+#include <omp.h>
+#include <fftw3.h>
+
+#include <jst/graph.h>
+#include <jst/rand.h>
+
+typedef struct {
+ graph_t *g;
+ bool *spins;
+ int32_t M;
+ double H;
+} ising_state_t;
+
+typedef struct ll_tag {
+ uint32_t x;
+ struct ll_tag *next;
+} ll_t;
+
+typedef struct {
+ int32_t nv;
+ double dH;
+} cluster_t;
+
+double get_hamiltonian(graph_t *g, double *coupling, bool *x);
+
+void stack_push(ll_t **q, uint32_t x);
+
+uint32_t stack_pop(ll_t **q);
+
+bool stack_contains(const ll_t *q, uint32_t x);
+
+cluster_t *flip_cluster(const graph_t *g, const double *ps, double H, bool *x, gsl_rng *r);
+
+graph_t *graph_add_ext(const graph_t *g);
+
+double hh(double th);
+
+double *get_bond_probs(double T, double H, ising_state_t *s);
+
+int32_t wolff_step(double T, double H, ising_state_t *s, gsl_rng *r, double *ps);
+