From e3fbb92e68f0410f106285c9a49ecf8cd0a488a9 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 21 Jul 2018 19:43:16 -0400 Subject: added visualization, and started potts --- lib/ising.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/ising.h') diff --git a/lib/ising.h b/lib/ising.h index 4ad88f4..b4856c3 100644 --- a/lib/ising.h +++ b/lib/ising.h @@ -76,6 +76,14 @@ int scalar_multiple(int factor, ising_t s) { } } +double scalar_multiple(double factor, ising_t s) { + if (s.x) { + return -factor; + } else { + return factor; + } +} + double norm_squared(double s) { return pow(s, 2); } -- cgit v1.2.3-70-g09d2