diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-05-12 20:13:47 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-05-12 20:13:47 -0400 |
commit | f1326bded3083cb119be458940fea4cf1ccbe62b (patch) | |
tree | 39b8eb0a1e16f486696c6685c1495b85b6bbda9a /lib | |
parent | 91faa327158f989dbfc0cd58709cade06723c486 (diff) | |
download | c++-f1326bded3083cb119be458940fea4cf1ccbe62b.tar.gz c++-f1326bded3083cb119be458940fea4cf1ccbe62b.tar.bz2 c++-f1326bded3083cb119be458940fea4cf1ccbe62b.zip |
Diffstat (limited to 'lib')
-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; } |