summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-21 00:39:34 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-21 00:39:34 -0400
commit44b83cecee297360d18ef3cf96bf0e2a41c699af (patch)
tree0fde9456e726156a659400b7591fd1401643fbe7
parenta57928e1ef11d54a3e8b6b6de42013952b1cbf8e (diff)
downloadc++-44b83cecee297360d18ef3cf96bf0e2a41c699af.tar.gz
c++-44b83cecee297360d18ef3cf96bf0e2a41c699af.tar.bz2
c++-44b83cecee297360d18ef3cf96bf0e2a41c699af.zip
measurement virtual hooks now defined to be trivial by default
-rw-r--r--examples/ising_animation.cpp8
-rw-r--r--examples/ising_standalone.cpp6
-rw-r--r--examples/simple_measurement.hpp2
-rw-r--r--lib/include/wolff/measurement.hpp12
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<ising_t, ising_t> {
C = 0;
}
- void plain_bond_visited(const system<ising_t, ising_t>&, v_t, const ising_t&, v_t, double dE) {}
-
- 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 plain_site_transformed(const system<ising_t, ising_t>& 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<ising_t, ising_t> {
glFlush();
}
}
-
- 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>&) {}
};
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<ising_t, ising_t> {
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) {}
-
- 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 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; }
};
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<R_t, X_t> {
#endif
}
- void ghost_site_transformed(const system<R_t, X_t>&, const R_t&) {}
-
void post_cluster(N_t, N_t, const system<R_t, X_t>&) {
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 R_t, class X_t>
class measurement {
public:
- virtual void pre_cluster(N_t, N_t, const system<R_t, X_t>&, v_t, const R_t&) = 0;
+ virtual void pre_cluster(N_t, N_t, const system<R_t, X_t>&, v_t, const R_t&) {};
- virtual void plain_bond_visited(const system<R_t, X_t>&, v_t, const X_t&, v_t, double) = 0;
- virtual void plain_site_transformed(const system<R_t, X_t>&, v_t, const X_t&) = 0;
+ virtual void plain_bond_visited(const system<R_t, X_t>&, v_t, const X_t&, v_t, double) {};
+ virtual void plain_site_transformed(const system<R_t, X_t>&, v_t, const X_t&) {};
#ifndef WOLFF_NO_FIELD
- virtual void ghost_bond_visited(const system<R_t, X_t>&, v_t, const X_t&, const X_t&, double) = 0;
- virtual void ghost_site_transformed(const system<R_t, X_t>&, const R_t&) = 0;
+ virtual void ghost_bond_visited(const system<R_t, X_t>&, v_t, const X_t&, const X_t&, double) {};
+ virtual void ghost_site_transformed(const system<R_t, X_t>&, const R_t&) {};
#endif
- virtual void post_cluster(N_t, N_t, const system<R_t, X_t>&) = 0;
+ virtual void post_cluster(N_t, N_t, const system<R_t, X_t>&) {};
};
}