Reorganizing analysis of correlation functions.
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_analyze.c
index a2f9799621121539723b8758fdf3377a8a05f378..8d1eab6bee08e2ce8bb27576d8717a506d94a437 100644 (file)
@@ -41,6 +41,9 @@
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/correlationfunctions/integrate.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/geminate.h"
 #include "gromacs/gmxana/gmx_ana.h"
@@ -391,7 +394,7 @@ static void average(const char *avfile, int avbar_opt,
     }
 }
 
-static real anal_ee_inf(real *parm, real T)
+static real anal_ee_inf(double *parm, real T)
 {
     return sqrt(parm[1]*2*parm[0]/T+parm[3]*2*parm[2]/T);
 }
@@ -408,7 +411,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
     double   blav, var;
     char   **leg;
     real    *tbs, *ybs, rtmp, dens, *fitsig, twooe, tau1_est, tau_sig;
-    real     fitparm[4];
+    double   fitparm[4];
     real     ee, a, tau1, tau2;
 
     if (n < 4)
@@ -628,8 +631,9 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
 
         if (bFitAc)
         {
-            int   fitlen;
-            real *ac, acint, ac_fit[4];
+            int    fitlen;
+            real  *ac, acint;
+            double ac_fit[4];
 
             snew(ac, n);
             for (i = 0; i < n; i++)
@@ -787,14 +791,15 @@ static void do_fit(FILE *out, int n, gmx_bool bYdy,
                    int ny, real *x0, real **val,
                    int npargs, t_pargs *ppa, const output_env_t oenv)
 {
-    real *c1 = NULL, *sig = NULL, *fitparm;
-    real  tendfit, tbeginfit;
-    int   i, efitfn, nparm;
+    real   *c1 = NULL, *sig = NULL;
+    double *fitparm;
+    real    tendfit, tbeginfit;
+    int     i, efitfn, nparm;
 
     efitfn = get_acffitfn();
-    nparm  = nfp_ffn[efitfn];
+    nparm  = effnNparams(efitfn);
     fprintf(out, "Will fit to the following function:\n");
-    fprintf(out, "%s\n", longs_ffn[efitfn]);
+    fprintf(out, "%s\n", effnDescription(efitfn));
     c1 = val[n];
     if (bYdy)
     {