Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::API::ParamFunction Class Reference

Implements the part of IFunction interface dealing with parameters. More...

#include <ParamFunction.h>

Inheritance diagram for Mantid::API::ParamFunction:
Mantid::API::IFunction Mantid::API::IFunctionWithLocation Mantid::API::IPowderDiffPeakFunction Mantid::Crystal::PeakHKLErrors Mantid::Crystal::SCDCalibratePanels2ObjFunc Mantid::Crystal::SCDPanelErrors Mantid::CurveFitting::Functions::Abragam Mantid::CurveFitting::Functions::BivariateNormal Mantid::CurveFitting::Functions::ComptonPeakProfile Mantid::CurveFitting::Functions::ComptonProfile Mantid::CurveFitting::Functions::ConvTempCorrection Mantid::CurveFitting::Functions::CrystalFieldHeatCapacityCalculation Mantid::CurveFitting::Functions::CrystalFieldMagnetisationCalculation Mantid::CurveFitting::Functions::CrystalFieldMomentCalculation Mantid::CurveFitting::Functions::CrystalFieldPeaksBase Mantid::CurveFitting::Functions::CrystalFieldPhysPropControl Mantid::CurveFitting::Functions::CrystalFieldSpectrumControl Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityCalculation Mantid::CurveFitting::Functions::DynamicKuboToyabe Mantid::CurveFitting::Functions::EndErfc Mantid::CurveFitting::Functions::ExpDecay Mantid::CurveFitting::Functions::ExpDecayMuon Mantid::CurveFitting::Functions::ExpDecayOsc Mantid::CurveFitting::Functions::FunctionQDepends Mantid::CurveFitting::Functions::GausDecay Mantid::CurveFitting::Functions::GausOsc Mantid::CurveFitting::Functions::GramCharlier Mantid::CurveFitting::Functions::InelasticIsoRotDiff Mantid::CurveFitting::Functions::Keren Mantid::CurveFitting::Functions::LogNormal Mantid::CurveFitting::Functions::MuonFInteraction Mantid::CurveFitting::Functions::PawleyParameterFunction Mantid::CurveFitting::Functions::ProductLinearExp Mantid::CurveFitting::Functions::ProductQuadraticExp Mantid::CurveFitting::Functions::ReflectivityMulf Mantid::CurveFitting::Functions::Resolution Mantid::CurveFitting::Functions::StaticKuboToyabe Mantid::CurveFitting::Functions::StaticKuboToyabeTimesExpDecay Mantid::CurveFitting::Functions::StaticKuboToyabeTimesGausDecay Mantid::CurveFitting::Functions::StaticKuboToyabeTimesStretchExp Mantid::CurveFitting::Functions::StretchExp Mantid::CurveFitting::Functions::StretchExpMuon Mantid::CurveFitting::Functions::TabulatedFunction Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction Mantid::CurveFitting::Functions::UserFunction Mantid::CurveFitting::Functions::VesuvioResolution Mantid::FrameworkTestHelpers::FunctionChangesNParams Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function Mantid::MDAlgorithms::UserFunctionMD Mantid::PythonInterface::IFunction1DAdapter

Public Member Functions

IFunction_sptr getContainingFunction (const ParameterReference &ref) const
 Get the containing function. More...
 
IFunction_sptr getContainingFunction (IFunction_sptr fun)
 Get the containing function. More...
 
double getError (const std::string &name) const override
 Get the fitting error for a parameter by name. More...
 
double getError (size_t i) const override
 Get the fitting error for a parameter. More...
 
double getParameter (const std::string &name) const override
 Get parameter by name. More...
 
double getParameter (size_t i) const override
 Get i-th parameter. More...
 
size_t getParameterIndex (const ParameterReference &ref) const override
 Return parameter index from a parameter reference. More...
 
bool hasParameter (const std::string &name) const override
 Check if function has a parameter with this name. More...
 
bool isExplicitlySet (size_t i) const override
 Checks if a parameter has been set explicitly. More...
 
size_t nParams () const override
 Total number of parameters. More...
 
std::string parameterDescription (size_t i) const override
 Returns the description of parameter i. More...
 
size_t parameterIndex (const std::string &name) const override
 Returns the index of parameter name. More...
 
std::string parameterName (size_t i) const override
 Returns the name of parameter i. More...
 
 ParamFunction ()
 Default constructor. More...
 
void setError (const std::string &name, double err) override
 Set the fitting error for a parameter by name. More...
 
void setError (size_t i, double err) override
 Set the fitting error for a parameter. More...
 
void setParameter (const std::string &name, const double &value, bool explicitlySet=true) override
 Set parameter by name. More...
 
void setParameter (size_t, const double &value, bool explicitlySet=true) override
 Set i-th parameter. More...
 
void setParameterDescription (const std::string &name, const std::string &description) override
 Set description of parameter by name. More...
 
void setParameterDescription (size_t, const std::string &description) override
 Set i-th parameter description. More...
 
- Public Member Functions inherited from Mantid::API::IFunction
std::string asString () const
 Writes itself into a string. More...
 
bool cancellationRequestReceived () const
 Returns true if a progress reporter is set & evalaution has been requested to stop. More...
 
virtual const std::vector< std::string > categories () const
 Function to return all of the categories that contain this algorithm. More...
 
virtual const std::string category () const
 The categories the Fit function belong to. More...
 
