diff options
Diffstat (limited to 'lib/ising.h')
-rw-r--r-- | lib/ising.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ising.h b/lib/ising.h index 473a18a..aaa0c52 100644 --- a/lib/ising.h +++ b/lib/ising.h @@ -53,6 +53,18 @@ class ising_t { return a; } } + + inline int operator-(const ising_t &s) const { + if (x == s.x) { + return 0; + } else { + if (x) { + return -2; + } else { + return 2; + } + } + } }; inline int& operator+=(int& M, const ising_t &s) { |