-} t_corr;
-
-typedef real t_calc_func (t_corr *curr, int nx, const int index[], int nx0, rvec xc[],
- const rvec dcom, gmx_bool bTen, matrix mat);
-
-static real thistime(t_corr *curr)
-{
- return curr->time[curr->nframes];
-}
-
-static int in_data(t_corr *curr, int nx00)
-{
- return curr->nframes-curr->n_offs[nx00];
-}
-
-static t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
- int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
- real beginfit, real endfit)
-{
- t_corr *curr;
- int i;
-
- snew(curr, 1);
- curr->type = static_cast<msd_type>(type);
- curr->axis = axis;
- curr->ngrp = nrgrp;
- curr->nrestart = 0;
- curr->delta_t = dt;
- curr->beginfit = (1 - 2*GMX_REAL_EPS)*beginfit;
- curr->endfit = (1 + 2*GMX_REAL_EPS)*endfit;
- curr->x0 = nullptr;
- curr->n_offs = nullptr;
- curr->nframes = 0;
- curr->nlast = 0;
- curr->dim_factor = dim_factor;
-
- snew(curr->ndata, nrgrp);
- snew(curr->data, nrgrp);
- if (bTen)
+ t_corr(int nrgrp, int type, int axis, real dim_factor, int nmol,
+ gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
+ real beginfit, real endfit) :
+ t0(0),
+ delta_t(dt),
+ beginfit((1 - 2*GMX_REAL_EPS)*beginfit),
+ endfit((1 + 2*GMX_REAL_EPS)*endfit),
+ dim_factor(dim_factor),
+ data(nullptr),
+ time(nullptr),
+ mass(nullptr),
+ datam(nullptr),
+ x0(nullptr),
+ com(nullptr),
+ lsq(nullptr),
+ type(static_cast<msd_type>(type)),
+ axis(axis),
+ ncoords(0),
+ nrestart(0),
+ nmol(nmol),
+ nframes(0),
+ nlast(0),
+ ngrp(nrgrp),
+ n_offs(nullptr),
+ ndata(nullptr)