From a75a3b44ffe9c99fc6d1c07ba4c4542b85f02790 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 13 Dec 2019 16:18:03 -0500 Subject: fixed some bugs due to new class in global namespace --- examples/On.cpp | 6 +++--- examples/clock.cpp | 6 +++--- examples/continuous_gaussian.cpp | 6 +++--- examples/discrete_gaussian.cpp | 6 +++--- examples/ising.cpp | 6 +++--- examples/ising_animation.cpp | 4 ++-- examples/ising_no_field.cpp | 6 +++--- examples/ising_random_field.cpp | 6 +++--- examples/ising_standalone.cpp | 4 ++-- examples/potts.cpp | 6 +++--- examples/simple_measurement.hpp | 12 ++++++------ 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/examples/On.cpp b/examples/On.cpp index 6885d2e..fc07ae6 100644 --- a/examples/On.cpp +++ b/examples/On.cpp @@ -59,16 +59,16 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system, vector_t> S(G, T, Z, B); + wolff::system, vector_t> S(G, T, Z, B); - std::function (std::mt19937&, const system, vector_t, graph<>>&, const graph<>::vertex)> gen_R = generate_rotation_uniform>; + std::function (std::mt19937&, const wolff::system, vector_t, graph<>>&, const graph<>::vertex)> gen_R = generate_rotation_uniform>; // initailze the measurement object simple_measurement A(S); // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // run wolff N times S.run_wolff(N, gen_R, A, rng); diff --git a/examples/clock.cpp b/examples/clock.cpp index 3403f23..8777f06 100644 --- a/examples/clock.cpp +++ b/examples/clock.cpp @@ -64,14 +64,14 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system, potts_t, graph<>> S(G, T, Z, B); + wolff::system, potts_t, graph<>> S(G, T, Z, B); // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // define function that generates self-inverse rotations - std::function (std::mt19937&, const system, potts_t, graph<>>&, const graph<>::vertex&)> gen_r = [] (std::mt19937& r, const system, potts_t, graph<>>& S, const graph<>::vertex& v) -> dihedral_t { + std::function (std::mt19937&, const wolff::system, potts_t, graph<>>&, const graph<>::vertex&)> gen_r = [] (std::mt19937& r, const wolff::system, potts_t, graph<>>& S, const graph<>::vertex& v) -> dihedral_t { dihedral_t rot; rot.is_reflection = true; std::uniform_int_distribution dist(0, WOLFF_POTTSQ - 2); diff --git a/examples/continuous_gaussian.cpp b/examples/continuous_gaussian.cpp index eda22cb..da2dc30 100644 --- a/examples/continuous_gaussian.cpp +++ b/examples/continuous_gaussian.cpp @@ -57,11 +57,11 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system, height_t, graph<>> S(G, T, Z, B); + wolff::system, height_t, graph<>> S(G, T, Z, B); bool odd_run = false; - std::function (std::mt19937&, const system, height_t, graph<>>&, const graph<>::vertex&)> gen_R_IH = [&](std::mt19937& r, const system, height_t, graph<>>& S, const graph<>::vertex& v) -> dihedral_inf_t { + std::function (std::mt19937&, const wolff::system, height_t, graph<>>&, const graph<>::vertex&)> gen_R_IH = [&](std::mt19937& r, const wolff::system, height_t, graph<>>& S, const graph<>::vertex& v) -> dihedral_inf_t { dihedral_inf_t rot; rot.is_reflection = true; @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) { // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // run wolff N times S.run_wolff(N, gen_R_IH, A, rng); diff --git a/examples/discrete_gaussian.cpp b/examples/discrete_gaussian.cpp index a6d6ceb..33a19d5 100644 --- a/examples/discrete_gaussian.cpp +++ b/examples/discrete_gaussian.cpp @@ -57,11 +57,11 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system, height_t, graph<>> S(G, T, Z, B); + wolff::system, height_t, graph<>> S(G, T, Z, B); bool odd_run = false; - std::function (std::mt19937&, const system, height_t, graph<>>&, const graph<>::vertex&)> gen_R_IH = [&](std::mt19937& r, const system, height_t, graph<>>& S, const graph<>::vertex &v) -> dihedral_inf_t { + std::function (std::mt19937&, const wolff::system, height_t, graph<>>&, const graph<>::vertex&)> gen_R_IH = [&](std::mt19937& r, const wolff::system, height_t, graph<>>& S, const graph<>::vertex &v) -> dihedral_inf_t { dihedral_inf_t rot; rot.is_reflection = true; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // run wolff N times S.run_wolff(N, gen_R_IH, A, rng); diff --git a/examples/ising.cpp b/examples/ising.cpp index ecb296b..9702f02 100644 --- a/examples/ising.cpp +++ b/examples/ising.cpp @@ -59,14 +59,14 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system> S(G, T, Z, B); + wolff::system> S(G, T, Z, B); // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // define function that generates self-inverse rotations - std::function >&, const graph<>::vertex&)> gen_r = gen_ising>; + std::function >&, const graph<>::vertex&)> gen_r = gen_ising>; // initailze the measurement object simple_measurement A(S); diff --git a/examples/ising_animation.cpp b/examples/ising_animation.cpp index bcaa589..d420f2b 100644 --- a/examples/ising_animation.cpp +++ b/examples/ising_animation.cpp @@ -10,7 +10,7 @@ using namespace wolff; -typedef system> sys; +typedef wolff::system> sys; class draw_ising : public measurement> { private: @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) { // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // run wolff N times S.run_wolff(N, gen_ising>, A, rng); diff --git a/examples/ising_no_field.cpp b/examples/ising_no_field.cpp index 0a5b722..3c78329 100644 --- a/examples/ising_no_field.cpp +++ b/examples/ising_no_field.cpp @@ -50,14 +50,14 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system> S(G, T, Z); + wolff::system> S(G, T, Z); // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // define function that generates self-inverse rotations - std::function >&, const graph<>::vertex&)> gen_r = gen_ising>; + std::function >&, const graph<>::vertex&)> gen_r = gen_ising>; // initailze the measurement object simple_measurement A(S); diff --git a/examples/ising_random_field.cpp b/examples/ising_random_field.cpp index 9284797..5907523 100644 --- a/examples/ising_random_field.cpp +++ b/examples/ising_random_field.cpp @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // define the spin-field coupling std::normal_distribution distribution(0.0, H); @@ -68,10 +68,10 @@ int main(int argc, char *argv[]) { }; // initialize the system - system> S(G, T, Z, B); +wolff::system> S(G, T, Z, B); // define function that generates self-inverse rotations - std::function >&, const graph::vertex&)> gen_r = gen_ising>; + std::function >&, const graph::vertex&)> gen_r = gen_ising>; // initailze the measurement object simple_measurement A(S); diff --git a/examples/ising_standalone.cpp b/examples/ising_standalone.cpp index 6863ba5..8646cff 100644 --- a/examples/ising_standalone.cpp +++ b/examples/ising_standalone.cpp @@ -22,7 +22,7 @@ class ising_t { }; typedef graph<> G_t; -typedef system sys; +typedef wolff::system sys; class measure_clusters : public measurement { private: @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) { // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // run wolff N times S.run_wolff(N, gen_R, A, rng); diff --git a/examples/potts.cpp b/examples/potts.cpp index c15de8d..8a27f7b 100644 --- a/examples/potts.cpp +++ b/examples/potts.cpp @@ -68,14 +68,14 @@ int main(int argc, char *argv[]) { graph<> G(D, L); // initialize the system - system, potts_t, graph<>> S(G, T, Z, B); + wolff::system, potts_t, graph<>> S(G, T, Z, B); // initialize the random number generator auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - std::mt19937 rng{seed}; + std::mt19937 rng(seed); // define function that generates self-inverse rotations - std::function (std::mt19937&, const system, potts_t, graph<>>&, const graph<>::vertex&)> gen_r = [] (std::mt19937& r, const system, potts_t, graph<>>& S, const graph<>::vertex& v) -> symmetric_t { + std::function (std::mt19937&, const wolff::system, potts_t, graph<>>&, const graph<>::vertex&)> gen_r = [] (std::mt19937& r, const wolff::system, potts_t, graph<>>& S, const graph<>::vertex& v) -> symmetric_t { symmetric_t rot; std::uniform_int_distribution dist(0, WOLFF_POTTSQ - 2); diff --git a/examples/simple_measurement.hpp b/examples/simple_measurement.hpp index 140da3b..b24e9f6 100644 --- a/examples/simple_measurement.hpp +++ b/examples/simple_measurement.hpp @@ -17,7 +17,7 @@ class simple_measurement : public measurement { double totalC; public: - simple_measurement(const system& S) { + simple_measurement(const wolff::system& S) { n = 0; M = S.nv * S.s[0]; E = 0; @@ -47,22 +47,22 @@ class simple_measurement : public measurement { totalC = 0; } - void pre_cluster(unsigned, unsigned, const system&, const typename G_t::vertex&, const R_t&) override { + void pre_cluster(unsigned, unsigned, const wolff::system&, const typename G_t::vertex&, const R_t&) override { C = 0; } - void plain_bond_visited(const system&, const typename G_t::halfedge&, const X_t&, double dE) override { + void plain_bond_visited(const wolff::system&, const typename G_t::halfedge&, const X_t&, double dE) override { E += dE; } #ifndef WOLFF_NO_FIELD - void ghost_bond_visited(const system&, const typename G_t::vertex&, const X_t& s_old, const X_t& s_new, double dE) override { + void ghost_bond_visited(const wolff::system&, const typename G_t::vertex&, const X_t& s_old, const X_t& s_new, double dE) override { E += dE; M += s_new - s_old; } #endif - void plain_site_transformed(const system& S, const typename G_t::vertex& v, const X_t& si_new) override { + void plain_site_transformed(const wolff::system& S, const typename G_t::vertex& v, const X_t& si_new) override { C++; #ifdef WOLFF_NO_FIELD @@ -70,7 +70,7 @@ class simple_measurement : public measurement { #endif } - void post_cluster(unsigned, unsigned, const system&) override { + void post_cluster(unsigned, unsigned, const wolff::system&) override { totalE += E; totalM += M; totalC += C; -- cgit v1.2.3-70-g09d2