From: Dariusz Murakowski Date: Tue, 23 Jun 2015 08:47:59 +0000 (-0400) Subject: Add some bounds-checking to the couplings-array accesses during energy calculation. X-Git-Url: http://src.murakowski.org/?a=commitdiff_plain;h=099fd132c668d1ea872df4c14e0a46234c197d55;p=VirEvoDyn.git Add some bounds-checking to the couplings-array accesses during energy calculation. --- 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