13using namespace CurveFitting;
35 throw std::invalid_argument(
"Can only work with domain of size 4.");
38 if (!m_peakFunction) {
39 throw std::runtime_error(
"IPeakFunction has not been set.");
42 out[0] = m_peakFunction->centre();
43 out[1] = m_peakFunction->height();
44 out[2] = m_peakFunction->fwhm();
45 out[3] = m_peakFunction->intensity();
55 std::shared_ptr<IPeakFunction> peakFunction = std::dynamic_pointer_cast<IPeakFunction>(fn);
58 throw std::invalid_argument(
"Decorated function needs to be an IPeakFunction.");
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Base class that represents the domain of a function.
void calNumericalDeriv(const FunctionDomain &domain, Jacobian &jacobian)
Calculate numerical derivatives.
Represents the Jacobian in IFitFunction::functionDeriv.
void beforeDecoratedFunctionSet(const API::IFunction_sptr &fn) override
Make sure the decorated function is IPeakFunction and store it.
void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override
Uses numerical derivatives to calculate Jacobian of the function.
API::IPeakFunction_sptr m_peakFunction
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class