Change initial parameters for testing expfit.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Fri, 31 Jul 2015 14:51:17 +0000 (16:51 +0200)
committerRoland Schulz <roland@rschulz.eu>
Fri, 31 Jul 2015 23:36:23 +0000 (01:36 +0200)
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
src/gromacs/correlationfunctions/tests/expfit.cpp

index 0cc2c148ca0c4be282309d61af26e755e9966d8f..aa1404e1842ccfcc10296f2d4ac3e55afe59f96e 100644 (file)
@@ -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));
                 }
index 74fb2ebd8edf820e391a2713be44ac1b6f219132..657d16ac874e52f70905d0c3209125c6d482ffb6 100644 (file)
@@ -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);
 }