BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Enumerations | |
enum | EFFTDirection { FORWARD_FFT , BACKWARD_FFT } |
Functions | |
complex_t | Bessel_J0_PowSer (const complex_t z) |
complex_t | Bessel_J1_PowSer (const complex_t z) |
double | StandardNormal (double x) |
double | Gaussian (double x, double average, double std_dev) |
double | IntegratedGaussian (double x, double average, double std_dev) |
double | cot (double x) |
double | Si (double x) |
double | sinc (double x) |
complex_t | sinc (const complex_t z) |
complex_t | tanhc (const complex_t z) |
double | Laue (const double x, size_t N) |
double | erf (double arg) |
double | Bessel_J0 (double x) |
double | Bessel_J1 (double x) |
double | Bessel_J1c (double x) |
double | Bessel_I0 (double x) |
complex_t | Bessel_J0 (const complex_t z) |
complex_t | Bessel_J1 (const complex_t z) |
complex_t | Bessel_J1c (const complex_t z) |
std::vector< complex_t > | FastFourierTransform (const std::vector< complex_t > &data, EFFTDirection tcase) |
std::vector< complex_t > | FastFourierTransform (const std::vector< double > &data, EFFTDirection tcase) |
std::vector< complex_t > | ConvolveFFT (const std::vector< double > &signal, const std::vector< double > &resfunc) |
double | GenerateUniformRandom () |
double | GenerateStandardNormalRandom () |
double | GenerateNormalRandom (double average, double std_dev) |
double | GeneratePoissonRandom (double average) |
Various mathematical functions.
Computes complex Bessel function J0(z), using power series and asymptotic expansion.
Computes the complex Bessel function J0(z), using power series and asymptotic expansion.
Forked from unoptimized code at http://www.crbond.com/math.htm, who refers to "Computation of Special Functions", Zhang and Jin, John Wiley and Sons, 1996.
Definition at line 163 of file MathFunctions.cpp.
References anonymous_namespace{PolyhedralComponents.cpp}::eps, M_2_PI, and M_PI_4.
Referenced by Bessel_J0().
Computes complex Bessel function J0(z), using power series and asymptotic expansion.
Computes the complex Bessel function J1(z), using power series and asymptotic expansion.
Forked from same source as for Bessel_J0_PowSer
Definition at line 223 of file MathFunctions.cpp.
References anonymous_namespace{PolyhedralComponents.cpp}::eps, M_2_PI, and M_PI.
Referenced by Bessel_J1(), and Bessel_J1c().
double MathFunctions::StandardNormal | ( | double | x | ) |
double MathFunctions::Gaussian | ( | double | x, |
double | average, | ||
double | std_dev | ||
) |
Definition at line 37 of file MathFunctions.cpp.
References StandardNormal().
double MathFunctions::IntegratedGaussian | ( | double | x, |
double | average, | ||
double | std_dev | ||
) |
Definition at line 42 of file MathFunctions.cpp.
Referenced by ResolutionFunction2DGaussian::evaluateCDF().
double MathFunctions::cot | ( | double | x | ) |
cotangent function:
Definition at line 49 of file MathFunctions.cpp.
References M_PI_2.
Referenced by FormFactorAnisoPyramid::onChange(), FormFactorCone::onChange(), FormFactorCone6::onChange(), FormFactorCuboctahedron::onChange(), FormFactorPyramid::onChange(), FormFactorTetrahedron::onChange(), FormFactorAnisoPyramid::sliceFormFactor(), FormFactorCone6::sliceFormFactor(), FormFactorCuboctahedron::sliceFormFactor(), FormFactorPyramid::sliceFormFactor(), and FormFactorTetrahedron::sliceFormFactor().
double MathFunctions::Si | ( | double | x | ) |
Sine integral function: .
Definition at line 54 of file MathFunctions.cpp.
Referenced by SpecularMagneticNewStrategy::calculateUpwards().
double MathFunctions::sinc | ( | double | x | ) |
sinc function:
Definition at line 59 of file MathFunctions.cpp.
References M_PI.
Referenced by PolyhedralFace::edge_sum_ff(), FTDecayFunction1DTriangle::evaluate(), FTDistribution1DGate::evaluate(), FTDistribution1DTriangle::evaluate(), FTDistribution1DCosine::evaluate(), Prism::evaluate_for_q(), FormFactorBox::evaluate_for_q(), FormFactorCylinder::evaluate_for_q(), FormFactorEllipsoidalCylinder::evaluate_for_q(), FormFactorLongBoxGauss::evaluate_for_q(), FormFactorLongBoxLorentz::evaluate_for_q(), ripples::factor_x_box(), ripples::profile_yz_bar(), ripples::profile_yz_cosine(), and ripples::profile_yz_triangular().
Complex tanhc function: .
Definition at line 75 of file MathFunctions.cpp.
Referenced by SpecularMagneticNewTanhStrategy::computeRoughnessMatrix(), and SpecularScalarTanhStrategy::transition().
double MathFunctions::Laue | ( | const double | x, |
size_t | N | ||
) |
Real Laue function: .
Definition at line 82 of file MathFunctions.cpp.
Referenced by InterferenceFunction2DSuperLattice::iff_without_dw(), InterferenceFunctionFinite3DLattice::iff_without_dw(), and InterferenceFunctionFinite2DLattice::interferenceForXi().
double MathFunctions::erf | ( | double | arg | ) |
Error function of real-valued argument.
Definition at line 93 of file MathFunctions.cpp.
Referenced by FootprintGauss::calculate().
double MathFunctions::Bessel_J0 | ( | double | x | ) |
Bessel function of the first kind and order 0.
Definition at line 115 of file MathFunctions.cpp.
Referenced by FTDistribution2DCone::evaluate(), and InterferenceFunctionHardDisk::integrand().
double MathFunctions::Bessel_J1 | ( | double | x | ) |
Bessel function of the first kind and order 1.
Definition at line 120 of file MathFunctions.cpp.
double MathFunctions::Bessel_J1c | ( | double | x | ) |
Bessel function Bessel_J1(x)/x.
Definition at line 125 of file MathFunctions.cpp.
Referenced by FTDistribution2DGate::evaluate(), FTDistribution2DCone::evaluate(), FormFactorCylinder::evaluate_for_q(), FormFactorEllipsoidalCylinder::evaluate_for_q(), FormFactorCone::Integrand(), FormFactorHemiEllipsoid::Integrand(), FormFactorTruncatedSphere::Integrand(), and FormFactorTruncatedSpheroid::Integrand().
double MathFunctions::Bessel_I0 | ( | double | x | ) |
Modified Bessel function of the first kind and order 0.
Definition at line 130 of file MathFunctions.cpp.
Referenced by anonymous_namespace{IPeakShape.cpp}::MisesPrefactor().
Complex Bessel function of the first kind and order 0.
Definition at line 135 of file MathFunctions.cpp.
References Bessel_J0_PowSer().
Complex Bessel function of the first kind and order 1.
Definition at line 142 of file MathFunctions.cpp.
References Bessel_J1_PowSer().
Complex Bessel function Bessel_J1(x)/x.
Definition at line 149 of file MathFunctions.cpp.
References Bessel_J1_PowSer().
std::vector< complex_t > MathFunctions::FastFourierTransform | ( | const std::vector< complex_t > & | data, |
MathFunctions::EFFTDirection | ftCase | ||
) |
simple (and unoptimized) wrapper function for the discrete fast Fourier transformation library (fftw3)
Definition at line 300 of file MathFunctions.cpp.
References BACKWARD_FFT, and FORWARD_FFT.
Referenced by ConvolveFFT(), and FastFourierTransform().
std::vector< complex_t > MathFunctions::FastFourierTransform | ( | const std::vector< double > & | data, |
MathFunctions::EFFTDirection | ftCase | ||
) |
simple (and unoptimized) wrapper function for the discrete fast Fourier transformation library (fftw3); transforms real to complex
Definition at line 349 of file MathFunctions.cpp.
References FastFourierTransform().
std::vector< complex_t > MathFunctions::ConvolveFFT | ( | const std::vector< double > & | signal, |
const std::vector< double > & | resfunc | ||
) |
convolution of two real vectors of equal size
Definition at line 361 of file MathFunctions.cpp.
References BACKWARD_FFT, FastFourierTransform(), and FORWARD_FFT.
double MathFunctions::GenerateUniformRandom | ( | ) |
Definition at line 386 of file MathFunctions.cpp.
double MathFunctions::GenerateStandardNormalRandom | ( | ) |
double MathFunctions::GenerateNormalRandom | ( | double | average, |
double | std_dev | ||
) |
Definition at line 401 of file MathFunctions.cpp.
References GenerateStandardNormalRandom().
double MathFunctions::GeneratePoissonRandom | ( | double | average | ) |
Definition at line 406 of file MathFunctions.cpp.
Referenced by PoissonNoiseBackground::addBackground().