68 return std::pow(1.0 +
sumsq(qx, qy), -1.5);
104 return std::exp(-
sumsq(qx, qy) / 2);
140 double scaled_q = std::sqrt(
sumsq(qx, qy));
176 double scaled_q = std::sqrt(
sumsq(qx, qy));
177 if (scaled_q < std::numeric_limits<double>::epsilon())
178 return 1.0 - 3.0 * scaled_q * scaled_q / 40.0;
181 [](
double x) ->
double {
return x * x *
Math::Bessel::J0(x); }, 0.0, scaled_q);
182 return 6.0 * (
Math::Bessel::J1c(scaled_q) - integral / scaled_q / scaled_q / scaled_q);
218 double sum_sq =
sumsq(qx, qy);
219 return m_eta * std::exp(-sum_sq / 2) + (1.0 -
m_eta) * std::pow(1.0 + sum_sq, -1.5);
226 * (
m_eta * std::exp(-sum_sq / 2.0) + (1.0 -
m_eta) * std::pow(1.0 + sum_sq, -1.5));
233 std::ostringstream ostr;
234 ostr <<
"Profile2DVoigt::createSampler() -> Error in class initialization";
235 ostr <<
"\n\n Has not been implemented yet...stay tuned!";
236 throw std::runtime_error(ostr.str());
Defines the macro ASSERT.
#define ASSERT(condition)
Defines Bessel functions in namespace Math.
Defines classes RealIntegrator, ComplexIntegrator.
Defines interface class IProfile2D, and children thereof.
Base class for tree-like structures containing parameterized objects.
void checkNodeArgs() const
Raises exception if a parameter value is invalid.
std::vector< double > m_P
virtual std::string className() const =0
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Interface for two-dimensional distributions in Fourier space.
IProfile2D(const std::vector< double > &PValues)
double sumsq(double qx, double qy) const
virtual std::string pythonConstructor() const
Creates the Python constructor of this class (or derived classes)
Two-dimensional Cauchy distribution in Fourier space; corresponds to a normalized exp(-r) in real spa...
std::unique_ptr< IDistribution2DSampler > createSampler() const override
Profile2DCauchy(std::vector< double > P)
double decayFT2D(double qx, double qy) const override
double standardizedFT2D(double qx, double qy) const override
Fourier transformed distribution for q in X,Y coordinates the original distribution (in real space) i...
Profile2DCauchy * clone() const override
Two-dimensional cone distribution in Fourier space; corresponds to 1-r if r<1 (and 0 otherwise) in re...
Profile2DCone(std::vector< double > P)
double standardizedFT2D(double qx, double qy) const override
Fourier transformed distribution for q in X,Y coordinates the original distribution (in real space) i...
std::unique_ptr< IDistribution2DSampler > createSampler() const override
Profile2DCone * clone() const override
double decayFT2D(double qx, double qy) const override
Two-dimensional gate distribution in Fourier space; corresponds to normalized constant if r<1 (and 0 ...
Profile2DGate(std::vector< double > P)
std::unique_ptr< IDistribution2DSampler > createSampler() const override
double standardizedFT2D(double qx, double qy) const override
Fourier transformed distribution for q in X,Y coordinates the original distribution (in real space) i...
Profile2DGate * clone() const override
double decayFT2D(double qx, double qy) const override
Two-dimensional Gauss distribution in Fourier space; corresponds to normalized exp(-r^2/2) in real sp...
double standardizedFT2D(double qx, double qy) const override
Fourier transformed distribution for q in X,Y coordinates the original distribution (in real space) i...
double decayFT2D(double qx, double qy) const override
Profile2DGauss(std::vector< double > P)
Profile2DGauss * clone() const override
std::unique_ptr< IDistribution2DSampler > createSampler() const override
Two-dimensional Voigt distribution in Fourier space; corresponds to eta*Gauss + (1-eta)*Cauchy.
std::unique_ptr< IDistribution2DSampler > createSampler() const override
double decayFT2D(double qx, double qy) const override
double standardizedFT2D(double qx, double qy) const override
Fourier transformed distribution for q in X,Y coordinates the original distribution (in real space) i...
Profile2DVoigt(std::vector< double > P)
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Profile2DVoigt * clone() const override
std::string pythonConstructor() const override
Creates the Python constructor of this class (or derived classes)
To integrate a real function of a real variable.
double integrate(const std::function< double(double)> &f, double lmin, double lmax)
double J0(double x)
Bessel function of the first kind and order 0.
double J1c(double x)
Bessel function J1(x)/x.
std::string printFunction(const std::string &name, const std::vector< std::pair< double, std::string >> &arguments)
Print a function in the form "<name>(<arguments>)". arguments will be processed by printArguments(),...