virtual const std::string categorySeparator () const
 Function to return the sperator token for the category string. More...
 
virtual std::shared_ptr< IFunctionclone () const
 Virtual copy constructor. More...
 
virtual int64_t estimateNoProgressCalls () const
 Returns an estimate of the number of progress reports a single evaluation of the function will have. More...
 
virtual void function (const FunctionDomain &domain, FunctionValues &values) const =0
 Evaluates the function for all arguments in the domain. More...
 
virtual void functionDeriv (const FunctionDomain &domain, Jacobian &jacobian)
 Derivatives of function with respect to active parameters. More...
 
 IFunction ()
 Constructor. More...
 
 IFunction (const IFunction &)=delete
 No copying. More...
 
virtual void initialize ()
 Iinialize the function. More...
 
virtual void iterationFinished ()
 Called at the end of an iteration. More...
 
virtual void iterationStarting ()
 Called at the start of each iteration. More...
 
virtual std::string name () const =0
 Returns the function's name. More...
 
IFunctionoperator= (const IFunction &)=delete
 No copying. More...
 
virtual void registerFunctionUsage (bool internal)
 Registers the usage of the algorithm with the UsageService. More...
 
void reportProgress (const std::string &msg="") const
 Reports progress with an optional message. More...
 
virtual void setMatrixWorkspace (std::shared_ptr< const API::MatrixWorkspace > workspace, size_t wi, double startX, double endX)
 Set matrix workspace. More...
 
void setProgressReporter (std::shared_ptr< Kernel::ProgressBase > reporter)
 Attach a progress reporter. More...
 
virtual void setWorkspace (std::shared_ptr< const Workspace > ws)
 Set the workspace. More...
 
virtual ~IFunction ()
 Virtual destructor. More...
 
bool isFixed (size_t i) const
 Check if a parameter i is fixed. More...
 
bool isFixedByDefault (size_t i) const
 Check if a parameter i is fixed by default (not by user). More...
 
void fix (size_t i, bool isDefault=false)
 Removes a parameter i from the list of active. More...
 
void unfix (size_t i)
 Restores a declared parameter i to the active status. More...
 
void fixParameter (const std::string &name, bool isDefault=false)
 Fix a parameter. More...
 
void unfixParameter (const std::string &name)
 Free a parameter. More...
 
void fixAll (bool isDefault=false)
 Fix all parameters. More...
 
void unfixAll ()
 Free all parameters. More...
 
void unfixAllDefault ()
 Free all parameters fixed by default. More...
 
void fixAllActive (bool isDefault=false)
 Fix all active parameters. More...
 
std::vector< std::string > getParameterNames () const
 Return a vector with all parameter names. More...
 
virtual double activeParameter (size_t i) const
 Value of i-th active parameter. More...
 
virtual void setActiveParameter (size_t i, double value)
 Set new value of i-th active parameter. More...
 
virtual std::string nameOfActive (size_t i) const
 Returns the name of active parameter i. More...
 
virtual std::string descriptionOfActive (size_t i) const
 Returns the name of active parameter i. More...
 
bool isActive (size_t i) const
 Check if an active parameter i is actually active. More...
 
virtual void tie (const std::string &parName, const std::string &expr, bool isDefault=false)
 Tie a parameter to other parameters (or a constant) More...
 
virtual void addTies (const std::string &ties, bool isDefault=false)
 Add several ties. More...
 
virtual void applyTies ()
 Apply the ties. More...
 
virtual void removeTie (const std::string &parName)
 Removes the tie off a parameter. More...
 
virtual void clearTies ()
 Remove all ties. More...
 
virtual bool removeTie (size_t i)
 Removes i-th parameter's tie. More...
 
virtual ParameterTiegetTie (size_t i) const
 Get the tie of i-th parameter. More...
 
virtual bool ignoreTie (const ParameterTie &) const
 Ignore a tie. More...
 
void sortTies ()
 Put all ties in order in which they will be applied correctly. More...
 
std::string writeTies () const
 Write a parameter tie to a string. More...
 
virtual void addConstraints (const std::string &str, bool isDefault=false)
 Add a list of conatraints from a string. More...
 
virtual void addConstraint (std::unique_ptr< IConstraint > ic)
 Add a constraint to function. More...
 
virtual IConstraintgetConstraint (size_t i) const
 Get constraint of i-th parameter. More...
 
virtual void removeConstraint (const std::string &parName)
 Remove a constraint. More...
 
virtual void setConstraintPenaltyFactor (const std::string &parName, const double &c)
 Set a constraint penalty. More...
 
std::string writeConstraints () const
 Write a parameter constraint to a string. More...
 
virtual void clearConstraints ()
 Remove all constraints. More...
 
virtual size_t nAttributes () const
 Returns the number of attributes associated with the function. More...
 
virtual std::vector< std::string > getAttributeNames () const
 Returns a list of attribute names. More...
 
virtual std::string attributeName (size_t index) const
 Get name of ith attribute. More...
 
virtual Attribute getAttribute (const std::string &name) const
 Return a value of attribute attName. More...
 
virtual void setAttribute (const std::string &name, const Attribute &)
 Set a value to attribute attName. More...
 
virtual bool hasAttribute (const std::string &name) const
 Check if attribute attName exists. More...
 
template<typename T >
void setAttributeValue (const std::string &attName, const T &value)
 Set an attribute value. More...
 
