From e3b636a46eafb6eabe458a33b41b2ce054bd9f4d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 20 Oct 2018 14:44:44 -0400 Subject: cleaned up the standalone ising example --- examples/ising_standalone.cpp | 44 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/examples/ising_standalone.cpp b/examples/ising_standalone.cpp index 62b4089..14c39e7 100644 --- a/examples/ising_standalone.cpp +++ b/examples/ising_standalone.cpp @@ -1,4 +1,3 @@ - #include #include @@ -29,31 +28,22 @@ class measure_clusters : public measurement { public: double Ctotal; - measure_clusters() { - Ctotal = 0; - } + measure_clusters() { Ctotal = 0; } - void pre_cluster(N_t, N_t, const system&, v_t, const ising_t&) { - C = 0; - } + void pre_cluster(N_t, N_t, const system&, v_t, const ising_t&) { C = 0; } - void plain_bond_visited(const system&, v_t, const ising_t&, v_t, double dE) {} + void plain_bond_visited(const system&, v_t, const ising_t&, v_t, double) {} - void ghost_bond_visited(const system&, v_t, const ising_t& s_old, const ising_t& s_new, double dE) {} + void ghost_bond_visited(const system&, v_t, const ising_t&, const ising_t&, double) {} - void plain_site_transformed(const system&, v_t, const ising_t&) { - C++; - } + void plain_site_transformed(const system&, v_t, const ising_t&) { C++; } void ghost_site_transformed(const system&, const ising_t&) {} - void post_cluster(N_t, N_t, const system&) { - Ctotal += C; - } + void post_cluster(N_t, N_t, const system&) { Ctotal += C; } }; int main(int argc, char *argv[]) { - // set defaults N_t N = (N_t)1e3; D_t D = 2; @@ -62,14 +52,16 @@ int main(int argc, char *argv[]) { double H = 0.01; // define the spin-spin coupling - std::function Z = [] (const ising_t& s1, const ising_t& s2) -> double { - return (double)(s1.s * s2.s); - }; + std::function Z = + [](const ising_t& s1, const ising_t& s2) -> double { + return (double)(s1.s * s2.s); + }; // define the spin-field coupling - std::function B = [=] (const ising_t& s) -> double { - return H * s.s; - }; + std::function B = + [=](const ising_t& s) -> double { + return H * s.s; + }; // initialize the lattice graph G(D, L); @@ -78,9 +70,10 @@ int main(int argc, char *argv[]) { system S(G, T, Z, B); // define function that generates self-inverse rotations - std::function &, v_t)> gen_R = [] (std::mt19937&, const system&, v_t) -> ising_t { - return ising_t(-1); - }; + std::function &, v_t)> gen_R = + [] (std::mt19937&, const system&, v_t) -> ising_t { + return ising_t(-1); + }; // initailze the measurement object measure_clusters A; @@ -98,4 +91,3 @@ int main(int argc, char *argv[]) { // exit return 0; } - -- cgit v1.2.3-70-g09d2