17#include <boost/math/special_functions/bessel.hpp>
38 declareParameter(
"Radius", 2.0,
"Sphere radius");
47 auto HeightConstraint = std::make_unique<BConstraint>(
this,
"Height", std::numeric_limits<double>::epsilon(),
true);
50 auto RadiusConstraint = std::make_unique<BConstraint>(
this,
"Radius", std::numeric_limits<double>::epsilon(),
true);
62 if (R < std::numeric_limits<double>::epsilon()) {
63 return std::numeric_limits<double>::infinity();
66 return pow(3 * boost::math::sph_bessel(1, Q * R) / (Q * R), 2);
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
double asDouble() const
Returns double value if attribute is a double, throws exception otherwise.
virtual Attribute getAttribute(const std::string &name) const
Return a value of attribute attName.
virtual void addConstraint(std::unique_ptr< IConstraint > ic)
Add a constraint to function.
double getParameter(size_t i) const override
Get i-th parameter.
A boundary constraint is designed to be used to set either upper or lower (or both) boundaries on a s...
Elastic part of the DiffSphere function.
double HeightPrefactor() const override
A rescaling of the peak intensity.
void init() override
overwrite IFunction base class method, which declare function parameters
virtual void declareAttributes() override
declare commonattributes Q and WorkspaceIndex.
The Logger class is in charge of the publishing messages from the framework through various channels.