*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
#include <math.h>
+#include <stdlib.h>
#include <string.h>
+
#include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "copyrite.h"
-#include "gromacs/fileio/futil.h"
-#include "readinp.h"
-#include "txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
#include "gstat.h"
-#include "gmx_statistics.h"
-#include "xvgr.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/viewit.h"
#include "gmx_ana.h"
#include "geminate.h"
}
fprintf(stdout, "\n");
- ffclose(fp);
+ gmx_ffclose(fp);
}
static void regression_analysis(int n, gmx_bool bXYdy,
int i, s;
double min, max;
int nbin;
-#if (defined SIZEOF_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT >= 8)
- long long int *histo;
-#else
- double *histo;
-#endif
+ gmx_int64_t *histo;
min = val[0][0];
max = val[0][0];
}
if (s < nset-1)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
- ffclose(fp);
+ gmx_ffclose(fp);
}
static int real_comp(const void *a, const void *b)
double av, var, err;
real *tmp = NULL;
- fp = ffopen(avfile, "w");
+ fp = gmx_ffopen(avfile, "w");
if ((avbar_opt == avbarERROR) && (nset == 1))
{
avbar_opt = avbarNONE;
}
fprintf(fp, "\n");
}
- ffclose(fp);
+ gmx_ffclose(fp);
if (avbar_opt == avbar90)
{
}
fprintf(stdout, "Set %3d: err.est. %g a %g tau1 %g tau2 %g\n",
s+1, ee, a, tau1, tau2);
- fprintf(fp, "@ legend string %d \"av %f\"\n", 2*s, av[s]);
- fprintf(fp, "@ legend string %d \"ee %6g\"\n",
- 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ if (output_env_get_xvg_format(oenv) == exvgXMGR)
+ {
+ fprintf(fp, "@ legend string %d \"av %f\"\n", 2*s, av[s]);
+ fprintf(fp, "@ legend string %d \"ee %6g\"\n", 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ }
+ else if (output_env_get_xvg_format(oenv) == exvgXMGRACE)
+ {
+ fprintf(fp, "@ s%d legend \"av %f\"\n", 2*s, av[s]);
+ fprintf(fp, "@ s%d legend \"ee %6g\"\n", 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ }
for (i = 0; i < nbs; i++)
{
fprintf(fp, "%g %g %g\n", tbs[i], sig[s]*sqrt(ybs[i]/(n*dt)),
s+1, sig[s]*anal_ee_inf(ac_fit, n*dt),
ac_fit[1], ac_fit[0], ac_fit[2]);
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
for (i = 0; i < nbs; i++)
{
fprintf(fp, "%g %g\n", tbs[i],
}
if (s < nset-1)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
sfree(fitsig);
sfree(ybs);
sfree(tbs);
- ffclose(fp);
+ gmx_ffclose(fp);
}
static void luzar_correl(int nn, real *time, int nset, real **val, real temp,
if (fitfile != NULL)
{
- out_fit = ffopen(fitfile, "w");
+ out_fit = gmx_ffopen(fitfile, "w");
if (bXYdy && nset >= 2)
{
do_fit(out_fit, 0, TRUE, n, t, val, npargs, ppa, oenv);
do_fit(out_fit, s, FALSE, n, t, val, npargs, ppa, oenv);
}
}
- ffclose(out_fit);
+ gmx_ffclose(out_fit);
}
printf(" std. dev. relative deviation of\n");
}
if (s < nset-1)
{
- fprintf(out, "&\n");
+ fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
- ffclose(out);
+ gmx_ffclose(out);
fprintf(stderr, "\r%d, time=%g\n", j-1, (j-1)*dt);
}
if (ccfile)