From f1326bded3083cb119be458940fea4cf1ccbe62b Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 12 May 2020 20:13:47 -0400 Subject: New overload functionality for Ising spins. --- lib/wolff_models/ising.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/wolff_models') 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; } -- cgit v1.2.3-70-g09d2