diff options
Diffstat (limited to 'examples/continuous_gaussian.cpp')
-rw-r--r-- | examples/continuous_gaussian.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/examples/continuous_gaussian.cpp b/examples/continuous_gaussian.cpp index ef08247..eda22cb 100644 --- a/examples/continuous_gaussian.cpp +++ b/examples/continuous_gaussian.cpp @@ -3,19 +3,18 @@ #include <iostream> #include <chrono> -#include "simple_measurement.hpp" - -#include <wolff/models/height.hpp> -#include <wolff/models/dihedral_inf.hpp> - +#include <wolff_models/height.hpp> +#include <wolff_models/dihedral_inf.hpp> #include <wolff.hpp> +#include "simple_measurement.hpp" + int main(int argc, char *argv[]) { // set defaults - N_t N = (N_t)1e4; - D_t D = 2; - L_t L = 128; + unsigned N = (unsigned)1e4; + unsigned D = 2; + unsigned L = 128; double T = 0.8; double H = 0.0; @@ -25,7 +24,7 @@ int main(int argc, char *argv[]) { while ((opt = getopt(argc, argv, "N:D:L:T:H:")) != -1) { switch (opt) { case 'N': // number of steps - N = (N_t)atof(optarg); + N = (unsigned)atof(optarg); break; case 'D': // dimension D = atoi(optarg); @@ -55,25 +54,25 @@ int main(int argc, char *argv[]) { }; // initialize the lattice - graph G(D, L); + graph<> G(D, L); // initialize the system - system<dihedral_inf_t<double>, height_t<double>> S(G, T, Z, B); + system<dihedral_inf_t<double>, height_t<double>, graph<>> S(G, T, Z, B); bool odd_run = false; - std::function <dihedral_inf_t<double>(std::mt19937&, const system<dihedral_inf_t<double>, height_t<double>>&, v_t)> gen_R_IH = [&](std::mt19937& r, const system<dihedral_inf_t<double>, height_t<double>>& S, v_t i0) -> dihedral_inf_t<double> { + std::function <dihedral_inf_t<double>(std::mt19937&, const system<dihedral_inf_t<double>, height_t<double>, graph<>>&, const graph<>::vertex&)> gen_R_IH = [&](std::mt19937& r, const system<dihedral_inf_t<double>, height_t<double>, graph<>>& S, const graph<>::vertex& v) -> dihedral_inf_t<double> { dihedral_inf_t<double> rot; rot.is_reflection = true; if (odd_run) { - std::uniform_int_distribution<v_t> dist(0, S.nv - 2); - v_t j = i0; + std::uniform_int_distribution<unsigned> dist(0, S.nv - 2); + unsigned j = v.ind; //while (S.s[j].x == S.s[i0].x) { - v_t tmp = dist(r); + unsigned tmp = dist(r); - if (tmp < i0) { + if (tmp < v.ind) { j = tmp; } else { j = tmp + 1; @@ -83,7 +82,7 @@ int main(int argc, char *argv[]) { rot.x = 2 * S.s[j].x; } else { std::normal_distribution<double> dist(0.0,1.0); - rot.x = 2 * S.s[i0].x + dist(r); + rot.x = 2 * S.s[v.ind].x + dist(r); } odd_run = !odd_run; |