From 099fd132c668d1ea872df4c14e0a46234c197d55 Mon Sep 17 00:00:00 2001 From: Dariusz Murakowski Date: Tue, 23 Jun 2015 04:47:59 -0400 Subject: [PATCH] Add some bounds-checking to the couplings-array accesses during energy calculation. --- ham_ss.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ham_ss.cpp b/ham_ss.cpp index 338d454..61d64c0 100644 --- a/ham_ss.cpp +++ b/ham_ss.cpp @@ -260,12 +260,12 @@ double PottsHamiltonian::get_energy(const PottsState &config) const if (config[i]!=J[i].size()) { - Efield -= J[i][config[i]]; + Efield -= J.at(i).at(config[i]); for (unsigned j=i+1;j