15 #ifndef BORNAGAIN_BASE_UTILS_MATHFUNCTIONS_H
16 #define BORNAGAIN_BASE_UTILS_MATHFUNCTIONS_H
30 double StandardNormal(
double x);
31 double Gaussian(
double x,
double average,
double std_dev);
32 double IntegratedGaussian(
double x,
double average,
double std_dev);
41 double sinc(
double x);
44 complex_t
sinc(
const complex_t z);
47 complex_t
tanhc(
const complex_t z);
50 double Laue(
const double x,
size_t N);
53 double erf(
double arg);
86 enum EFFTDirection { FORWARD_FFT, BACKWARD_FFT };
91 std::vector<complex_t>
FastFourierTransform(
const std::vector<double>& data, EFFTDirection tcase);
93 std::vector<complex_t>
ConvolveFFT(
const std::vector<double>& signal,
94 const std::vector<double>& resfunc);
100 double GenerateUniformRandom();
101 double GenerateStandardNormalRandom();
102 double GenerateNormalRandom(
double average,
double std_dev);
103 double GeneratePoissonRandom(
double average);
Defines complex_t, and a few elementary functions.
Various mathematical functions.
double cot(double x)
cotangent function:
std::vector< complex_t > FastFourierTransform(const std::vector< complex_t > &data, EFFTDirection tcase)
simple (and unoptimized) wrapper function for the discrete fast Fourier transformation library (fftw3...
double Laue(const double x, size_t N)
Real Laue function: .
std::vector< complex_t > ConvolveFFT(const std::vector< double > &signal, const std::vector< double > &resfunc)
convolution of two real vectors of equal size
double sinc(double x)
sinc function:
complex_t tanhc(const complex_t z)
Complex tanhc function: .
double Bessel_J0(double x)
Bessel function of the first kind and order 0.
double Bessel_J1(double x)
Bessel function of the first kind and order 1.
double Bessel_J1c(double x)
Bessel function Bessel_J1(x)/x.
double erf(double arg)
Error function of real-valued argument.
double Si(double x)
Sine integral function: .
double Bessel_I0(double x)
Modified Bessel function of the first kind and order 0.