void setAttributeValue (const std::string &attName, const char *value)
 Overload for const char* values. More...
 
void setAttributeValue (const std::string &attName, const std::string &value)
 Set string attribute by value. More...
 
virtual std::shared_ptr< IFunctiongetFunction (size_t i) const
 Returns the pointer to i-th child function. More...
 
virtual std::size_t nFunctions () const
 Number of child functions. More...
 
virtual void setUpForFit ()
 Set up the function for a fit. More...
 
virtual size_t getValuesSize (const FunctionDomain &domain) const
 Get number of values for a given domain. More...
 
virtual size_t getNumberDomains () const
 Get number of domains required by this function. More...
 
virtual std::vector< std::shared_ptr< IFunction > > createEquivalentFunctions () const
 Split this function (if needed) into a list of independent functions. More...
 
void calNumericalDeriv (const FunctionDomain &domain, Jacobian &jacobian)
 Calculate numerical derivatives. More...
 
double calculateStepSize (const double parameterValue) const
 Calculate step size for the given parameter value. More...
 
void setCovarianceMatrix (const std::shared_ptr< Kernel::Matrix< double > > &covar)
 Set the covariance matrix. More...
 
std::shared_ptr< const Kernel::Matrix< double > > getCovarianceMatrix () const
 Get the covariance matrix. More...
 
void setReducedChiSquared (double chi2)
 Set the reduced chi^2. More...
 
double getReducedChiSquared () const
 Get the reduced chi^2. More...
 
void setParallel (bool on)
 Set the parallel hint. More...
 
bool isParallel () const
 Get the parallel hint. More...
 
void setHandler (std::unique_ptr< FunctionHandler > handler)
 Set a function handler. More...
 
FunctionHandlergetHandler () const
 Return the handler. More...
 
virtual void setStepSizeMethod (const StepSizeMethod method)
 Sets the StepSizeMethod to use when calculation the step size. More...
 

Protected Member Functions

void clearAllParameters ()
 Nonvirtual member which removes all declared parameters. More...
 
void declareParameter (const std::string &name, double initValue=0, const std::string &description="") override
 Declare a new parameter. More...
 
virtual double * getParameterAddress (size_t i)
 Get the address of the parameter. For use in UserFunction with mu::Parser. More...
 
ParameterStatus getParameterStatus (size_t i) const override
 Get status of parameter. More...
 
void setParameterStatus (size_t i, ParameterStatus status) override
 Change status of parameter. More...
 
- Protected Member Functions inherited from Mantid::API::IFunction
virtual void init ()
 Function initialization. Declare function parameters in this method. More...
 
double convertValue (double value, Kernel::Unit_sptr &outUnit, const std::shared_ptr< const MatrixWorkspace > &ws, size_t wsIndex) const
 Convert a value from one unit (inUnit) to unit defined in workspace (ws) More...
 
void convertValue (std::vector< double > &values, Kernel::Unit_sptr &outUnit, const std::shared_ptr< const MatrixWorkspace > &ws, size_t wsIndex) const
 Convert values from unit defined in workspace (ws) to outUnit. More...
 
virtual void declareAttributes ()
 Override to declare function attributes. More...
 
virtual void declareParameters ()
 Override to declare function parameters. More...
 
void declareAttribute (const std::string &name, const API::IFunction::Attribute &defaultValue)
 Declare a single attribute. More...
 
void declareAttribute (const std::string &name, const API::IFunction::Attribute &defaultValue, const Kernel::IValidator &validator)
 Declare a single attribute with validator. More...
 
void checkAttributeName (const std::string &name)
 Check Attribute to declare does not already exist. More...
 
void storeAttributeValue (const std::string &name, const API::IFunction::Attribute &value)
 Store an attribute's value. More...
 
void storeReadOnlyAttribute (const std::string &name, const API::IFunction::Attribute &value) const
 A read-only ("mutable") attribute can be stored in a const method. More...
 
virtual void addTie (std::unique_ptr< ParameterTie > tie)
 Add a new tie. Derived classes must provide storage for ties. More...
 
bool hasOrderedTies () const
 
void applyOrderedTies ()
 
virtual std::string writeToString (const std::string &parentLocalAttributesStr="") const
 Writes itself into a string. More...
 

Private Member Functions

void checkParameterIndex (size_t i) const
 Check that a parameter index is in a valid range. More...
 

Private Attributes

std::vector< double > m_errors
 Keeps parameter errors. More...
 
std::vector< bool > m_explicitlySet
 Flags of explicitly set parameters. More...
 
std::vector< std::string > m_parameterDescriptions
 parameter descriptions More...
 
std::vector< std::string > m_parameterNames
 Keeps parameter names. More...
 
std::vector< double > m_parameters
 Keeps parameter values. More...
 
std::vector< ParameterStatusm_parameterStatus
 Keeps status for each parameter. More...
 

Additional Inherited Members

- Public Types inherited from Mantid::API::IFunction
enum  ParameterStatus { Active , Fixed , FixedByDefault , Tied }
 Describe parameter status in relation to fitting: Active: Fit varies such parameter directly. More...
 
enum class  StepSizeMethod { DEFAULT , SQRT_EPSILON }
 Describes the method in which the step size will be calculated: DEFAULT: Uses the traditional Mantid method of calculating the step size. More...
 
