15 #ifndef BORNAGAIN_CORE_DETECTOR_CONVOLVE_H
16 #define BORNAGAIN_CORE_DETECTOR_CONVOLVE_H
63 void init(
int h_src,
int w_src,
int h_kernel,
int w_kernel);
Workspace for Fourier convolution.
double * out_src
result of Fourier transformation of source
double * in_src
adjusted input 'source' array
double * in_kernel
adjusted input 'kernel' array
double * dst_fft
result of product of FFT(source) and FFT(kernel)
double * out_kernel
result of Fourier transformation of kernel
Convolution of two real vectors (in 1D or 2D) using Fast Fourier Transform.
EConvolutionMode m_mode
convolution mode
Workspace ws
input and output data for fftw3
std::vector< double1d_t > double2d_t
definition of 2d vector of double
std::vector< size_t > m_implemented_factors
std::vector< double > double1d_t
definition of 1d vector of double
EConvolutionMode
convolution modes use LINEAR_SAME or CIRCULAR_SAME_SHIFTED for maximum performance
@ FFTW_CIRCULAR_SAME_SHIFTED
@ FFTW_LINEAR_SAME_UNPADDED
void init(int h_src, int w_src, int h_kernel, int w_kernel)
prepare arrays for 2D convolution of given vectors
void setMode(EConvolutionMode mode)
Sets convolution mode.
void fftconvolve(const double1d_t &source, const double1d_t &kernel, double1d_t &result)
convolution in 1D
bool is_optimal(int n)
if a number can be factorised using only favorite fftw3 factors
void fftw_circular_convolution(const double2d_t &source, const double2d_t &kernel)
compute circual convolution of source and kernel using fast Fourier transformation
int find_closest_factor(int n)
find closest number X>n that can be factorised according to fftw3 favorite factorisation