:issue:`2701`
+Fix bug in entropy calculation in gmx anaeig
+""""""""""""""""""""""""""""""""""""""""""""
+
+When gmx anaeig received an inconsistent number of atoms and
+eigenvectors (fewer eigenvectors than three times the number of
+atoms) the entropy calculations would use uninitialized values.
+
+:issue:`2668`
+
Fixes to improve portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
read_eigenvectors(VecFile, &natoms, &bFit1,
&xref1, &bDMR1, &xav1, &bDMA1,
&nvec1, &eignr1, &eigvec1, &eigval1);
- neig1 = DIM*natoms;
+ neig1 = std::min(nvec1, DIM*natoms);
+ if (nvec1 != DIM*natoms)
+ {
+ fprintf(stderr, "Warning: number of eigenvectors %d does not match three times\n"
+ "the number of atoms %d in %s. Using %d eigenvectors.\n\n",
+ nvec1, natoms, VecFile, neig1);
+ }
/* Overwrite eigenvalues from separate files if the user provides them */
if (EigFile != nullptr)