Ejemplo n.º 1
0
/*! \brief Routine to compute ACF using FFT. */
static void low_do_four_core(int nfour, int nframes, real c1[], real cfour[],
                             int nCos)
{
    int  i = 0;
    int  fftcode;
    real aver, *ans;

    aver = 0.0;
    switch (nCos)
    {
        case enNorm:
            for (i = 0; (i < nframes); i++)
            {
                aver    += c1[i];
                cfour[i] = c1[i];
            }
            break;
        case enCos:
            for (i = 0; (i < nframes); i++)
            {
                cfour[i] = cos(c1[i]);
            }
            break;
        case enSin:
            for (i = 0; (i < nframes); i++)
            {
                cfour[i] = sin(c1[i]);
            }
            break;
        default:
            gmx_fatal(FARGS, "nCos = %d, %s %d", nCos, __FILE__, __LINE__);
    }

    fftcode = many_auto_correl(1, nframes, nfour, &cfour);
}
Ejemplo n.º 2
0
/*! \brief Routine to compute ACF using FFT. */
static void low_do_four_core(int nframes, real c1[], real cfour[],
                             int nCos)
{
    int  i = 0;
    std::vector<std::vector<real> > data;
    data.resize(1);
    data[0].resize(nframes, 0);
    switch (nCos)
    {
        case enNorm:
            for (i = 0; (i < nframes); i++)
            {
                data[0][i] = c1[i];
            }
            break;
        case enCos:
            for (i = 0; (i < nframes); i++)
            {
                data[0][i] = cos(c1[i]);
            }
            break;
        case enSin:
            for (i = 0; (i < nframes); i++)
            {
                data[0][i] = sin(c1[i]);
            }
            break;
        default:
            gmx_fatal(FARGS, "nCos = %d, %s %d", nCos, __FILE__, __LINE__);
    }

    many_auto_correl(&data);
    for (i = 0; (i < nframes); i++)
    {
        cfour[i] = data[0][i];
    }
}