summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2020-05-12 20:13:47 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2020-05-12 20:13:47 -0400
commitf1326bded3083cb119be458940fea4cf1ccbe62b (patch)
tree39b8eb0a1e16f486696c6685c1495b85b6bbda9a /lib
parent91faa327158f989dbfc0cd58709cade06723c486 (diff)
downloadc++-master.tar.gz
c++-master.tar.bz2
c++-master.zip
New overload functionality for Ising spins.HEADmaster
Diffstat (limited to 'lib')
-rw-r--r--lib/wolff_models/ising.hpp12
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;
}