24 const double CosineDistributionFactor = 1.0 / 3.0 - 2.0 /
M_PI /
M_PI;
68 return 1.0 / (1.0 + sum_sq);
74 return m_omega * 2.0 / (1.0 + sum_sq);
84 return std::make_unique<Distribution1DCauchySampler>(1 /
m_omega);
110 return std::exp(-sum_sq / 2.0);
126 return std::make_unique<Distribution1DGaussSampler>(0.0,
m_omega);
166 return std::make_unique<Distribution1DGateSampler>(-
m_omega,
m_omega);
192 return sincqw2 * sincqw2;
198 return m_omega * sincqw2 * sincqw2;
208 return std::make_unique<Distribution1DTriangleSampler>(
m_omega);
233 double qw = std::abs(q *
m_omega);
234 if (std::abs(1.0 - qw * qw /
M_PI /
M_PI) < std::numeric_limits<double>::epsilon())
251 return std::make_unique<Distribution1DCosineSampler>(
m_omega);
278 return m_eta * std::exp(-sum_sq / 2.0) + (1.0 -
m_eta) * 1.0 / (1.0 + sum_sq);
297 std::ostringstream ostr;
298 ostr <<
"Profile1DVoigt::createSampler() -> Error in class initialization";
299 ostr <<
"\n\n Has not been implemented yet...stay tuned!";
300 throw std::runtime_error(ostr.str());
Defines the macro ASSERT.
#define ASSERT(condition)
Defines M_PI and some more mathematical constants.
Defines interface class IProfile1D, 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 a one-dimensional distribution, with normalization adjusted so that the Fourier transfo...
virtual std::string pythonConstructor() const
Creates the Python constructor of this class (or derived classes)
IProfile1D(const std::vector< double > &PValues)
Exponential IProfile1D exp(-|omega*x|); its Fourier transform standardizedFT(q) is a Cauchy-Lorentzia...
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
Profile1DCauchy * clone() const override
std::unique_ptr< IDistribution1DSampler > createSampler() const override
Profile1DCauchy(std::vector< double > P)
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
IProfile1D consisting of one cosine wave [1+cos(pi*x/omega) if |x|<omega, and 0 otherwise]; its Fouri...
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
Profile1DCosine * clone() const override
Profile1DCosine(std::vector< double > P)
std::unique_ptr< IDistribution1DSampler > createSampler() const override
Square gate IProfile1D; its Fourier transform standardizedFT(q) is a sinc function starting at standa...
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
std::unique_ptr< IDistribution1DSampler > createSampler() const override
Profile1DGate(std::vector< double > P)
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
Profile1DGate * clone() const override
Gaussian IProfile1D; its Fourier transform standardizedFT(q) is a Gaussian starting at standardizedFT...
Profile1DGauss(std::vector< double > P)
Profile1DGauss * clone() const override
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
std::unique_ptr< IDistribution1DSampler > createSampler() const override
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
Triangle IProfile1D [1-|x|/omega if |x|<omega, and 0 otherwise]; its Fourier transform standardizedFT...
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
Profile1DTriangle(std::vector< double > P)
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
std::unique_ptr< IDistribution1DSampler > createSampler() const override
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
Profile1DTriangle * clone() const override
IProfile1D that provides a Fourier transform standardizedFT(q) in form of a pseudo-Voigt decay functi...
Profile1DVoigt * clone() const override
double standardizedFT(double q) const override
Returns Fourier transform of the normalized distribution; is a decay function starting at standardize...
std::string pythonConstructor() const override
Creates the Python constructor of this class (or derived classes)
double decayFT(double q) const override
Returns Fourier transform of the distribution scaled as decay function f(x)/f(0).
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Profile1DVoigt(std::vector< double > P)
double qSecondDerivative() const override
Returns the negative of the second order derivative in q space around q=0.
std::unique_ptr< IDistribution1DSampler > createSampler() const override
double sinc(double x)
sinc function:
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(),...