X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fcorrelationfunctions%2Fmanyautocorrelation.cpp;fp=src%2Fgromacs%2Fcorrelationfunctions%2Fmanyautocorrelation.c;h=8474c867a35ace234da337d420bee75d393805c8;hb=3dadfbb969e79953a942885fb931908a36fcaf08;hp=c4fb7db465c5716f7d5a32ac7e21759cea165f85;hpb=4bd00f0d606ba94e0e61994c087369ee125297b2;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/correlationfunctions/manyautocorrelation.c b/src/gromacs/correlationfunctions/manyautocorrelation.cpp similarity index 89% rename from src/gromacs/correlationfunctions/manyautocorrelation.c rename to src/gromacs/correlationfunctions/manyautocorrelation.cpp index c4fb7db465..8474c867a3 100644 --- a/src/gromacs/correlationfunctions/manyautocorrelation.c +++ b/src/gromacs/correlationfunctions/manyautocorrelation.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014, by the GROMACS development team, led by + * Copyright (c) 2014,2015, 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. @@ -43,10 +43,13 @@ #include "manyautocorrelation.h" -#include #include #include +#include + +#include + #include "gromacs/fft/fft.h" #include "gromacs/legacyheaders/macros.h" #include "gromacs/utility/gmxomp.h" @@ -57,7 +60,7 @@ int many_auto_correl(int nfunc, int ndata, int nfft, real **c) #pragma omp parallel { typedef real complex[2]; - int i, t, j, fftcode; + int i, j; gmx_fft_t fft1; complex *in, *out; int i0, i1; @@ -70,9 +73,9 @@ int many_auto_correl(int nfunc, int ndata, int nfft, real **c) // fprintf(stderr, "There are %d threads for correlation functions\n", nthreads); } i0 = thread_id*nfunc/nthreads; - i1 = min(nfunc, (thread_id+1)*nfunc/nthreads); + i1 = std::min(nfunc, (thread_id+1)*nfunc/nthreads); - fftcode = gmx_fft_init_1d(&fft1, nfft, GMX_FFT_FLAG_CONSERVATIVE); + gmx_fft_init_1d(&fft1, nfft, GMX_FFT_FLAG_CONSERVATIVE); /* Allocate temporary arrays */ snew(in, nfft); snew(out, nfft); @@ -88,7 +91,7 @@ int many_auto_correl(int nfunc, int ndata, int nfft, real **c) in[j][0] = in[j][1] = 0; } - fftcode = gmx_fft_1d(fft1, GMX_FFT_BACKWARD, (void *)in, (void *)out); + gmx_fft_1d(fft1, GMX_FFT_BACKWARD, (void *)in, (void *)out); for (j = 0; j < nfft; j++) { in[j][0] = (out[j][0]*out[j][0] + out[j][1]*out[j][1])/nfft; @@ -99,7 +102,7 @@ int many_auto_correl(int nfunc, int ndata, int nfft, real **c) in[j][0] = in[j][1] = 0; } - fftcode = gmx_fft_1d(fft1, GMX_FFT_FORWARD, (void *)in, (void *)out); + gmx_fft_1d(fft1, GMX_FFT_FORWARD, (void *)in, (void *)out); for (j = 0; (j < nfft); j++) { c[i][j] = out[j][0]/ndata;