21 const double CosineDistributionFactor = 1.0 / 3.0 - 2.0 /
M_PI /
M_PI;
56 return 1.0 / (1.0 + sum_sq);
66 return std::make_unique<Distribution1DCauchySampler>(1 /
m_omega);
91 return std::exp(-sum_sq / 2.0);
101 return std::make_unique<Distribution1DGaussSampler>(0.0,
m_omega);
135 return std::make_unique<Distribution1DGateSampler>(-
m_omega,
m_omega);
160 return sincqw2 * sincqw2;
170 return std::make_unique<Distribution1DTriangleSampler>(
m_omega);
194 double qw = std::abs(q *
m_omega);
195 if (std::abs(1.0 - qw * qw /
M_PI /
M_PI) < std::numeric_limits<double>::epsilon())
207 return std::make_unique<Distribution1DCosineSampler>(
m_omega);
216 {
"FTDistribution1DVoigt",
218 {{
"Eta",
"",
"balances between Gauss (eta=0) and Cauchy (eta=1) limiting cases", -
INF,
238 return m_eta * std::exp(-sum_sq / 2.0) + (1.0 -
m_eta) * 1.0 / (1.0 + sum_sq);
250 std::ostringstream ostr;
251 ostr <<
"FTDistribution1DVoigt::createSampler() -> Error in class initialization";
252 ostr <<
"\n\n Has not been implemented yet...stay tuned!";
253 throw std::runtime_error(ostr.str());
Defines M_PI and some more mathematical constants.
Defines interface class IFTDistribution1D, and children thereof.
Defines functions in namespace Math.
NodeMeta nodeMetaUnion(const std::vector< ParaMeta > &base, const NodeMeta &other)
Exponential IFTDistribution1D exp(-|omega*x|); its Fourier transform evaluate(q) is a Cauchy-Lorentzi...
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
FTDistribution1DCauchy * clone() const final
std::unique_ptr< IDistribution1DSampler > createSampler() const final
FTDistribution1DCauchy(const std::vector< double > P)
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
IFTDistribution1D consisting of one cosine wave [1+cos(pi*x/omega) if |x|<omega, and 0 otherwise]; it...
std::unique_ptr< IDistribution1DSampler > createSampler() const final
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
FTDistribution1DCosine * clone() const final
FTDistribution1DCosine(const std::vector< double > P)
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
Square gate IFTDistribution1D; its Fourier transform evaluate(q) is a sinc function starting at evalu...
FTDistribution1DGate * clone() const final
FTDistribution1DGate(const std::vector< double > P)
std::unique_ptr< IDistribution1DSampler > createSampler() const final
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
Gaussian IFTDistribution1D; its Fourier transform evaluate(q) is a Gaussian starting at evaluate(0)=1...
FTDistribution1DGauss(const std::vector< double > P)
std::unique_ptr< IDistribution1DSampler > createSampler() const final
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
FTDistribution1DGauss * clone() const final
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
Triangle IFTDistribution1D [1-|x|/omega if |x|<omega, and 0 otherwise]; its Fourier transform evaluat...
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
FTDistribution1DTriangle(const std::vector< double > P)
FTDistribution1DTriangle * clone() const final
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
std::unique_ptr< IDistribution1DSampler > createSampler() const final
IFTDistribution1D that provides a Fourier transform evaluate(q) in form of a pseudo-Voigt decay funct...
double evaluate(double q) const final
Returns Fourier transform of this distribution; is a decay function starting at evaluate(0)=1.
double qSecondDerivative() const final
Returns the negative of the second order derivative in q space around q=0.
FTDistribution1DVoigt * clone() const final
std::unique_ptr< IDistribution1DSampler > createSampler() const final
FTDistribution1DVoigt(const std::vector< double > P)
Interface for a one-dimensional distribution, with normalization adjusted so that the Fourier transfo...
IFTDistribution1D(const NodeMeta &meta, const std::vector< double > &PValues)
Base class for tree-like structures containing parameterized objects.
double sinc(double x)
sinc function: