From 44b83cecee297360d18ef3cf96bf0e2a41c699af Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sun, 21 Oct 2018 00:39:34 -0400 Subject: measurement virtual hooks now defined to be trivial by default --- examples/ising_animation.cpp | 8 -------- examples/ising_standalone.cpp | 6 ------ examples/simple_measurement.hpp | 2 -- lib/include/wolff/measurement.hpp | 12 ++++++------ 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/examples/ising_animation.cpp b/examples/ising_animation.cpp index ab10585..7bafcf8 100644 --- a/examples/ising_animation.cpp +++ b/examples/ising_animation.cpp @@ -43,10 +43,6 @@ class draw_ising : public measurement { C = 0; } - void plain_bond_visited(const system&, v_t, const ising_t&, v_t, double dE) {} - - void ghost_bond_visited(const system&, v_t, const ising_t& s_old, const ising_t& s_new, double dE) {} - void plain_site_transformed(const system& S, v_t i, const ising_t&) { glColor3f(1.0, 0.0, 0.0); glRecti(i / S.G.L, i % S.G.L, (i / S.G.L) + 1, (i % S.G.L) + 1); @@ -55,10 +51,6 @@ class draw_ising : public measurement { glFlush(); } } - - void ghost_site_transformed(const system&, const ising_t&) {} - - void post_cluster(N_t, N_t, const system&) {} }; int main(int argc, char *argv[]) { diff --git a/examples/ising_standalone.cpp b/examples/ising_standalone.cpp index 14c39e7..40572fd 100644 --- a/examples/ising_standalone.cpp +++ b/examples/ising_standalone.cpp @@ -32,14 +32,8 @@ class measure_clusters : public measurement { 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) {} - - 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 ghost_site_transformed(const system&, const ising_t&) {} - void post_cluster(N_t, N_t, const system&) { Ctotal += C; } }; diff --git a/examples/simple_measurement.hpp b/examples/simple_measurement.hpp index f98cfe6..217f4f0 100644 --- a/examples/simple_measurement.hpp +++ b/examples/simple_measurement.hpp @@ -68,8 +68,6 @@ class simple_measurement : public measurement { #endif } - void ghost_site_transformed(const system&, const R_t&) {} - void post_cluster(N_t, N_t, const system&) { totalE += E; totalM += M; diff --git a/lib/include/wolff/measurement.hpp b/lib/include/wolff/measurement.hpp index 59684fb..6e352a5 100644 --- a/lib/include/wolff/measurement.hpp +++ b/lib/include/wolff/measurement.hpp @@ -9,17 +9,17 @@ namespace wolff { template class measurement { public: - virtual void pre_cluster(N_t, N_t, const system&, v_t, const R_t&) = 0; + virtual void pre_cluster(N_t, N_t, const system&, v_t, const R_t&) {}; - virtual void plain_bond_visited(const system&, v_t, const X_t&, v_t, double) = 0; - virtual void plain_site_transformed(const system&, v_t, const X_t&) = 0; + virtual void plain_bond_visited(const system&, v_t, const X_t&, v_t, double) {}; + virtual void plain_site_transformed(const system&, v_t, const X_t&) {}; #ifndef WOLFF_NO_FIELD - virtual void ghost_bond_visited(const system&, v_t, const X_t&, const X_t&, double) = 0; - virtual void ghost_site_transformed(const system&, const R_t&) = 0; + virtual void ghost_bond_visited(const system&, v_t, const X_t&, const X_t&, double) {}; + virtual void ghost_site_transformed(const system&, const R_t&) {}; #endif - virtual void post_cluster(N_t, N_t, const system&) = 0; + virtual void post_cluster(N_t, N_t, const system&) {}; }; } -- cgit v1.2.3-70-g09d2