projects
/
VirEvoDyn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7de0f42
)
Add some bounds-checking to the couplings-array accesses during energy calculation.
author
Dariusz Murakowski
<murakdar@mit.edu>
Tue, 23 Jun 2015 08:47:59 +0000
(
04:47
-0400)
committer
Dariusz Murakowski
<murakdar@mit.edu>
Tue, 23 Jun 2015 08:47:59 +0000
(
04:47
-0400)
ham_ss.cpp
patch
|
blob
|
history
diff --git
a/ham_ss.cpp
b/ham_ss.cpp
index
338d454
..
61d64c0
100644
(file)
--- 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<config.size();j++) {
if (config[j]!=J[j].size())
- Ecoupling -= J
[index(i,j,config.size())][sindex(config[i],config[j],J[i].size(),J[j].size())]
;
+ Ecoupling -= J
.at(index(i,j,config.size())).at(sindex(config[i],config[j],J[i].size(),J[j].size()))
;
}