Simplify gmx chi
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 20 Aug 2021 17:42:24 +0000 (17:42 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Fri, 20 Aug 2021 17:42:24 +0000 (17:42 +0000)
commit52e2bd596dc1f470cfd2835714e1f278237e8f8a
treeb48d3b2b8a87e67eb8820ac0225d87a2baf4c32d
parente002099ad46bc6a8ca0e311c20940c7c7ae5c251
Simplify gmx chi

This change is pure refactoring that prepares for performance
improvements to ResidueType handling that will benefit both grompp and
pdb2gmx.

Use vector and ArrayRef to replace C-style memory handling. Some
histogram vectors were being over-allocated by 1, which is no longer
safe to do now that the size of the vector is relevant when looping,
so those are reduced.

Eliminated and reduce scope of iteration variables. Removed an unused
function and some debug code in comments. Used const references rather
than pointers where possible. Used range-based for and algorithms in
some places that are now possible to do so.
src/gromacs/gmxana/anadih.cpp
src/gromacs/gmxana/dlist.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gstat.h
src/gromacs/gmxana/pp2shift.cpp