diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-03-20 21:02:55 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-03-20 21:02:55 +0100 |
commit | 2a60bf7c1ed0396045125e279c6f40dca5d40ba6 (patch) | |
tree | 8fa7c813189fdfbe9dc5671f44aa2add51766cf7 | |
parent | e4dd2fa788530142949c144e773eb4ffbd1ed5ed (diff) | |
download | lattice_glass-2a60bf7c1ed0396045125e279c6f40dca5d40ba6.tar.gz lattice_glass-2a60bf7c1ed0396045125e279c6f40dca5d40ba6.tar.bz2 lattice_glass-2a60bf7c1ed0396045125e279c6f40dca5d40ba6.zip |
Fixed stack overflow, still slow...
-rw-r--r-- | glass.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -139,7 +139,7 @@ template<unsigned D> class System { if (overlaps(p).empty()) { typename std::unordered_map<unsigned, Particle<D>>::iterator it; std::tie(it, std::ignore) = particles.insert({r.uniform((unsigned)0, (unsigned)pow(2, 28)), p}); - p.position.occupant = std::prev(particles.end()); + p.position.occupant = it; return true; } else { return false; |