fprintf(stderr, "%-7i",data[i]);
}
-static void normalizeACF(real *ct, real *gt, int len)
+static void normalizeACF(real *ct, real *gt, int nhb, int len)
{
real ct_fac, gt_fac;
int i;
/* Xu and Berne use the same normalization constant */
ct_fac = 1.0/ct[0];
- gt_fac = (gt!=NULL && gt[0]!=0) ? 1.0/gt[0] : 0;
+ gt_fac = (nhb == 0) ? 0 : 1.0/(real)nhb;
+
printf("Normalization for c(t) = %g for gh(t) = %g\n",ct_fac,gt_fac);
for (i=0; i<len; i++)
{
/* ##############################################################/ */
sfree(dondata);
#endif
- normalizeACF(ct, NULL, nn);
+ normalizeACF(ct, NULL, 0, nn);
snew(ctdouble, nn);
snew(timedouble, nn);
for (j=0; j<nn; j++)
sfree(dondata);
#endif /* HAVE_OPENMP =======================================/ */
- normalizeACF(ct, NULL, nn);
+ normalizeACF(ct, NULL, 0, nn);
fprintf(stderr, "\n\nACF successfully calculated.\n");
fprintf(stderr,"\n");
sfree(h);
sfree(g);
- normalizeACF(ct, gt, nn);
+ normalizeACF(ct, ght, nhb, nn);
/* Determine tail value for statistics */
tail = 0;