Update interface of gmx_stats_t
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Jun 2021 13:10:48 +0000 (15:10 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Jun 2021 13:25:27 +0000 (15:25 +0200)
commita2379fd996ed269573b32dc9d10ae103fe7da5c0
tree2cbf2a72713449dd3b5106a4611b6a1c29ade36a
parentc4304966c7a45ba4123e02e58c7e2ae3b8daaff9
Update interface of gmx_stats_t

The only error code returned was one that checked that there was data
points to work with. Given our style, that makes sense to implement
with an internal assertion at the point where it is necessary, and to
throw when the user input is observed to be inconsistent (ie.
requesting statistical work without providing a valid dataset).

At least one routines always returned the error code for success,
creating complexity which is now eliminated.

Used a template to permit one routine to be implemented in two
slightly different ways.

This change helps with warning-free compilation with gcc 12 by
eliminating the assertion that was only used in debug mode. It is now
always a throw, since it makes no sense to continue to report garbage
statistics in the case being checked. Now the enum class is also no
longer useful and is eliminated.

Uncovered bug #4080 which is fixed here, and backported to
release-2021 separately.
src/gromacs/gmxana/gmx_analyze.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/statistics/statistics.cpp
src/gromacs/statistics/statistics.h