- Protected Attributes inherited from Mantid::API::IFunction
bool m_isParallel
 Flag to hint that the function is being used in parallel computations. More...
 
std::unique_ptr< FunctionHandlerm_handler
 Pointer to a function handler. More...
 
std::shared_ptr< Kernel::ProgressBasem_progReporter
 Pointer to the progress handler. More...
 

Detailed Description

Implements the part of IFunction interface dealing with parameters.

This function has parameters of its own as opposed to a CompositeFunction which list of parameters consists only of parameters of the member functions.

Author
Roman Tolchenov, Tessella Support Services plc
Date
13/01/2011

Definition at line 33 of file ParamFunction.h.

Constructor & Destructor Documentation

◆ ParamFunction()

Mantid::API::ParamFunction::ParamFunction ( )
inline

Default constructor.

Definition at line 36 of file ParamFunction.h.

Member Function Documentation

◆ checkParameterIndex()

void Mantid::API::ParamFunction::checkParameterIndex ( size_t  i) const
inlineprivate

Check that a parameter index is in a valid range.

Parameters
i:: Index to check.

Definition at line 94 of file ParamFunction.h.

References std::to_string().

Referenced by getError(), getParameter(), getParameterAddress(), getParameterStatus(), isExplicitlySet(), parameterDescription(), parameterName(), setError(), setParameterDescription(), and setParameterStatus().

◆ clearAllParameters()

void Mantid::API::ParamFunction::clearAllParameters ( )
protected

◆ declareParameter()

void Mantid::API::ParamFunction::declareParameter ( const std::string &  name,
double  initValue = 0,
const std::string &  description = "" 
)
overrideprotectedvirtual

Declare a new parameter.

To used in the implementation'c constructor.

Parameters
name:: The parameter name.
initValue:: The initial value for the parameter
description:: The description for the parameter

Implements Mantid::API::IFunction.

Definition at line 239 of file ParamFunction.cpp.

References Mantid::API::IFunction::Active, m_errors, m_explicitlySet, m_parameterDescriptions, m_parameterNames, m_parameters, m_parameterStatus, and Mantid::API::IFunction::name().

