From 6e782bdd4f7d14d1e3f96337b397b38d26cb248d Mon Sep 17 00:00:00 2001 From: David van der Spoel Date: Fri, 31 Jul 2015 16:51:17 +0200 Subject: [PATCH] Change initial parameters for testing expfit. The initial parameters for fitting the effnVAC function were very far off the optimal ones, which leads to test failures. Fixes an index error in the printing of the data and the fitted function, which is useful for debugging. Fixes #1789. Change-Id: I3d45a3352fac735bce750bb2d9205590065b9fc2 --- src/gromacs/correlationfunctions/expfit.cpp | 2 +- src/gromacs/correlationfunctions/tests/expfit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gromacs/correlationfunctions/expfit.cpp b/src/gromacs/correlationfunctions/expfit.cpp index 0cc2c148ca..aa1404e184 100644 --- a/src/gromacs/correlationfunctions/expfit.cpp +++ b/src/gromacs/correlationfunctions/expfit.cpp @@ -822,7 +822,7 @@ real do_lmfit(int ndata, real c1[], real sig[], real dt, real x0[], } for (j = 0; (j < nfitpnts); j++) { - real ttt = x0 ? x0[i] : dt*j; + real ttt = x0 ? x0[j] : dt*j; fprintf(fp, "%10.5e %10.5e %10.5e\n", x[j], y[j], lmcurves[eFitFn](ttt, fitparms)); } diff --git a/src/gromacs/correlationfunctions/tests/expfit.cpp b/src/gromacs/correlationfunctions/tests/expfit.cpp index 74fb2ebd8e..657d16ac87 100644 --- a/src/gromacs/correlationfunctions/tests/expfit.cpp +++ b/src/gromacs/correlationfunctions/tests/expfit.cpp @@ -193,7 +193,7 @@ TEST_F (ExpfitTest, EffnERREST) { } TEST_F (ExpfitTest, EffnVAC) { - double param[] = {30, 0.0}; + double param[] = {0.6, 0.1}; test(effnVAC, param, 0.05, 0); } -- 2.22.0