22 #ifndef SIRIUS_UTILS_NUMERIC_H_ 23 #define SIRIUS_UTILS_NUMERIC_H_ 34 int Gcd(
int a,
int b);
39 void FFTShift2D(
const double* data,
const Size& size,
double* shifted_data);
44 void IFFTShift2D(
const double* data,
const Size& size,
double* shifted_data);
54 const Point& hot_point,
double* shifted_data);
65 const Point& hot_point,
double* shifted_data);
73 std::vector<double>
ComputeFFTFreq(
int n_samples,
bool half =
true);
83 const Size& padding_size);
103 std::vector<int>& xx, std::vector<int>& yy);
108 #endif // SIRIUS_UTILS_NUMERIC_H_ void IFFTShift2DUncentered(const double *data, const Size &size, const Point &hot_point, double *shifted_data)
IFFTShift 2D matrix in which hot point is not centered.
std::vector< double > ComputeFFTFreq(int n_samples, bool half=true)
Compute frequencies for which fft will be calculated.
int Gcd(int a, int b)
Compute Gcd of a and b using C++17: will be replaced with std::gcd.
Definition: exception.h:27
Size GenerateDyadicSize(const Size &size, const int res_in, const Size &padding_size)
Rounds the parameters so log2(param) is an int.
void CreateMeshgrid(int x_min, int x_max, int y_min, int y_max, std::vector< int > &xx, std::vector< int > &yy)
Create coordinates vector.
void FFTShift2DUncentered(const double *data, const Size &size, const Point &hot_point, double *shifted_data)
FFTShift 2D matrix in which hot point must remain uncentered after shift.
void IFFTShift2D(const double *data, const Size &size, double *shifted_data)
IFFTShift 2D matrix.
void FFTShift2D(const double *data, const Size &size, double *shifted_data)
FFTShift 2D matrix.
Size GenerateZoomCompliantSize(const Size &size, const ZoomRatio &zoom_r)
Resize given dimensions so it matches with given zoom ratio.