Gromacs  2025-dev-20240612-66cb22e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
crosscorr.cpp File Reference
#include "gmxpre.h"
#include "crosscorr.h"
#include "gromacs/fft/fft.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/smalloc.h"
+ Include dependency graph for crosscorr.cpp:

Description

Implements routine for computing a cross correlation between two data sets.

Author
David van der Spoel david.nosp@m..van.nosp@m.dersp.nosp@m.oel@.nosp@m.icm.u.nosp@m.u.se

Functions

static int zeroPaddingSize (int n)
 return the size witch the array should be after zero padding More...
 
static void complexConjugatMult (t_complex *in1, t_complex *in2)
 Compute complex conjugate. Output in the first input variable. More...
 
static void cross_corr_low (int n, const real f[], const real g[], real corr[], gmx_fft_t fft)
 Compute one cross correlation corr = f x g using FFT. More...
 
void cross_corr (int n, real f[], real g[], real corr[])
 fft cross correlation algorithm. Computes corr = f (.) g More...
 
void many_cross_corr (int nFunc, int *nData, real **f, real **g, real **corr)
 fft cross correlation algorithm. More...
 

Function Documentation

static void complexConjugatMult ( t_complex *  in1,
t_complex *  in2 
)
static

Compute complex conjugate. Output in the first input variable.

Parameters
[in]in1first complex number
[in]in2second complex number
void cross_corr ( int  n,
real  f[],
real  g[],
real  corr[] 
)

fft cross correlation algorithm. Computes corr = f (.) g

Parameters
[in]nnumber of data point
[in]fFirst function
[in]gSecond function
[out]corrThe cross correlation
static void cross_corr_low ( int  n,
const real  f[],
const real  g[],
real  corr[],
gmx_fft_t  fft 
)
static

Compute one cross correlation corr = f x g using FFT.

Parameters
[in]nnumber of data point
[in]ffirst function
[in]gsecond function
[out]corroutput correlation
[in]fftFFT data structure
void many_cross_corr ( int  nFunc,
int *  nData,
real **  f,
real **  g,
real **  corr 
)

fft cross correlation algorithm.

Computes corr[n] = f[n]i g[n][i], that is for nFunc pairs of arrays n the cross correlation is computed in parallel using OpenMP.

Parameters
[in]nFuncnuber of function to crosscorrelate
[in]nDatanumber of data point in eatch function
[in]f2D array of first function to crosscorrelate
[in]g2D array of second function to crosscorrelate
[out]corr2D array of the cross correlations
static int zeroPaddingSize ( int  n)
static

return the size witch the array should be after zero padding

Parameters
[in]nFactor to multiply by 2
Returns
zeroPaddingSize