Add checks for too much memory in g_nmeig
commitdd45357aa2179f594c0d482fc289f353e836097a
authorBerk Hess <hess@kth.se>
Tue, 5 Jul 2016 13:29:55 +0000 (5 15:29 +0200)
committerBerk Hess <hess@kth.se>
Tue, 5 Jul 2016 13:29:55 +0000 (5 15:29 +0200)
tree9f6e0ce6f88305d67b66ba935ad959d00340901b
parent49b323e321f3d5e70bb76f872883e64c289f710b
Add checks for too much memory in g_nmeig

g_nmeig could request storage for eigenvector output and matrices
for more than INT_MAX elements, but nearly all loop variables are int.
Now a fatal error is produced in this case. This also avoids the
confusing error message when too much memory is requeste; snew
will get the correct size, but gmx_fatal prints it as %d.
Removed double allocation of eigenvectors.
Added support for -first > 1 with sparse matrices.

Change-Id: If425457afb532a5116146cd69c3ff712f43d541d
src/gromacs/gmxana/gmx_nmeig.cpp