Referenced by Mantid::CurveFitting::Functions::UserFunction::AddVariable(), Mantid::MDAlgorithms::UserFunctionMD::AddVariable(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::CrystalFieldPeaksBase(), Mantid::CurveFitting::Functions::CrystalFieldSpectrumControl::CrystalFieldSpectrumControl(), Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityCalculation::CrystalFieldSusceptibilityCalculation(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::declareGramCharlierParameters(), Mantid::CurveFitting::Functions::ComptonPeakProfile::declareParameters(), Mantid::CurveFitting::Functions::ComptonProfile::declareParameters(), Mantid::CurveFitting::Functions::GaussianComptonProfile::declareParameters(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::declareParameters(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::declareParameters(), Mantid::CurveFitting::Functions::Voigt::declareParameters(), Mantid::FrameworkTestHelpers::FunctionChangesNParams::FunctionChangesNParams(), Mantid::Crystal::PeakHKLErrors::init(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::init(), Mantid::CurveFitting::Functions::BivariateNormal::init(), Mantid::CurveFitting::Functions::FlatBackground::init(), Mantid::CurveFitting::Functions::Gaussian::init(), Mantid::CurveFitting::Functions::Lorentzian::init(), Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt::init(), Mantid::CurveFitting::Functions::ReflectivityMulf::init(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::init(), Mantid::FrameworkTestHelpers::FunctionChangesNParams::iterationFinished(), Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function::MultiDomainFunctionTest_Function(), Mantid::CurveFitting::Functions::BSpline::resetParameters(), Mantid::Crystal::SCDPanelErrors::SCDPanelErrors(), Mantid::CurveFitting::Functions::Chebyshev::setAttribute(), Mantid::CurveFitting::Functions::CubicSpline::setAttribute(), Mantid::CurveFitting::Functions::FullprofPolynomial::setAttribute(), Mantid::CurveFitting::Functions::Polynomial::setAttribute(), Mantid::CurveFitting::Functions::ReflectivityMulf::setAttribute(), Mantid::Crystal::PeakHKLErrors::setUpOptRuns(), and Mantid::CurveFitting::Functions::TabulatedFunction::TabulatedFunction().

◆ getContainingFunction() [1/2]

IFunction_sptr Mantid::API::ParamFunction::getContainingFunction ( const ParameterReference ref) const

Get the containing function.

◆ getContainingFunction() [2/2]

IFunction_sptr Mantid::API::ParamFunction::getContainingFunction ( IFunction_sptr  fun)

Get the containing function.

◆ getError() [1/2]

double Mantid::API::ParamFunction::getError ( const std::string &  name) const
overridevirtual

Get the fitting error for a parameter by name.

Parameters
name:: The name of a parameter
Returns
:: the error

Implements Mantid::API::IFunction.

Definition at line 190 of file ParamFunction.cpp.

References m_errors, m_parameterNames, Mantid::API::IFunction::name(), and parameterName().

◆ getError() [2/2]

double Mantid::API::ParamFunction::getError ( size_t  i) const
overridevirtual

Get the fitting error for a parameter.

Parameters
i:: The index of a parameter
Returns
:: the error

Implements Mantid::API::IFunction.

Definition at line 180 of file ParamFunction.cpp.

References checkParameterIndex(), and m_errors.

Referenced by Mantid::API::PeakFunctionIntegrator::integrateError(), and Mantid::CurveFitting::Functions::Gaussian::intensityError().

◆ getParameter() [1/2]

double Mantid::API::ParamFunction::getParameter ( const std::string &  name) const
overridevirtual

Get parameter by name.

Parameters by name.

Parameters
name:: The name of the parameter.
Returns
the value of the named parameter

Implements Mantid::API::IFunction.

Definition at line 112 of file ParamFunction.cpp.

References Mantid::API::g_log, m_parameterNames, m_parameters, Mantid::API::IFunction::name(), parameterName(), and Mantid::Kernel::Logger::warning().

◆ getParameter() [2/2]

double Mantid::API::ParamFunction::getParameter ( size_t  i) const
overridevirtual

Get i-th parameter.

Get the i-th parameter.

Parameters
i:: The parameter index
Returns
the value of the requested parameter

Implements Mantid::API::IFunction.

Definition at line 62 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameters.

Referenced by Mantid::CurveFitting::Functions::AsymmetricPearsonVII::activeParameter(), Mantid::CurveFitting::Functions::Gaussian::activeParameter(), Mantid::CurveFitting::Functions::Keren::activeParameter(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::addFSETerm(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::addMassProfile(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::buildS2Cache(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::calculateEigenSystem(), Mantid::CurveFitting::Functions::Voigt::calculateFunctionAndDerivative(), Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt::calculateParameters(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::calculateParameters(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::centre(), Mantid::CurveFitting::Functions::Gaussian::centre(), Mantid::CurveFitting::Functions::Voigt::centre(), Mantid::CurveFitting::Functions::BSpline::derivative1D(), Mantid::CurveFitting::Functions::PseudoVoigt::estimate_parameter_value(), Mantid::CurveFitting::Functions::BackToBackExponential::expWidth(), Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt::function(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::function(), Mantid::CurveFitting::Functions::GramCharlier::function1D(), Mantid::CurveFitting::Functions::LogNormal::function1D(), Mantid::CurveFitting::Functions::Quadratic::function1D(), Mantid::CurveFitting::Functions::StretchExp::function1D(), Mantid::Crystal::PeakHKLErrors::function1D(), Mantid::CurveFitting::Functions::Abragam::function1D(), Mantid::CurveFitting::Functions::ActivationK::function1D(), Mantid::CurveFitting::Functions::ActivationmeV::function1D(), Mantid::CurveFitting::Functions::BackToBackExponential::function1D(), Mantid::CurveFitting::Functions::BivariateNormal::function1D(), Mantid::CurveFitting::Functions::BSpline::function1D(), Mantid::CurveFitting::Functions::Chebyshev::function1D(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::function1D(), Mantid::CurveFitting::Functions::ComptonPeakProfile::function1D(), Mantid::CurveFitting::Functions::ConvTempCorrection::function1D(), Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate::function1D(), Mantid::CurveFitting::Functions::DecoupAsymPowderMagLong::function1D(), Mantid::CurveFitting::Functions::DecoupAsymPowderMagRot::function1D(), Mantid::CurveFitting::Functions::DynamicKuboToyabe::function1D(), Mantid::CurveFitting::Functions::EndErfc::function1D(), Mantid::CurveFitting::Functions::ExpDecay::function1D(), Mantid::CurveFitting::Functions::ExpDecayMuon::function1D(), Mantid::CurveFitting::Functions::ExpDecayOsc::function1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::function1D(), Mantid::CurveFitting::Functions::FlatBackground::function1D(), Mantid::CurveFitting::Functions::FullprofPolynomial::function1D(), Mantid::CurveFitting::Functions::GausDecay::function1D(), Mantid::CurveFitting::Functions::GausOsc::function1D(), Mantid::CurveFitting::Functions::HallRossSQE::function1D(), Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle::function1D(), Mantid::CurveFitting::Functions::InelasticDiffSphere::function1D(), Mantid::CurveFitting::Functions::InelasticIsoRotDiff::function1D(), Mantid::CurveFitting::Functions::Keren::function1D(), Mantid::CurveFitting::Functions::LinearBackground::function1D(), Mantid::CurveFitting::Functions::MagneticOrderParameter::function1D(), Mantid::CurveFitting::Functions::MuonFInteraction::function1D(), Mantid::CurveFitting::Functions::MuoniumDecouplingCurve::function1D(), Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt::function1D(), Mantid::CurveFitting::Functions::Polynomial::function1D(), Mantid::CurveFitting::Functions::PowerLaw::function1D(), Mantid::CurveFitting::Functions::ProductLinearExp::function1D(), Mantid::CurveFitting::Functions::ProductQuadraticExp::function1D(), Mantid::CurveFitting::Functions::ReflectivityMulf::function1D(), Mantid::CurveFitting::Functions::SmoothTransition::function1D(), Mantid::CurveFitting::Functions::StaticKuboToyabe::function1D(), Mantid::CurveFitting::Functions::StaticKuboToyabeTimesExpDecay::function1D(), Mantid::CurveFitting::Functions::StaticKuboToyabeTimesGausDecay::function1D(), Mantid::CurveFitting::Functions::StaticKuboToyabeTimesStretchExp::function1D(), Mantid::CurveFitting::Functions::StretchExpMuon::function1D(), Mantid::CurveFitting::Functions::TabulatedFunction::function1D(), Mantid::CurveFitting::Functions::TeixeiraWaterSQE::function1D(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha::function1D(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta::function1D(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma::function1D(), Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction::function1D(), Mantid::FrameworkTestHelpers::FunctionChangesNParams::function1D(), Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function::function1D(), Mantid::Crystal::SCDCalibratePanels2ObjFunc::function1D(), Mantid::CurveFitting::Functions::LogNormal::functionDeriv1D(), Mantid::CurveFitting::Functions::StretchExp::functionDeriv1D(), Mantid::CurveFitting::Functions::ActivationK::functionDeriv1D(), Mantid::CurveFitting::Functions::ActivationmeV::functionDeriv1D(), Mantid::CurveFitting::Functions::DecoupAsymPowderMagLong::functionDeriv1D(), Mantid::CurveFitting::Functions::DecoupAsymPowderMagRot::functionDeriv1D(), Mantid::CurveFitting::Functions::ExpDecay::functionDeriv1D(), Mantid::CurveFitting::Functions::ExpDecayMuon::functionDeriv1D(), Mantid::CurveFitting::Functions::ExpDecayOsc::functionDeriv1D(), Mantid::CurveFitting::Functions::GausDecay::functionDeriv1D(), Mantid::CurveFitting::Functions::GausOsc::functionDeriv1D(), Mantid::CurveFitting::Functions::MagneticOrderParameter::functionDeriv1D(), Mantid::CurveFitting::Functions::MuoniumDecouplingCurve::functionDeriv1D(), Mantid::CurveFitting::Functions::PowerLaw::functionDeriv1D(), Mantid::CurveFitting::Functions::ProductLinearExp::functionDeriv1D(), Mantid::CurveFitting::Functions::ProductQuadraticExp::functionDeriv1D(), Mantid::CurveFitting::Functions::SmoothTransition::functionDeriv1D(), Mantid::CurveFitting::Functions::TabulatedFunction::functionDeriv1D(), Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction::functionDeriv1D(), Mantid::Crystal::PeakHKLErrors::functionDeriv1D(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::functionDerivLocal(), Mantid::CurveFitting::Functions::Gaussian::functionDerivLocal(), Mantid::CurveFitting::Functions::Lorentzian::functionDerivLocal(), Mantid::CurveFitting::Functions::PseudoVoigt::functionDerivLocal(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::functionLocal(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::functionLocal(), Mantid::CurveFitting::Functions::Gaussian::functionLocal(), Mantid::CurveFitting::Functions::Lorentzian::functionLocal(), Mantid::CurveFitting::Functions::PseudoVoigt::functionLocal(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::fwhm(), Mantid::CurveFitting::Functions::BackToBackExponential::fwhm(), Mantid::CurveFitting::Functions::Gaussian::fwhm(), Mantid::CurveFitting::Functions::Voigt::fwhm(), Mantid::Crystal::PeakHKLErrors::getNewInstrument(), Mantid::Crystal::PeakHKLErrors::getRun2MatMap(), Mantid::API::IPowderDiffPeakFunction::height(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::height(), Mantid::CurveFitting::Functions::BackToBackExponential::height(), Mantid::CurveFitting::Functions::Gaussian::height(), Mantid::CurveFitting::Functions::Lorentzian::height(), Mantid::CurveFitting::Functions::PseudoVoigt::height(), Mantid::CurveFitting::Functions::Voigt::height(), Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle::HeightPrefactor(), Mantid::CurveFitting::Functions::ElasticDiffSphere::HeightPrefactor(), Mantid::CurveFitting::Functions::ElasticIsoRotDiff::HeightPrefactor(), Mantid::CurveFitting::Functions::FlatBackground::histogram1D(), Mantid::CurveFitting::Functions::Gaussian::histogram1D(), Mantid::CurveFitting::Functions::LinearBackground::histogram1D(), Mantid::CurveFitting::Functions::Lorentzian::histogram1D(), Mantid::CurveFitting::Functions::Gaussian::histogramDerivative1D(), Mantid::CurveFitting::Functions::Lorentzian::histogramDerivative1D(), Mantid::CurveFitting::Functions::BivariateNormal::initCoeff(), Mantid::CurveFitting::Functions::BivariateNormal::initCommon(), Mantid::API::PeakFunctionIntegrator::integrateError(), Mantid::CurveFitting::Functions::Gaussian::intensity(), Mantid::CurveFitting::Functions::Voigt::intensity(), Mantid::CurveFitting::Functions::Gaussian::intensityError(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::leftShape(), Mantid::CurveFitting::Functions::GaussianComptonProfile::massProfile(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::massProfile(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::rightShape(), Mantid::CurveFitting::Functions::Chebyshev::setAttribute(), Mantid::CurveFitting::Functions::Polynomial::setAttribute(), Mantid::CurveFitting::Functions::ReflectivityMulf::setAttribute(), Mantid::CurveFitting::Functions::Voigt::setFwhm(), Mantid::CurveFitting::Functions::Lorentzian::setFwhm(), Mantid::CurveFitting::Functions::BackToBackExponential::setHeight(), Mantid::CurveFitting::Functions::Lorentzian::setHeight(), Mantid::CurveFitting::Functions::PseudoVoigt::setHeight(), Mantid::CurveFitting::Functions::Voigt::setHeight(), Mantid::CurveFitting::Functions::Gaussian::setIntensity(), Mantid::CurveFitting::Functions::Voigt::setIntensity(), Mantid::API::IPowderDiffPeakFunction::setParameter(), and Mantid::CurveFitting::Functions::CubicSpline::setupInput().

◆ getParameterAddress()

double * Mantid::API::ParamFunction::getParameterAddress ( size_t  i)
protectedvirtual

Get the address of the parameter. For use in UserFunction with mu::Parser.

Get the address of the parameter.

Parameters
i:: the index of the parameter required
Returns
the address of the parameter

Definition at line 284 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameters.

Referenced by Mantid::CurveFitting::Functions::UserFunction::setAttribute(), and Mantid::MDAlgorithms::UserFunctionMD::setFormula().

◆ getParameterIndex()

size_t Mantid::API::ParamFunction::getParameterIndex ( const ParameterReference ref) const
overridevirtual

Return parameter index from a parameter reference.

Returns the index of parameter if the ref points to this ParamFunction.

Usefull for constraints and ties in composite functions

Parameters
ref:: A reference to a parameter
Returns
Parameter index or number of nParams() if parameter not found

Implements Mantid::API::IFunction.

Definition at line 300 of file ParamFunction.cpp.

References Mantid::API::ParameterReference::getLocalFunction(), Mantid::API::ParameterReference::getLocalIndex(), and nParams().

◆ getParameterStatus()

IFunction::ParameterStatus Mantid::API::ParamFunction::getParameterStatus ( size_t  i) const
overrideprotectedvirtual

Get status of parameter.

Parameters
i:: Index of a parameter.
Returns
Parameter status.

Implements Mantid::API::IFunction.

Definition at line 276 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameterStatus.

◆ hasParameter()

bool Mantid::API::ParamFunction::hasParameter ( const std::string &  name) const
overridevirtual

Check if function has a parameter with this name.

Check if function has a parameter with a particular name.

Parameters
name:: A name of a parameter.
Returns
True if the parameter exists.

Implements Mantid::API::IFunction.

Definition at line 138 of file ParamFunction.cpp.

References m_parameterNames, and Mantid::API::IFunction::name().

Referenced by MantidQt::MantidWidgets::FunctionModel::setBackgroundA0().

◆ isExplicitlySet()

bool Mantid::API::ParamFunction::isExplicitlySet ( size_t  i) const
overridevirtual

Checks if a parameter has been set explicitly.

Implements Mantid::API::IFunction.

Definition at line 290 of file ParamFunction.cpp.

References checkParameterIndex(), and m_explicitlySet.

◆ nParams()

size_t Mantid::API::ParamFunction::nParams ( ) const
inlineoverridevirtual

◆ parameterDescription()

std::string Mantid::API::ParamFunction::parameterDescription ( size_t  i) const
overridevirtual

Returns the description of parameter i.

Parameters
i:: The index of a parameter
Returns
the description of the parameter at the requested index

Implements Mantid::API::IFunction.

Definition at line 170 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameterDescriptions.

◆ parameterIndex()

size_t Mantid::API::ParamFunction::parameterIndex ( const std::string &  name) const
overridevirtual

◆ parameterName()

std::string Mantid::API::ParamFunction::parameterName ( size_t  i) const
overridevirtual

Returns the name of parameter i.

Parameters
i:: The index of a parameter
Returns
the name of the parameter at the requested index

Implements Mantid::API::IFunction.

Definition at line 161 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameterNames.

Referenced by Mantid::CurveFitting::Functions::AsymmetricPearsonVII::activeParameter(), Mantid::CurveFitting::Functions::Gaussian::activeParameter(), Mantid::CurveFitting::Functions::Keren::activeParameter(), Mantid::Crystal::PeakHKLErrors::function1D(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::HallRossSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::TeixeiraWaterSQE::functionDeriv1D(), Mantid::API::IPeakFunction::getCentreParameterName(), getError(), getParameter(), Mantid::CurveFitting::Functions::Abragam::setActiveParameter(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::setActiveParameter(), Mantid::CurveFitting::Functions::EndErfc::setActiveParameter(), Mantid::CurveFitting::Functions::ExpDecayOsc::setActiveParameter(), Mantid::CurveFitting::Functions::GausDecay::setActiveParameter(), Mantid::CurveFitting::Functions::GausOsc::setActiveParameter(), Mantid::CurveFitting::Functions::Gaussian::setActiveParameter(), Mantid::CurveFitting::Functions::Keren::setActiveParameter(), Mantid::CurveFitting::Functions::UserFunction::setAttribute(), setError(), Mantid::MDAlgorithms::UserFunctionMD::setFormula(), setParameter(), and setParameterDescription().

◆ setError() [1/2]

void Mantid::API::ParamFunction::setError ( const std::string &  name,
double  err 
)
overridevirtual

Set the fitting error for a parameter by name.

Get the fitting error for a parameter by name.

Parameters
name:: The name of a parameter
err:: The error value to set

Implements Mantid::API::IFunction.

Definition at line 219 of file ParamFunction.cpp.

References m_errors, m_parameterNames, Mantid::API::IFunction::name(), and parameterName().

◆ setError() [2/2]

void Mantid::API::ParamFunction::setError ( size_t  i,
double  err 
)
overridevirtual

Set the fitting error for a parameter.

Parameters
i:: The index of a parameter
err:: The error value to set

Implements Mantid::API::IFunction.

Definition at line 209 of file ParamFunction.cpp.

References checkParameterIndex(), and m_errors.

◆ setParameter() [1/2]

void Mantid::API::ParamFunction::setParameter ( const std::string &  name,
const double &  value,
bool  explicitlySet = true 
)
overridevirtual

Set parameter by name.

Sets a new value to a parameter by name.

Parameters
name:: The name of the parameter.
value:: The new value
explicitlySet:: A boolean flagging the parameter as explicitly set (by user)

Implements Mantid::API::IFunction.

Reimplemented in Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PseudoVoigt, and Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt.

Definition at line 74 of file ParamFunction.cpp.

References m_parameterNames, Mantid::API::IFunction::name(), parameterName(), setParameter(), and value.

◆ setParameter() [2/2]

void Mantid::API::ParamFunction::setParameter ( size_t  i,
const double &  value,
bool  explicitlySet = true 
)
overridevirtual

Set i-th parameter.

Sets a new value to the i-th parameter.

Parameters
i:: The parameter index
value:: The new value
explicitlySet:: A boolean falgging the parameter as explicitly set (by user)

Implements Mantid::API::IFunction.

Reimplemented in Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PseudoVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, and Mantid::CurveFitting::Functions::CubicSpline.

Definition at line 29 of file ParamFunction.cpp.

References parameterName(), and value.

Referenced by Mantid::CurveFitting::Functions::LinearBackground::fit(), Mantid::CurveFitting::Functions::Abragam::setActiveParameter(), Mantid::CurveFitting::Functions::DynamicKuboToyabe::setActiveParameter(), Mantid::CurveFitting::Functions::EndErfc::setActiveParameter(), Mantid::CurveFitting::Functions::ExpDecayOsc::setActiveParameter(), Mantid::CurveFitting::Functions::GausDecay::setActiveParameter(), Mantid::CurveFitting::Functions::GausOsc::setActiveParameter(), Mantid::CurveFitting::Functions::Keren::setActiveParameter(), Mantid::CurveFitting::Functions::Chebyshev::setAttribute(), Mantid::CurveFitting::Functions::Polynomial::setAttribute(), setParameter(), Mantid::API::IPowderDiffPeakFunction::setParameter(), Mantid::CurveFitting::Functions::ComptonProfile::setParameter(), Mantid::CurveFitting::Functions::CubicSpline::setParameter(), Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt::setParameter(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::setParameter(), and Mantid::API::IPeakFunction::setParameter().

◆ setParameterDescription() [1/2]

void Mantid::API::ParamFunction::setParameterDescription ( const std::string &  name,
const std::string &  description 
)
overridevirtual

Set description of parameter by name.

Sets a new description to a parameter by name.

Parameters
name:: The name of the parameter.
description:: New parameter description

Implements Mantid::API::IFunction.

Definition at line 94 of file ParamFunction.cpp.

References m_parameterNames, Mantid::API::IFunction::name(), parameterName(), and setParameterDescription().

◆ setParameterDescription() [2/2]

void Mantid::API::ParamFunction::setParameterDescription ( size_t  i,
const std::string &  description 
)
overridevirtual

Set i-th parameter description.

Sets a new parameter description to the i-th parameter.

Parameters
i:: The parameter index
description:: New parameter description

Implements Mantid::API::IFunction.

Definition at line 53 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameterDescriptions.

Referenced by setParameterDescription().

◆ setParameterStatus()

void Mantid::API::ParamFunction::setParameterStatus ( size_t  i,
ParameterStatus  status 
)
overrideprotectedvirtual

Change status of parameter.

Parameters
i:: Index of a parameter.
status:: New parameter status.

Implements Mantid::API::IFunction.

Definition at line 268 of file ParamFunction.cpp.

References checkParameterIndex(), and m_parameterStatus.

Member Data Documentation

◆ m_errors

std::vector<double> Mantid::API::ParamFunction::m_errors
private

Keeps parameter errors.

Definition at line 107 of file ParamFunction.h.

Referenced by declareParameter(), getError(), and setError().

◆ m_explicitlySet

std::vector<bool> Mantid::API::ParamFunction::m_explicitlySet
private

Flags of explicitly set parameters.

Definition at line 109 of file ParamFunction.h.

Referenced by declareParameter(), and isExplicitlySet().

◆ m_parameterDescriptions

std::vector<std::string> Mantid::API::ParamFunction::m_parameterDescriptions
private

parameter descriptions

Definition at line 111 of file ParamFunction.h.

Referenced by clearAllParameters(), declareParameter(), parameterDescription(), and setParameterDescription().

◆ m_parameterNames

std::vector<std::string> Mantid::API::ParamFunction::m_parameterNames
private

◆ m_parameters

std::vector<double> Mantid::API::ParamFunction::m_parameters
private

Keeps parameter values.

Definition at line 105 of file ParamFunction.h.

Referenced by clearAllParameters(), declareParameter(), getParameter(), and getParameterAddress().

◆ m_parameterStatus

std::vector<ParameterStatus> Mantid::API::ParamFunction::m_parameterStatus
private

Keeps status for each parameter.

Definition at line 101 of file ParamFunction.h.

Referenced by clearAllParameters(), declareParameter(), getParameterStatus(), and setParameterStatus().


The documentation for this class was generated from the following files: