15 #ifndef BORNAGAIN_CORE_DETECTOR_CONVOLVE_H
16 #define BORNAGAIN_CORE_DETECTOR_CONVOLVE_H
48 FFTW_LINEAR_SAME_UNPADDED,
52 FFTW_CIRCULAR_SAME_SHIFTED,
63 void init(
int h_src,
int w_src,
int h_kernel,
int w_kernel);
73 int find_closest_factor(
int n);
76 bool is_optimal(
int n);
95 int h_kernel, w_kernel;
109 int h_offset, w_offset;
110 fftw_plan p_forw_src;
111 fftw_plan p_forw_kernel;
119 std::vector<size_t> m_implemented_factors;
Convolution of two real vectors (in 1D or 2D) using Fast Fourier Transform.
std::vector< double1d_t > double2d_t
definition of 2d vector of double
std::vector< double > double1d_t
definition of 1d vector of double
EConvolutionMode
convolution modes use LINEAR_SAME or CIRCULAR_SAME_SHIFTED for maximum performance
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