From 870555f569bc63fecdc7c0b16e72e4e002f21c13 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 26 Jul 2018 13:06:54 -0400 Subject: all the R_t have been objectified --- src/analyze_correlations.cpp | 3 ++- src/wolff_On.cpp | 2 +- src/wolff_cgm.cpp | 4 ++-- src/wolff_clock.cpp | 10 +++++----- src/wolff_dgm.cpp | 4 ++-- src/wolff_ising.cpp | 6 ++---- src/wolff_potts.cpp | 7 +++---- 7 files changed, 17 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/analyze_correlations.cpp b/src/analyze_correlations.cpp index e108f98..5f3dda0 100644 --- a/src/analyze_correlations.cpp +++ b/src/analyze_correlations.cpp @@ -1,6 +1,7 @@ #include -#include +#include +#include #include #include #include diff --git a/src/wolff_On.cpp b/src/wolff_On.cpp index 15a9553..5458860 100644 --- a/src/wolff_On.cpp +++ b/src/wolff_On.cpp @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) { other_f = [&] (const On_t *s) { glClear(GL_COLOR_BUFFER_BIT); for (v_t i = 0; i < pow(L, 2); i++) { - vector_R_t v_tmp = act_inverse(s->R, s->spins[i]); + vector_R_t v_tmp = s->R.act_inverse(s->spins[i]); double thetai = fmod(2 * M_PI + theta(v_tmp), 2 * M_PI); double saturation = 0.7; double value = 0.9; diff --git a/src/wolff_cgm.cpp b/src/wolff_cgm.cpp index 10477bd..7613691 100644 --- a/src/wolff_cgm.cpp +++ b/src/wolff_cgm.cpp @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { double max_h = INT64_MIN; double min_h = INT64_MAX; for (v_t i = 0; i < pow(L, 2); i++) { - double cur_h = act_inverse(s->R, s->spins[i]).x; + double cur_h = (s->R.act_inverse(s->spins[i])).x; if (cur_h < min_h) { min_h = cur_h; } @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) { } for (v_t i = 0; i < pow(L, 2); i++) { - double cur_h = act_inverse(s->R, s->spins[i]).x; + double cur_h = (s->R.act_inverse(s->spins[i])).x; double mag = ((double)(cur_h - min_h)) / ((double)(max_h - min_h)); glColor3f(mag, mag, mag); glRecti(i / L, i % L, (i / L) + 1, (i % L) + 1); diff --git a/src/wolff_clock.cpp b/src/wolff_clock.cpp index e186c44..bc2c5d1 100644 --- a/src/wolff_clock.cpp +++ b/src/wolff_clock.cpp @@ -18,7 +18,7 @@ #include #include -typedef state_t , potts_t> sim_t; +typedef state_t , potts_t> sim_t; int main(int argc, char *argv[]) { @@ -88,11 +88,11 @@ int main(int argc, char *argv[]) { }; // initialize state object - state_t , potts_t> s(D, L, T, Z, B); + state_t , potts_t> s(D, L, T, Z, B); // define function that generates self-inverse rotations - std::function (gsl_rng *, potts_t)> gen_R = [] (gsl_rng *r, potts_t v) -> dihedral_t { - dihedral_t rot; + std::function (gsl_rng *, potts_t)> gen_R = [] (gsl_rng *r, potts_t v) -> dihedral_t { + dihedral_t rot; rot.is_reflection = true; q_t x = gsl_rng_uniform_int(r, POTTSQ - 1); rot.x = (2 * v.x + x + 1) % POTTSQ; @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) { average_M += (double)s->M[0] / (double)N / (double)s->nv; glClear(GL_COLOR_BUFFER_BIT); for (v_t i = 0; i < pow(L, 2); i++) { - potts_t tmp_s = act_inverse(s->R, s->spins[i]); + potts_t tmp_s = s->R.act_inverse(s->spins[i]); glColor3f(hue_to_R(tmp_s.x * 2 * M_PI / POTTSQ), hue_to_G(tmp_s.x * 2 * M_PI / POTTSQ), hue_to_B(tmp_s.x * 2 * M_PI / POTTSQ)); glRecti(i / L, i % L, (i / L) + 1, (i % L) + 1); } diff --git a/src/wolff_dgm.cpp b/src/wolff_dgm.cpp index 6271b79..2583704 100644 --- a/src/wolff_dgm.cpp +++ b/src/wolff_dgm.cpp @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { int64_t max_h = INT64_MIN; int64_t min_h = INT64_MAX; for (v_t i = 0; i < pow(L, 2); i++) { - int64_t cur_h = act_inverse(s->R, s->spins[i]).x; + int64_t cur_h = (s->R.act_inverse(s->spins[i])).x; if (cur_h < min_h) { min_h = cur_h; } @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) { } for (v_t i = 0; i < pow(L, 2); i++) { - int64_t cur_h = act_inverse(s->R, s->spins[i]).x; + int64_t cur_h = (s->R.act_inverse(s->spins[i])).x; double mag = ((double)(cur_h - min_h)) / ((double)(max_h - min_h)); glColor3f(mag, mag, mag); glRecti(i / L, i % L, (i / L) + 1, (i % L) + 1); diff --git a/src/wolff_ising.cpp b/src/wolff_ising.cpp index 93b7ea4..410e046 100644 --- a/src/wolff_ising.cpp +++ b/src/wolff_ising.cpp @@ -120,10 +120,8 @@ int main(int argc, char *argv[]) { state_t s(D, L, T, Z, B); // define function that generates self-inverse rotations - std::function gen_R = [] (gsl_rng *, ising_t s) -> z2_t { - z2_t rot; - rot.x = true; - return rot; + std::function gen_R = [] (gsl_rng *, const ising_t& s) -> z2_t { + return z2_t(true); }; FILE **outfiles = measure_setup_files(measurement_flags, timestamp); diff --git a/src/wolff_potts.cpp b/src/wolff_potts.cpp index cdc4c07..07663d5 100644 --- a/src/wolff_potts.cpp +++ b/src/wolff_potts.cpp @@ -118,7 +118,6 @@ int main(int argc, char *argv[]) { // define function that generates self-inverse rotations std::function (gsl_rng *, potts_t)> gen_R = [] (gsl_rng *r, potts_t v) -> symmetric_t { symmetric_t rot; - init(&rot); q_t j = gsl_rng_uniform_int(r, POTTSQ - 1); q_t swap_v; @@ -128,8 +127,8 @@ int main(int argc, char *argv[]) { swap_v = j + 1; } - rot.perm[v.x] = swap_v; - rot.perm[swap_v] = v.x; + rot[v.x] = swap_v; + rot[swap_v] = v.x; return rot; }; @@ -158,7 +157,7 @@ int main(int argc, char *argv[]) { other_f = [] (const sim_t *s) { glClear(GL_COLOR_BUFFER_BIT); for (v_t i = 0; i < pow(s->L, 2); i++) { - potts_t tmp_s = act_inverse(s->R, s->spins[i]); + potts_t tmp_s = s->R.act_inverse(s->spins[i]); glColor3f(hue_to_R(tmp_s.x * 2 * M_PI / POTTSQ), hue_to_G(tmp_s.x * 2 * M_PI / POTTSQ), hue_to_B(tmp_s.x * 2 * M_PI / POTTSQ)); glRecti(i / s->L, i % s->L, (i / s->L) + 1, (i % s->L) + 1); } -- cgit v1.2.3-70-g09d2