Bugs in gmx hbond
xpm matrix formation cause two exceptions due non-initialized variables.
/src/gromacs/gmxana/gmx_hbond.cpp
Line 3443:
std::copy(hb->time, hb->time + mat.nx, mat.axis_x.begin());`
mat.axis_x is not initialized yet.
Must to write before line 3443:
mat.axis_x.resize(mat.nx);.
Line 3452:
for (auto& m : mat.map) { m.code.c1 = hbmap[i]; m.desc = hbdesc[i]; m.rgb = hbrgb[i]; }
Not initialized variable i is used and not incremented.
Must be, as example:
i=0;
for (auto& m : mat.map) { m.code.c1 = hbmap[i]; m.desc = hbdesc[i]; m.rgb = hbrgb[i]; ++i; }
How many wonderful discoveries prepares fourteenth С++! (A.S.Pushkin)
Edited by Boris Timofeev