diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-20 21:27:44 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-20 21:27:44 -0400 |
commit | aba98042aec5bb97d4f5d0f41db98bf942b9df8f (patch) | |
tree | b53887d59da042434d3f1f772425909fe8547402 /examples | |
parent | 46485dee5c154e47a17bb1c44d9b71ab3c9dae26 (diff) | |
parent | e3b636a46eafb6eabe458a33b41b2ce054bd9f4d (diff) | |
download | c++-aba98042aec5bb97d4f5d0f41db98bf942b9df8f.tar.gz c++-aba98042aec5bb97d4f5d0f41db98bf942b9df8f.tar.bz2 c++-aba98042aec5bb97d4f5d0f41db98bf942b9df8f.zip |
Merge branch 'master' of 10.9.0.2:wolff
Diffstat (limited to 'examples')
-rw-r--r-- | examples/ising_standalone.cpp | 44 |
1 files 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 <iostream> #include <chrono> @@ -29,31 +28,22 @@ class measure_clusters : public measurement<ising_t, ising_t> { public: double Ctotal; - measure_clusters() { - Ctotal = 0; - } + measure_clusters() { Ctotal = 0; } - void pre_cluster(N_t, N_t, const system<ising_t, ising_t>&, v_t, const ising_t&) { - C = 0; - } + void pre_cluster(N_t, N_t, const system<ising_t, ising_t>&, v_t, const ising_t&) { C = 0; } - void plain_bond_visited(const system<ising_t, ising_t>&, v_t, const ising_t&, v_t, double dE) {} + void plain_bond_visited(const system<ising_t, ising_t>&, v_t, const ising_t&, v_t, double) {} - void ghost_bond_visited(const system<ising_t, ising_t>&, v_t, const ising_t& s_old, const ising_t& s_new, double dE) {} + void ghost_bond_visited(const system<ising_t, ising_t>&, v_t, const ising_t&, const ising_t&, double) {} - void plain_site_transformed(const system<ising_t, ising_t>&, v_t, const ising_t&) { - C++; - } + void plain_site_transformed(const system<ising_t, ising_t>&, v_t, const ising_t&) { C++; } void ghost_site_transformed(const system<ising_t, ising_t>&, const ising_t&) {} - void post_cluster(N_t, N_t, const system<ising_t, ising_t>&) { - Ctotal += C; - } + void post_cluster(N_t, N_t, const system<ising_t, ising_t>&) { 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 <double(const ising_t&, const ising_t&)> Z = [] (const ising_t& s1, const ising_t& s2) -> double { - return (double)(s1.s * s2.s); - }; + std::function <double(const ising_t&, const ising_t&)> Z = + [](const ising_t& s1, const ising_t& s2) -> double { + return (double)(s1.s * s2.s); + }; // define the spin-field coupling - std::function <double(const ising_t&)> B = [=] (const ising_t& s) -> double { - return H * s.s; - }; + std::function <double(const ising_t&)> 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<ising_t, ising_t> S(G, T, Z, B); // define function that generates self-inverse rotations - std::function <ising_t(std::mt19937&, const system<ising_t, ising_t>&, v_t)> gen_R = [] (std::mt19937&, const system<ising_t, ising_t>&, v_t) -> ising_t { - return ising_t(-1); - }; + std::function <ising_t(std::mt19937&, const system<ising_t, ising_t>&, v_t)> gen_R = + [] (std::mt19937&, const system<ising_t, ising_t>&, 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; } - |