diff options
-rw-r--r-- | lib/wolff_models/ising.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/wolff_models/ising.hpp b/lib/wolff_models/ising.hpp index bcb0103..3b36788 100644 --- a/lib/wolff_models/ising.hpp +++ b/lib/wolff_models/ising.hpp @@ -60,6 +60,14 @@ namespace wolff { } } + inline int operator+(int a) const { + if (x) { + return a - 1; + } else { + return a + 1; + } + } + inline int operator*(const ising_t& s) const { if (x == s.x) { return 1; @@ -73,6 +81,10 @@ namespace wolff { } }; + inline int operator+(int a, const ising_t& s) { + return s + a; + } + inline ising_t::M_t operator*(unsigned a, const ising_t& s) { return s * a; } |