13#include "boost/shared_ptr.hpp"
22 double get(
size_t iY,
size_t iP)
override {
return m_J[iY *
m_p + iP]; }
24 double max = -DBL_MAX;
26 for (
size_t i = 0; i <
m_p; ++i) {
27 double current =
get(iY, i);
41 std::vector<double>
m_J;
59 virtual double fwhm()
const = 0;
65 virtual double intensity()
const;
73 virtual double intensityError()
const;
76 virtual void setIntensity(
const double newIntensity);
79 void setParameter(
const std::string &name,
const double &
value,
bool explicitlySet =
true)
override;
82 void setParameter(
size_t,
const double &
value,
bool explicitlySet =
true)
override;
85 void function1D(
double *out,
const double *xValues,
const size_t nData)
const override;
87 void functionDeriv1D(
Jacobian *out,
const double *xValues,
const size_t nData)
override;
91 virtual std::pair<double, double> getDomainInterval(
double level = DEFAULT_SEARCH_LEVEL)
const;
94 virtual void functionLocal(
double *out,
const double *xValues,
const size_t nData)
const = 0;
96 virtual void functionDerivLocal(
Jacobian *jacobian,
const double *xValues,
const size_t nData);
99 std::string getCentreParameterName()
const;
116 throw std::runtime_error(
"Generic intensity fixing isn't implemented for this function.");
121 throw std::runtime_error(
"Generic intensity fixing isn't implemented for this function.");
129 void setPeakRadius(
int r)
const;
134 static constexpr double DEFAULT_SEARCH_LEVEL = 1e-5;
136 mutable boost::shared_ptr<IntegrationResultCache> integrationResult =
nullptr;
138 mutable bool m_parameterContextDirty =
false;
double value
The value of the point.
#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.
A class to store values calculated by a function.
An interface to a function with location, which here means a function for which the user may ask what...
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
virtual std::string getWidthParameterName() const
Get the name of the parameter that is changed when the fwhm is changed.
virtual void functionLocal(double *out, const double *xValues, const size_t nData) const =0
Function evaluation method to be implemented in the inherited classes.
virtual double fwhm() const =0
Returns the peak FWHM.
virtual void setFwhm(const double w)=0
Sets the parameters such that FWHM = w.
virtual void fixIntensity(bool isDefault=false)
Fix a parameter or set up a tie such that value returned by intensity() is constant during fitting.
virtual void unfixIntensity()
Free the intensity parameter.
int m_peakRadius
Defines the area around the centre where the peak values are to be calculated (in FWHM).
Represents the Jacobian in IFitFunction::functionDeriv.
size_t maxParam(size_t iY)
std::vector< double > m_J
double get(size_t iY, size_t iP) override
Get the value to a Jacobian matrix element.
void set(size_t iY, size_t iP, double value) override
Set a value to a Jacobian matrix element.
TempJacobian(size_t y, size_t p)
void zero() override
Zero all matrix elements.
std::shared_ptr< IPeakFunction > IPeakFunction_sptr
std::pair< double, double > IntegrationResultCache
std::shared_ptr< const IPeakFunction > IPeakFunction_const_sptr
Helper class which provides the Collimation Length for SANS instruments.