Fix non-normalization of FFT autocorr
commit16142e23500b57c3abe11bd3425cd13ff32c5fca
authorBerk Hess <hess@kth.se>
Wed, 16 Mar 2016 09:04:31 +0000 (16 10:04 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 18 Mar 2016 16:59:54 +0000 (18 17:59 +0100)
tree64377b1dd3532cd7b8d24006624bb1d9ccf11f03
parent83f456ad18d173ba9478a1dd8bcdd61d0fa70f8e
Fix non-normalization of FFT autocorr

The function many_auto_correl incorrectly divided by the number of
data points, leading to incorrect absolute values of autocorrelation
functions, as e.g. out by gmx analyze -ac -nonormalize.
Also simplified the FFT size calculation.

Added a test for -nonormalize functionality.

Fixes #1914.

Change-Id: If0961c91d6e0a78f88e4390ce55b2a56143dd5e5
13 files changed:
src/gromacs/correlationfunctions/autocorr.c
src/gromacs/correlationfunctions/manyautocorrelation.c
src/gromacs/correlationfunctions/tests/autocorr.cpp
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacCos.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacNoNormalize.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacNormal.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP0.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP1.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP2.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP3.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP4.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacRcross.xml
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacVector.xml