From: David van der Spoel Date: Fri, 31 Jul 2015 14:51:17 +0000 (+0200) Subject: Change initial parameters for testing expfit. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=6e782bdd4f7d14d1e3f96337b397b38d26cb248d 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 --- 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); }