Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Mantid::API::IFunction Class Referenceabstract

This is an interface to a fitting function - a semi-abstarct class. More...

#include <IFunction.h>

Inheritance diagram for Mantid::API::IFunction:
Mantid::API::CompositeFunction Mantid::API::FunctionGenerator Mantid::API::FunctionParameterDecorator Mantid::API::IFunction1D Mantid::API::IFunction1DSpectrum Mantid::API::IFunctionGeneral Mantid::API::IFunctionMD Mantid::API::IFunctionMW Mantid::API::ParamFunction Mantid::CurveFitting::Functions::CrystalFieldFunction Mantid::CurveFitting::Functions::PawleyParameterFunction Mantid::PythonInterface::IFunctionAdapter

Classes

class  Attribute
 Attribute is a non-fitting parameter. More...
 
class  AttributeValidatorVisitor
 Atribute validator visitor class. More...
 
class  AttributeVisitor
 Atribute visitor class. More...
 
class  ConstAttributeVisitor
 Const version of AttributeVisitor. More...
 
struct  ValidationException
 Simple Exception Struct to differentiate validation error from other exceptions. More...
 
struct  ValidatorEvaluator
 Simple struct to constain function to evaluate attribute validators that is required in both attributes and visitors. More...
 

Public Member Functions

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...
 
Function parameters
virtual void setParameter (size_t, const double &value, bool explicitlySet=true)=0
 Set i-th parameter. More...
 
virtual void setParameterDescription (size_t, const std::string &description)=0
 Set i-th parameter description. More...
 
virtual double getParameter (size_t i) const =0
 Get i-th parameter. More...
 
virtual void setParameter (const std::string &name, const double &value, bool explicitlySet=true)=0
 Set parameter by name. More...
 
virtual void setParameterDescription (const std::string &name, const std::string &description)=0
 Set description of parameter by name. More...
 
virtual double getParameter (const std::string &name) const =0
 Get parameter by name. More...
 
virtual bool hasParameter (const std::string &name) const =0
 Check if function has a parameter with this name. More...
 
virtual size_t nParams () const =0
 Total number of parameters. More...
 
virtual size_t parameterIndex (const std::string &name) const =0
 Returns the index of parameter name. More...
 
virtual std::string parameterName (size_t i) const =0
 Returns the name of parameter i. More...
 
virtual std::string parameterDescription (size_t i) const =0
 Returns the description of parameter i. More...
 
virtual bool isExplicitlySet (size_t i) const =0
 Checks if a parameter has been set explicitly. More...
 
virtual double getError (size_t i) const =0
 Get the fitting error for a parameter. More...
 
virtual double getError (const std::string &name) const =0
 Get the fitting error for a parameter by name. More...
 
virtual void setError (size_t i, double err)=0
 Set the fitting error for a parameter. More...
 
virtual void setError (const std::string &name, double err)=0
 Set the fitting error for a parameter by name. 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...
 
virtual size_t getParameterIndex (const ParameterReference &ref) const =0
 Return parameter index from a parameter reference. More...
 
std::vector< std::string > getParameterNames () const
 Return a vector with all parameter names. More...
 
Active parameters
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...
 
Ties
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...
 
Constraints
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...
 

Attributes

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...
 
class ParameterTie
 
class CompositeFunction
 
class FunctionParameterDecorator
 
class FunctionGenerator
 
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...
 
std::map< std::string, API::IFunction::Attributem_attrs
 The declared attributes. More...
 
std::shared_ptr< Kernel::Matrix< double > > m_covar
 The covariance matrix of the fitting parameters. More...
 
double m_chiSquared
 The chi-squared of the last fit. More...
 
std::vector< std::unique_ptr< ParameterTie > > m_ties
 Holds parameter ties. More...
 
std::vector< std::unique_ptr< IConstraint > > m_constraints
 Holds the constraints added to function. More...
 
std::vector< ParameterTie * > m_orderedTies
 Ties ordered in order of correct application. More...
 
bool m_isRegistered {false}
 whether the function usage has been registered More...
 
std::function< double(const double)> m_stepSizeFunction
 The function used to calculate the step size. 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 setParameterStatus (size_t i, ParameterStatus status)=0
 Change status of parameter. More...
 
virtual ParameterStatus getParameterStatus (size_t i) const =0
 Get status of parameter. More...
 
virtual void setStepSizeMethod (const StepSizeMethod method)
 Sets the StepSizeMethod to use when calculation the step size. More...
 
virtual void init ()
 Function initialization. Declare function parameters in this method. More...
 
virtual void declareParameter (const std::string &name, double initValue=0, const std::string &description="")=0
 Declare a new parameter. 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...
 

Detailed Description

This is an interface to a fitting function - a semi-abstarct class.

Functions derived from IFunction can be used with the Fit algorithm. IFunction defines the structure of a fitting funtion.

A function has a number of named parameters (not arguments), type double, on which it depends. Parameters must be declared either in the constructor or in the init() method of a derived class with method declareParameter(...). Method nParams() returns the number of parameters. A parameter can be accessed either by its name or the index. For example in case of Gaussian the parameters can be "Height", "PeakCentre" and "Sigma".

The main method of IFunction is called function(const FunctionDomain&,FunctionValues&). It takes a set of function arguments via interface FunctionDomain, calculates the values, and returns them via the FunctionValues. The derived classes must implement this method.

Implement functionDeriv method for the function to be used with fitting algorithms using derivatives. functionDeriv calculates patrial derivatives of the function with respect to the fitting parameters. The default implementation uses numeric differentiation.

To fit a function to a set of data its parameters must be adjusted so that the difference between the data and the corresponding function values were minimized. This is the aim of the Fit algorithm. But Fit does not work with the declared parameters directly. Instead it uses other - active - parameters. In simple case the active parameters are the same as the declared ones. But they can be overidden if the declared parameters make fit unstable. There are as many active parameters as there are the declared ones. A one-to-one transformation must exist between the active and the declared parameters. Overide activeParameter and setActiveParameter methods to implement this transformation. An example is Gaussian where "Sigma" makes the fit unstable. So in the fit it is replaced with variable Weight = 1 / Sigma which is more efficient.

The active parameters can be accessed by their index. The implementations of the access method for both active and declared parameters must ensure that any changes to one of them immediately reflected on the other so that the two sets are consistent at any moment.

IFunction declares method nameOfActive(int i) which returns the name of the declared parameter corresponding to the i-th active parameter. I am not completely sure in the usefulness of it.

The declared parameters can be made fixed in a fit with method fix(). If a parameter is fixed a fit shouldn't change its value unless it is also tied to values of other parameters. Implementations of active parameters must ensure this behaviour.

When a declared parameter is made fixed one of the active parameters must become inactive. isActive(i) method must return false for it. In case of declared == active the fixed parameter becomes inactive. Classes overriding active parameters must ensure that number of inactive parameters == number of fixed declared ones at any moment.

IFunction provides methods for tying and untying parameters. Only the declared parameters can be tied. isFixed() method returns true for a tied parameter. The value of a tied parameter is defined by its tie and can change in a fit.

Method addConstraint adds constraints on possible values of a declared parameter. A constrained parameter is not fixed and can vary within its constraint. Constraints and ties are used only in fitting.

Any non-fitting parameters can be implemented as attributes (class IFunction::Attribute). An attribute can have one of three types: std::string, int, or double. The type is set at construction and cannot be changed later. To read or write the attributes there are two ways. If the type is known the type specific accessors can be used, e.g. asString(), asInt(). Otherwise the IFunction::AttributeVisitor can be used. It provides alternative virtual methods to access attributes of each type. When creating a function from a string (using FunctionFactory::creaeInitialized(...)) the attributes must be set first, before any fitting parameter, as the number and names of the parameters can depend on the attributes.

Author
Roman Tolchenov, Tessella Support Services plc
Date
16/10/2009
22/12/2010

Definition at line 163 of file IFunction.h.

Member Enumeration Documentation

◆ ParameterStatus

Describe parameter status in relation to fitting: Active: Fit varies such parameter directly.

Fixed: Value doesn't change during fit. FixedByDefault: Fixed by default, don't show in ties of the output string. Tied: Value depends on values of other parameters.

Enumerator
Active 
Fixed 
FixedByDefault 
Tied 

Definition at line 649 of file IFunction.h.

◆ StepSizeMethod

Describes the method in which the step size will be calculated: DEFAULT: Uses the traditional Mantid method of calculating the step size.

SQRT_EPSILON: Uses the square root of epsilon to calculate the step size.

Enumerator
DEFAULT 
SQRT_EPSILON 

Definition at line 658 of file IFunction.h.

Constructor & Destructor Documentation

◆ IFunction() [1/2]

Mantid::API::IFunction::IFunction ( )

Constructor.

Definition at line 86 of file IFunction.cpp.

◆ ~IFunction()

Mantid::API::IFunction::~IFunction ( )
virtual

Virtual destructor.

Destructor.

Definition at line 92 of file IFunction.cpp.

References m_attrs.

◆ IFunction() [2/2]

Mantid::API::IFunction::IFunction ( const IFunction )
delete

No copying.

Member Function Documentation

◆ activeParameter()

double Mantid::API::IFunction::activeParameter ( size_t  i) const
virtual

◆ addConstraint()

void Mantid::API::IFunction::addConstraint ( std::unique_ptr< IConstraint ic)
virtual

◆ addConstraints()

void Mantid::API::IFunction::addConstraints ( const std::string &  str,
bool  isDefault = false 
)
virtual

Add a list of conatraints from a string.

Add a list of constraints from a string.

Parameters
str:: A comma-separated list of constraint expressions.
isDefault:: Flag to mark as default the value of an object associated with this reference.

Definition at line 521 of file IFunction.cpp.

References addConstraint(), Mantid::API::Expression::begin(), Mantid::API::Expression::end(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::API::Expression::parse(), and Mantid::API::Expression::toList().

Referenced by Mantid::API::ImmutableCompositeFunction::addDefaultConstraints(), and export_IFunction().

◆ addTie()

void Mantid::API::IFunction::addTie ( std::unique_ptr< ParameterTie tie)
protectedvirtual

Add a new tie. Derived classes must provide storage for ties.

Attaches a tie to this ParamFunction.

The attached tie is owned by the ParamFunction.

Parameters
tie:: A pointer to a new tie

Reimplemented in Mantid::API::FunctionParameterDecorator.

Definition at line 282 of file IFunction.cpp.

References getParameterIndex(), m_ties, setParameterStatus(), tie(), and Tied.

Referenced by tie().

◆ addTies()

void Mantid::API::IFunction::addTies ( const std::string &  ties,
bool  isDefault = false 
)
virtual

Add several ties.

Add ties to the function.

Parameters
ties:: Comma-separated list of name=value pairs where name is a parameter name and value is a math expression tying the parameter to other parameters or a constant.
isDefault:: Flag to mark as default the value of an object associated with this reference: a tie or a constraint.

Definition at line 233 of file IFunction.cpp.

References applyTies(), n, name(), Mantid::API::Expression::parse(), tie(), Mantid::API::Expression::toList(), and value.

Referenced by Mantid::API::ImmutableCompositeFunction::addDefaultTies(), and export_IFunction().

◆ applyOrderedTies()

void Mantid::API::IFunction::applyOrderedTies ( )
protected

Definition at line 297 of file IFunction.cpp.

References m_orderedTies, and tie().

Referenced by applyTies(), and Mantid::API::CompositeFunction::applyTies().

◆ applyTies()

void Mantid::API::IFunction::applyTies ( )
virtual

◆ asString()

std::string Mantid::API::IFunction::asString ( ) const

Writes itself into a string.

Writes a string that can be used in FunctionFunctory to create a copy of this IFunction.

Returns
string representation of the function

Definition at line 462 of file IFunction.cpp.

References writeToString().

Referenced by clone(), createEquivalentFunctions(), Mantid::API::CompositeFunction::createEquivalentFunctions(), Mantid::API::MultiDomainFunction::createEquivalentFunctions(), export_IFunction(), and Mantid::API::operator<<().

◆ attributeName()

std::string Mantid::API::IFunction::attributeName ( size_t  index) const
virtual

Get name of ith attribute.

Return the name of the ith attribute by querying the stored attributes in m_attrs.

Parameters
index:: Index of the attribute to return

Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, and Mantid::CurveFitting::Functions::Resolution.

Definition at line 1382 of file IFunction.cpp.

References index, m_attrs, and nAttributes().

Referenced by Mantid::API::CompositeFunction::attributeName(), Mantid::API::FunctionGenerator::attributeName(), Mantid::CurveFitting::Functions::Resolution::attributeName(), Mantid::CurveFitting::Functions::CrystalFieldFunction::buildAttributeNames(), and getAttributeNames().

◆ calculateStepSize()

double Mantid::API::IFunction::calculateStepSize ( const double  parameterValue) const

Calculate step size for the given parameter value.

Calculates the step size to use when calculating the numerical derivative.

Parameters
parameterValue:: The value of the active parameter.
Returns
The step size to use when calculating the numerical derivative.

Definition at line 1077 of file IFunction.cpp.

References m_stepSizeFunction.

Referenced by calNumericalDeriv().

◆ calNumericalDeriv()

void Mantid::API::IFunction::calNumericalDeriv ( const FunctionDomain domain,
Jacobian jacobian 
)

Calculate numerical derivatives.

Parameters
domain:: The domain of the function
jacobian:: A Jacobian matrix. It is expected to have dimensions of domain.size() by nParams().

Definition at line 1031 of file IFunction.cpp.

References activeParameter(), applyTies(), calculateStepSize(), function(), Mantid::API::FunctionValues::getCalculated(), getValuesSize(), isActive(), nParams(), Mantid::API::Jacobian::set(), setActiveParameter(), and Mantid::API::FunctionValues::size().

Referenced by Mantid::CurveFitting::Functions::Abragam::functionDeriv(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::functionDeriv(), Mantid::CurveFitting::Functions::Convolution::functionDeriv(), Mantid::CurveFitting::Functions::DynamicKuboToyabe::functionDeriv(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::functionDeriv(), Mantid::CurveFitting::Functions::PeakParameterFunction::functionDeriv(), Mantid::CurveFitting::Functions::ProductFunction::functionDeriv(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha::functionDeriv(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta::functionDeriv(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt::functionDeriv(), Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma::functionDeriv(), Mantid::CurveFitting::Functions::UserFunction::functionDeriv(), functionDeriv(), Mantid::API::CompositeFunction::functionDeriv(), Mantid::API::IFunctionGeneral::functionDeriv(), Mantid::API::ILatticeFunction::functionDeriv(), Mantid::API::MultiDomainFunction::functionDeriv(), Mantid::CurveFitting::Functions::BackToBackExponential::functionDeriv1D(), and Mantid::API::IFunction1DSpectrum::functionDeriv1DSpectrum().

◆ cancellationRequestReceived()

bool Mantid::API::IFunction::cancellationRequestReceived ( ) const

Returns true if a progress reporter is set & evalaution has been requested to stop.

Returns
true if a progress reporter is set & evalaution has been requested to stop

Definition at line 143 of file IFunction.cpp.

References m_progReporter.

◆ categories()

const std::vector< std::string > Mantid::API::IFunction::categories ( ) const
virtual

Function to return all of the categories that contain this algorithm.

Function to return all of the categories that contain this function.

Definition at line 572 of file IFunction.cpp.

References Mantid::Kernel::StringTokenizer::asVector(), category(), categorySeparator(), Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY, and Mantid::Kernel::StringTokenizer::TOK_TRIM.

◆ category()

virtual const std::string Mantid::API::IFunction::category ( ) const
inlinevirtual

The categories the Fit function belong to.

Categories must be listed as a semi colon separated list. For example: "General, Muon\\Custom" which adds a function to the category "General" and the sub-category "Muon\\Custom"

Reimplemented in Mantid::Crystal::PeakHKLErrors, Mantid::Crystal::SCDCalibratePanels2ObjFunc, Mantid::Crystal::SCDPanelErrors, Mantid::CurveFitting::Functions::Abragam, Mantid::CurveFitting::Functions::ActivationK, Mantid::CurveFitting::Functions::ActivationmeV, Mantid::CurveFitting::Functions::AsymmetricPearsonVII, Mantid::CurveFitting::Functions::BackgroundFunction, Mantid::CurveFitting::Functions::BackToBackExponential, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::Bk2BkExpConvPV, Mantid::CurveFitting::Functions::BSpline, Mantid::CurveFitting::Functions::Chebyshev, Mantid::CurveFitting::Functions::ChudleyElliotSQE, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::ConvTempCorrection, Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::CrystalFieldHeatCapacity, Mantid::CurveFitting::Functions::CrystalFieldHeatCapacityCalculation, Mantid::CurveFitting::Functions::CrystalFieldMagnetisation, Mantid::CurveFitting::Functions::CrystalFieldMagnetisationCalculation, Mantid::CurveFitting::Functions::CrystalFieldMoment, Mantid::CurveFitting::Functions::CrystalFieldMomentCalculation, Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum, Mantid::CurveFitting::Functions::CrystalFieldSpectrum, Mantid::CurveFitting::Functions::CrystalFieldSusceptibility, Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityCalculation, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::DecoupAsymPowderMagLong, Mantid::CurveFitting::Functions::DecoupAsymPowderMagRot, Mantid::CurveFitting::Functions::DeltaFunction, Mantid::CurveFitting::Functions::DiffRotDiscreteCircle, Mantid::CurveFitting::Functions::DiffSphere, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::ElasticDiffSphere, Mantid::CurveFitting::Functions::ElasticIsoRotDiff, Mantid::CurveFitting::Functions::EndErfc, Mantid::CurveFitting::Functions::ExpDecay, Mantid::CurveFitting::Functions::ExpDecayMuon, Mantid::CurveFitting::Functions::ExpDecayOsc, Mantid::CurveFitting::Functions::FickDiffusionSQE, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::GausDecay, Mantid::CurveFitting::Functions::GausOsc, Mantid::CurveFitting::Functions::Gaussian, Mantid::CurveFitting::Functions::HallRossSQE, Mantid::CurveFitting::Functions::IkedaCarpenterPV, Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::InelasticDiffSphere, Mantid::CurveFitting::Functions::InelasticIsoRotDiff, Mantid::CurveFitting::Functions::IsoRotDiff, Mantid::CurveFitting::Functions::Keren, Mantid::CurveFitting::Functions::LogNormal, Mantid::CurveFitting::Functions::Lorentzian, Mantid::CurveFitting::Functions::MagneticOrderParameter, Mantid::CurveFitting::Functions::MuonFInteraction, Mantid::CurveFitting::Functions::MuoniumDecouplingCurve, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::PowerLaw, Mantid::CurveFitting::Functions::ProductLinearExp, Mantid::CurveFitting::Functions::ProductQuadraticExp, Mantid::CurveFitting::Functions::PseudoVoigt, Mantid::CurveFitting::Functions::ReflectivityMulf, Mantid::CurveFitting::Functions::SmoothTransition, 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::TeixeiraWaterSQE, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma, Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction, Mantid::CurveFitting::Functions::UserFunction, and Mantid::PythonInterface::IFunctionAdapter.

Definition at line 440 of file IFunction.h.

Referenced by categories(), and Mantid::PythonInterface::IFunctionAdapter::category().

◆ categorySeparator()

virtual const std::string Mantid::API::IFunction::categorySeparator ( ) const
inlinevirtual

Function to return the sperator token for the category string.

A default implementation ';' is provided

Definition at line 445 of file IFunction.h.

Referenced by categories().

◆ checkAttributeName()

void Mantid::API::IFunction::checkAttributeName ( const std::string &  name)
protected

Check Attribute to declare does not already exist.

Checks Attribute of "name" does not exist.

Parameters
name:: The name of the attribute

Definition at line 1445 of file IFunction.cpp.

References m_attrs, and name().

Referenced by declareAttribute().

◆ clearConstraints()

void Mantid::API::IFunction::clearConstraints ( )
virtual

Remove all constraints.

Definition at line 431 of file IFunction.cpp.

References m_constraints.

Referenced by Mantid::API::ParamFunction::clearAllParameters().

◆ clearTies()

void Mantid::API::IFunction::clearTies ( )
virtual

◆ clone()

std::shared_ptr< IFunction > Mantid::API::IFunction::clone ( ) const
virtual

◆ convertValue() [1/2]

double Mantid::API::IFunction::convertValue ( double  value,
Kernel::Unit_sptr outUnit,
const std::shared_ptr< const MatrixWorkspace > &  ws,
size_t  wsIndex 
) const
protected

Convert a value from one unit (inUnit) to unit defined in workspace (ws)

Convert a value from unit defined in workspace (ws) to outUnit.

Parameters
value:: assumed to be in unit of workspace
outUnit:: unit to convert to
ws:: workspace
wsIndex:: workspace index
Returns
converted value

Definition at line 1267 of file IFunction.cpp.

References convertValue(), and value.

Referenced by Mantid::CurveFitting::Functions::IkedaCarpenterPV::calWavelengthAtEachDataPoint(), convertValue(), setMatrixWorkspace(), and Mantid::CurveFitting::Functions::IkedaCarpenterPV::setMatrixWorkspace().

◆ convertValue() [2/2]

void Mantid::API::IFunction::convertValue ( std::vector< double > &  values,
Kernel::Unit_sptr outUnit,
const std::shared_ptr< const MatrixWorkspace > &  ws,
size_t  wsIndex 
) const
protected

Convert values from unit defined in workspace (ws) to outUnit.

Parameters
values:: As input: assumed to be in unit of workspace. As output: in unit of outUnit
outUnit:: unit to convert to
ws:: workspace
wsIndex:: workspace index

Definition at line 1294 of file IFunction.cpp.

References Mantid::Kernel::Logger::error(), and Mantid::API::g_log.

◆ createEquivalentFunctions()

std::vector< IFunction_sptr > Mantid::API::IFunction::createEquivalentFunctions ( ) const
virtual

Split this function (if needed) into a list of independent functions.

The number of functions must be the number of domains this function is working on (== getNumberDomains()). The result of evaluation of the created functions on their domains must be the same as if this function was evaluated on the composition of those domains.

Reimplemented in Mantid::API::CompositeFunction, Mantid::API::MultiDomainFunction, Mantid::CurveFitting::Functions::CrystalFieldFunction, and Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum.

Definition at line 1579 of file IFunction.cpp.

References asString(), and Mantid::Kernel::SingletonHolder< T >::Instance().

Referenced by Mantid::PythonInterface::IFunctionAdapter::createPythonEquivalentFunctions().

◆ declareAttribute() [1/2]

void Mantid::API::IFunction::declareAttribute ( const std::string &  name,
const API::IFunction::Attribute defaultValue 
)
protected

Declare a single attribute.

Declares a single attribute.

Parameters
name:: The name of the attribute
defaultValue:: A default value

Definition at line 1418 of file IFunction.cpp.

References checkAttributeName(), m_attrs, and name().

Referenced by Mantid::CurveFitting::Functions::CrystalFieldHeatCapacityBase::CrystalFieldHeatCapacityBase(), Mantid::CurveFitting::Functions::CrystalFieldMagnetisationBase::CrystalFieldMagnetisationBase(), Mantid::CurveFitting::Functions::CrystalFieldMomentBase::CrystalFieldMomentBase(), Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum::CrystalFieldMultiSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::CrystalFieldPeaksBase(), Mantid::CurveFitting::Functions::CrystalFieldSpectrumControl::CrystalFieldSpectrumControl(), Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityBase::CrystalFieldSusceptibilityBase(), Mantid::API::CompositeFunction::declareAttribute(), Mantid::PythonInterface::IFunctionAdapter::declareAttribute(), Mantid::CurveFitting::Functions::ComptonPeakProfile::declareAttributes(), Mantid::CurveFitting::Functions::FunctionQDepends::declareAttributes(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::declareAttributes(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::declareAttributes(), Mantid::CurveFitting::Functions::VesuvioResolution::declareAttributes(), Mantid::API::FunctionGenerator::FunctionGenerator(), Mantid::CurveFitting::Functions::PawleyParameterFunction::init(), Mantid::CurveFitting::Functions::ReflectivityMulf::init(), Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function::MultiDomainFunctionTest_Function(), Mantid::Crystal::SCDPanelErrors::SCDPanelErrors(), Mantid::CurveFitting::Functions::CubicSpline::setAttribute(), Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum::setAttribute(), and Mantid::CurveFitting::Functions::TabulatedFunction::TabulatedFunction().

◆ declareAttribute() [2/2]

void Mantid::API::IFunction::declareAttribute ( const std::string &  name,
const API::IFunction::Attribute defaultValue,
const Kernel::IValidator validator 
)
protected

Declare a single attribute with validator.

Declares a single attribute with a validator.

Parameters
name:: The name of the attribute
defaultValue:: A default value
validator:: validator to restrict allows input value of defaultValue param

Definition at line 1430 of file IFunction.cpp.

References checkAttributeName(), Mantid::Kernel::IValidator::clone(), Mantid::API::IFunction::Attribute::evaluateValidator(), m_attrs, name(), and Mantid::API::IFunction::Attribute::setValidator().

◆ declareAttributes()

virtual void Mantid::API::IFunction::declareAttributes ( )
inlineprotectedvirtual

◆ declareParameter()

virtual void Mantid::API::IFunction::declareParameter ( const std::string &  name,
double  initValue = 0,
const std::string &  description = "" 
)
protectedpure virtual

◆ declareParameters()

virtual void Mantid::API::IFunction::declareParameters ( )
inlineprotectedvirtual

◆ descriptionOfActive()

std::string Mantid::API::IFunction::descriptionOfActive ( size_t  i) const
virtual

Returns the name of active parameter i.

Returns the description of an active parameter.

Parameters
i:: Index of a parameter. The parameter must be active.

Reimplemented in Mantid::API::CompositeFunction.

Definition at line 1019 of file IFunction.cpp.

References isActive(), parameterDescription(), and parameterName().

◆ estimateNoProgressCalls()

virtual int64_t Mantid::API::IFunction::estimateNoProgressCalls ( ) const
inlinevirtual

Returns an estimate of the number of progress reports a single evaluation of the function will have.

For backwards compatibility default=1

Definition at line 425 of file IFunction.h.

◆ fix()

void Mantid::API::IFunction::fix ( size_t  i,
bool  isDefault = false 
)

Removes a parameter i from the list of active.

This method doesn't create a tie.

Parameters
i:: A declared parameter index to be fixed
isDefault:: If true fix it by default

Definition at line 181 of file IFunction.cpp.

References Fixed, FixedByDefault, getParameterStatus(), parameterName(), setParameterStatus(), Tied, and std::to_string().

Referenced by export_IFunction(), fixAll(), fixAllActive(), fixParameter(), Mantid::CurveFitting::ParameterEstimator::setBackToBackExponential(), and tie().

◆ fixAll()

void Mantid::API::IFunction::fixAll ( bool  isDefault = false)

Fix all parameters.

Parameters
isDefault:: If true fix them by default

Definition at line 1529 of file IFunction.cpp.

References fix(), isActive(), and nParams().

Referenced by export_IFunction(), Mantid::CurveFitting::Functions::CrystalFieldUtils::ignorePeak(), and Mantid::CurveFitting::Functions::CrystalFieldUtils::updatePeak().

◆ fixAllActive()

void Mantid::API::IFunction::fixAllActive ( bool  isDefault = false)

Fix all active parameters.

This method doesn't change status of a fixed parameter, eg if one was fixed by default prior to calling this method it will remain default regardless the value of isDefault argument.

Parameters
isDefault:: If true fix them by default.

Definition at line 1560 of file IFunction.cpp.

References Active, fix(), getParameterStatus(), and nParams().

◆ fixParameter()

void Mantid::API::IFunction::fixParameter ( const std::string &  name,
bool  isDefault = false 
)

◆ function()

virtual void Mantid::API::IFunction::function ( const FunctionDomain domain,
FunctionValues values 
) const
pure virtual

◆ functionDeriv()

void Mantid::API::IFunction::functionDeriv ( const FunctionDomain domain,
Jacobian jacobian 
)
virtual

Derivatives of function with respect to active parameters.

Base class implementation calculates the derivatives numerically.

Parameters
domain:: The domain of the function
jacobian:: A Jacobian matrix. It is expected to have dimensions of domain.size() by nParams().

Reimplemented in Mantid::CurveFitting::Functions::Abragam, Mantid::CurveFitting::Functions::Bk2BkExpConvPV, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::IkedaCarpenterPV, Mantid::CurveFitting::Functions::PawleyParameterFunction, Mantid::CurveFitting::Functions::PawleyFunction, Mantid::CurveFitting::Functions::PeakParameterFunction, Mantid::CurveFitting::Functions::ProductFunction, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma, Mantid::CurveFitting::Functions::UserFunction, Mantid::API::CompositeFunction, Mantid::API::IFunction1D, Mantid::API::IFunction1DSpectrum, Mantid::API::IFunctionGeneral, Mantid::API::IFunctionMD, Mantid::API::ILatticeFunction, and Mantid::API::MultiDomainFunction.

Definition at line 155 of file IFunction.cpp.

References calNumericalDeriv().

Referenced by Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateDerivative(), and Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateHessian().

◆ getAttribute()

API::IFunction::Attribute Mantid::API::IFunction::getAttribute ( const std::string &  name) const
virtual

Return a value of attribute attName.

Parameters
name:: Returns the named attribute

Reimplemented in Mantid::API::FunctionParameterDecorator, Mantid::Crystal::PeakHKLErrors, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::Resolution, Mantid::CurveFitting::Functions::TabulatedFunction, Mantid::CurveFitting::Functions::UserFunction, Mantid::MDAlgorithms::UserFunctionMD, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, and Mantid::CurveFitting::Functions::CrystalFieldFunction.

Definition at line 1394 of file IFunction.cpp.

References hasAttribute(), m_attrs, and name().

Referenced by Mantid::CurveFitting::Functions::CrystalFieldControl::buildMultiSiteMultiSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldControl::buildMultiSiteSingleSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldControl::buildSingleSiteMultiSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldControl::buildSingleSiteSingleSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum::buildSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum::buildTargetFunction(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::calculateEigenSystem(), Mantid::PythonInterface::IFunctionAdapter::declareAttribute(), Mantid::CurveFitting::Functions::BSpline::derivative1D(), Mantid::CurveFitting::Functions::CubicSpline::derivative1D(), Mantid::CurveFitting::Functions::BSpline::function1D(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::function1D(), Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate::function1D(), Mantid::CurveFitting::Functions::CrystalFieldHeatCapacityBase::function1D(), Mantid::CurveFitting::Functions::CrystalFieldMagnetisationBase::function1D(), Mantid::CurveFitting::Functions::CrystalFieldMomentBase::function1D(), Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityBase::function1D(), Mantid::CurveFitting::Functions::CubicSpline::function1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::function1D(), Mantid::CurveFitting::Functions::HallRossSQE::function1D(), Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle::function1D(), Mantid::CurveFitting::Functions::InelasticDiffSphere::function1D(), Mantid::CurveFitting::Functions::InelasticIsoRotDiff::function1D(), Mantid::CurveFitting::Functions::TeixeiraWaterSQE::function1D(), Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function::function1D(), Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function::functionDeriv1D(), Mantid::CurveFitting::Functions::CrystalFieldPeaks::functionGeneral(), Mantid::CurveFitting::Functions::TabulatedFunction::getAttribute(), Mantid::API::CompositeFunction::getAttribute(), Mantid::API::FunctionGenerator::getAttribute(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getAttribute(), Mantid::PythonInterface::IFunctionAdapter::getAttributeValue(), Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle::HeightPrefactor(), Mantid::CurveFitting::Functions::ElasticDiffSphere::HeightPrefactor(), Mantid::CurveFitting::Functions::ElasticIsoRotDiff::HeightPrefactor(), Mantid::CurveFitting::Functions::BSpline::resetKnots(), Mantid::CurveFitting::Functions::BSpline::resetValidators(), Mantid::CurveFitting::Functions::CubicSpline::setAttribute(), Mantid::CurveFitting::Functions::FunctionQDepends::setAttribute(), Mantid::PythonInterface::IFunctionAdapter::setAttributePythonValue(), MantidQt::MantidWidgets::FunctionTreeView::setAttributeToFunction(), setAttributeValue(), MantidQt::MantidWidgets::ConvolutionFunctionModel::setPrefix(), Mantid::CurveFitting::Functions::CubicSpline::setupInput(), Mantid::CurveFitting::Functions::CubicSpline::setXAttribute(), MantidQt::MantidWidgets::FunctionModel::updateMultiDatasetAttributes(), Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum::updateSpectrum(), and writeToString().

◆ getAttributeNames()

std::vector< std::string > Mantid::API::IFunction::getAttributeNames ( ) const
virtual

◆ getConstraint()

IConstraint * Mantid::API::IFunction::getConstraint ( size_t  i) const
virtual

◆ getCovarianceMatrix()

std::shared_ptr< const Kernel::Matrix< double > > Mantid::API::IFunction::getCovarianceMatrix ( ) const
inline

Get the covariance matrix.

Definition at line 627 of file IFunction.h.

◆ getError() [1/2]

virtual double Mantid::API::IFunction::getError ( const std::string &  name) const
pure virtual

◆ getError() [2/2]

virtual double Mantid::API::IFunction::getError ( size_t  i) const
pure virtual

◆ getFunction()

IFunction_sptr Mantid::API::IFunction::getFunction ( size_t  i) const
virtual

◆ getHandler()

FunctionHandler * Mantid::API::IFunction::getHandler ( ) const
inline

Return the handler.

Definition at line 641 of file IFunction.h.

◆ getNumberDomains()

size_t Mantid::API::IFunction::getNumberDomains ( ) const
virtual

Get number of domains required by this function.

If it returns a number greater than 1 then the domain passed to function(domain, values) method must have a CompositeDomain type with the same number of parts.

Reimplemented in Mantid::API::CompositeFunction, Mantid::API::MultiDomainFunction, Mantid::CurveFitting::Functions::CrystalFieldFunction, and Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum.

Definition at line 1572 of file IFunction.cpp.

Referenced by export_IFunction().

◆ getParameter() [1/2]

virtual double Mantid::API::IFunction::getParameter ( const std::string &  name) const
pure virtual

◆ getParameter() [2/2]

virtual double Mantid::API::IFunction::getParameter ( size_t  i) const
pure virtual

◆ getParameterIndex()

virtual size_t Mantid::API::IFunction::getParameterIndex ( const ParameterReference ref) const
pure virtual

◆ getParameterNames()

std::vector< std::string > Mantid::API::IFunction::getParameterNames ( ) const

Return a vector with all parameter names.

Definition at line 551 of file IFunction.cpp.

References nParams().

Referenced by Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeak(), and Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeaksFromTable().

◆ getParameterStatus()

virtual ParameterStatus Mantid::API::IFunction::getParameterStatus ( size_t  i) const
pure virtual

◆ getReducedChiSquared()

double Mantid::API::IFunction::getReducedChiSquared ( ) const
inline

Get the reduced chi^2.

Definition at line 631 of file IFunction.h.

◆ getTie()

ParameterTie * Mantid::API::IFunction::getTie ( size_t  i) const
virtual

◆ getValuesSize()

size_t Mantid::API::IFunction::getValuesSize ( const FunctionDomain domain) const
virtual

Get number of values for a given domain.

Parameters
domain:: A domain.

Reimplemented in Mantid::API::IFunctionGeneral.

Definition at line 1510 of file IFunction.cpp.

References Mantid::API::FunctionDomain::size().

Referenced by calNumericalDeriv().

◆ hasAttribute()

bool Mantid::API::IFunction::hasAttribute ( const std::string &  name) const
virtual

◆ hasOrderedTies()

bool Mantid::API::IFunction::hasOrderedTies ( ) const
protected

Definition at line 295 of file IFunction.cpp.

References m_orderedTies.

Referenced by applyTies(), and Mantid::API::CompositeFunction::applyTies().

◆ hasParameter()

virtual bool Mantid::API::IFunction::hasParameter ( const std::string &  name) const
pure virtual

◆ ignoreTie()

virtual bool Mantid::API::IFunction::ignoreTie ( const ParameterTie ) const
inlinevirtual

Ignore a tie.

Reimplemented in Mantid::CurveFitting::Functions::CrystalFieldFunction.

Definition at line 558 of file IFunction.h.

Referenced by sortTies().

◆ init()

void Mantid::API::IFunction::init ( )
protectedvirtual

Function initialization. Declare function parameters in this method.

Initialize the function. Calls declareAttributes & declareParameters.

Reimplemented in Mantid::CurveFitting::Functions::Quadratic, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::Crystal::PeakHKLErrors, Mantid::CurveFitting::Functions::Abragam, Mantid::CurveFitting::Functions::ActivationK, Mantid::CurveFitting::Functions::ActivationmeV, Mantid::CurveFitting::Functions::AsymmetricPearsonVII, Mantid::CurveFitting::Functions::BackToBackExponential, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::Bk2BkExpConvPV, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::ConvTempCorrection, Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate, Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum, Mantid::CurveFitting::Functions::CrystalFieldSpectrum, Mantid::CurveFitting::Functions::DecoupAsymPowderMagLong, Mantid::CurveFitting::Functions::DecoupAsymPowderMagRot, Mantid::CurveFitting::Functions::DiffRotDiscreteCircle, Mantid::CurveFitting::Functions::DiffSphere, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::ElasticDiffSphere, Mantid::CurveFitting::Functions::ElasticIsoRotDiff, Mantid::CurveFitting::Functions::EndErfc, Mantid::CurveFitting::Functions::ExpDecayMuon, Mantid::CurveFitting::Functions::ExpDecayOsc, Mantid::CurveFitting::Functions::FlatBackground, Mantid::CurveFitting::Functions::GausDecay, Mantid::CurveFitting::Functions::GausOsc, Mantid::CurveFitting::Functions::Gaussian, Mantid::CurveFitting::Functions::GramCharlier, Mantid::CurveFitting::Functions::IkedaCarpenterPV, Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::InelasticDiffSphere, Mantid::CurveFitting::Functions::InelasticIsoRotDiff, Mantid::CurveFitting::Functions::IsoRotDiff, Mantid::CurveFitting::Functions::Keren, Mantid::CurveFitting::Functions::LinearBackground, Mantid::CurveFitting::Functions::Lorentzian, Mantid::CurveFitting::Functions::MagneticOrderParameter, Mantid::CurveFitting::Functions::MuonFInteraction, Mantid::CurveFitting::Functions::MuoniumDecouplingCurve, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PawleyParameterFunction, Mantid::CurveFitting::Functions::PawleyFunction, Mantid::CurveFitting::Functions::PowerLaw, Mantid::CurveFitting::Functions::ProductFunction, Mantid::CurveFitting::Functions::PseudoVoigt, Mantid::CurveFitting::Functions::Quadratic, Mantid::CurveFitting::Functions::ReflectivityMulf, Mantid::CurveFitting::Functions::SmoothTransition, Mantid::CurveFitting::Functions::StaticKuboToyabe, Mantid::CurveFitting::Functions::StaticKuboToyabeTimesExpDecay, Mantid::CurveFitting::Functions::StaticKuboToyabeTimesGausDecay, Mantid::CurveFitting::Functions::StaticKuboToyabeTimesStretchExp, Mantid::CurveFitting::Functions::StretchExpMuon, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma, Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction, Mantid::CurveFitting::LatticeFunction, and Mantid::PythonInterface::IFunctionAdapter.

Definition at line 1454 of file IFunction.cpp.

References declareAttributes(), and declareParameters().

◆ initialize()

virtual void Mantid::API::IFunction::initialize ( )
inlinevirtual

◆ isActive()

bool Mantid::API::IFunction::isActive ( size_t  i) const

Check if an active parameter i is actually active.

Parameters
i:: Index of a parameter.

Definition at line 160 of file IFunction.cpp.

References Active, and getParameterStatus().

Referenced by activeParameter(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::activeParameter(), Mantid::CurveFitting::Functions::Gaussian::activeParameter(), Mantid::CurveFitting::Functions::Keren::activeParameter(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::cacheYSpaceValues(), Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateDerivative(), Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateHessian(), calNumericalDeriv(), descriptionOfActive(), Mantid::CurveFitting::EigenJacobian::EigenJacobian(), fixAll(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::HallRossSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::TeixeiraWaterSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::intensityParameterIndices(), nameOfActive(), Mantid::CurveFitting::Functions::Convolution::refreshResolution(), setActiveParameter(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::setActiveParameter(), Mantid::CurveFitting::Functions::Gaussian::setActiveParameter(), Mantid::CurveFitting::Functions::Keren::setActiveParameter(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::setMatrixWorkspace(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().

◆ isExplicitlySet()

virtual bool Mantid::API::IFunction::isExplicitlySet ( size_t  i) const
pure virtual

◆ isFixed()

bool Mantid::API::IFunction::isFixed ( size_t  i) const

Check if a parameter i is fixed.

Query if the parameter is fixed.

Parameters
i:: The index of a declared parameter
Returns
true if parameter i is fixed

Definition at line 167 of file IFunction.cpp.

References Fixed, FixedByDefault, and getParameterStatus().

Referenced by export_IFunction(), unfixAll(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().

◆ isFixedByDefault()

bool Mantid::API::IFunction::isFixedByDefault ( size_t  i) const

Check if a parameter i is fixed by default (not by user).

Parameters
i:: The index of a parameter
Returns
true if parameter i is fixed by default

Definition at line 175 of file IFunction.cpp.

References FixedByDefault, and getParameterStatus().

◆ isParallel()

bool Mantid::API::IFunction::isParallel ( ) const
inline

Get the parallel hint.

Definition at line 636 of file IFunction.h.

◆ iterationFinished()

virtual void Mantid::API::IFunction::iterationFinished ( )
inlinevirtual

Called at the end of an iteration.

Reimplemented in Mantid::API::MultiDomainFunction, and Mantid::FrameworkTestHelpers::FunctionChangesNParams.

Definition at line 460 of file IFunction.h.

◆ iterationStarting()

virtual void Mantid::API::IFunction::iterationStarting ( )
inlinevirtual

◆ name()

virtual std::string Mantid::API::IFunction::name ( ) const
pure virtual

Returns the function's name.

Implemented in Mantid::API::CompositeFunction, Mantid::API::ImmutableCompositeFunction, Mantid::API::MultiDomainFunction, Mantid::Crystal::PeakHKLErrors, Mantid::Crystal::SCDCalibratePanels2ObjFunc, Mantid::Crystal::SCDPanelErrors, Mantid::CurveFitting::Functions::Abragam, Mantid::CurveFitting::Functions::ActivationK, Mantid::CurveFitting::Functions::ActivationmeV, Mantid::CurveFitting::Functions::AsymmetricPearsonVII, Mantid::CurveFitting::Functions::BackToBackExponential, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::Bk2BkExpConvPV, Mantid::CurveFitting::Functions::BSpline, Mantid::CurveFitting::Functions::Chebyshev, Mantid::CurveFitting::Functions::ChudleyElliotSQE, Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::ComptonScatteringCountRate, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::ConvTempCorrection, Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate, Mantid::CurveFitting::Functions::CrystalFieldSpectrumControl, Mantid::CurveFitting::Functions::CrystalFieldPhysPropControl, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::CrystalFieldHeatCapacity, Mantid::CurveFitting::Functions::CrystalFieldHeatCapacityCalculation, Mantid::CurveFitting::Functions::CrystalFieldMagnetisation, Mantid::CurveFitting::Functions::CrystalFieldMagnetisationCalculation, Mantid::CurveFitting::Functions::CrystalFieldMoment, Mantid::CurveFitting::Functions::CrystalFieldMomentCalculation, Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum, Mantid::CurveFitting::Functions::CrystalFieldPeaks, Mantid::CurveFitting::Functions::CrystalFieldPeaksBaseImpl, Mantid::CurveFitting::Functions::CrystalFieldSpectrum, Mantid::CurveFitting::Functions::CrystalFieldSusceptibility, Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityCalculation, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::DecoupAsymPowderMagLong, Mantid::CurveFitting::Functions::DecoupAsymPowderMagRot, Mantid::CurveFitting::Functions::DeltaFunction, Mantid::CurveFitting::Functions::DiffRotDiscreteCircle, Mantid::CurveFitting::Functions::DiffSphere, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::ElasticDiffSphere, Mantid::CurveFitting::Functions::ElasticIsoRotDiff, Mantid::CurveFitting::Functions::EndErfc, Mantid::CurveFitting::Functions::ExpDecay, Mantid::CurveFitting::Functions::ExpDecayMuon, Mantid::CurveFitting::Functions::ExpDecayOsc, Mantid::CurveFitting::Functions::FickDiffusionSQE, Mantid::CurveFitting::Functions::FlatBackground, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::GausDecay, Mantid::CurveFitting::Functions::GausOsc, Mantid::CurveFitting::Functions::Gaussian, Mantid::CurveFitting::Functions::GaussianComptonProfile, Mantid::CurveFitting::Functions::GramCharlier, Mantid::CurveFitting::Functions::GramCharlierComptonProfile, Mantid::CurveFitting::Functions::HallRossSQE, Mantid::CurveFitting::Functions::IkedaCarpenterPV, Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::InelasticDiffSphere, Mantid::CurveFitting::Functions::InelasticIsoRotDiff, Mantid::CurveFitting::Functions::IsoRotDiff, Mantid::CurveFitting::Functions::Keren, Mantid::CurveFitting::Functions::LinearBackground, Mantid::CurveFitting::Functions::LogNormal, Mantid::CurveFitting::Functions::Lorentzian, Mantid::CurveFitting::Functions::MagneticOrderParameter, Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile, Mantid::CurveFitting::Functions::MuonFInteraction, Mantid::CurveFitting::Functions::MuoniumDecouplingCurve, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PawleyParameterFunction, Mantid::CurveFitting::Functions::PawleyFunction, Mantid::CurveFitting::Functions::PeakParameterFunction, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::PowerLaw, Mantid::CurveFitting::Functions::ProductFunction, Mantid::CurveFitting::Functions::ProductLinearExp, Mantid::CurveFitting::Functions::ProductQuadraticExp, Mantid::CurveFitting::Functions::PseudoVoigt, Mantid::CurveFitting::Functions::Quadratic, Mantid::CurveFitting::Functions::ReflectivityMulf, Mantid::CurveFitting::Functions::Resolution, Mantid::CurveFitting::Functions::SmoothTransition, 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::TeixeiraWaterSQE, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpAlpha, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpBeta, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpSigma, Mantid::CurveFitting::Functions::ThermalNeutronDtoTOFFunction, Mantid::CurveFitting::Functions::UserFunction, Mantid::CurveFitting::Functions::VesuvioResolution, Mantid::CurveFitting::Functions::Voigt, Mantid::CurveFitting::LatticeFunction, Mantid::MDAlgorithms::UserFunctionMD, Mantid::PythonInterface::IFunctionAdapter, Mantid::FrameworkTestHelpers::FunctionChangesNParams, and Mantid::FrameworkTestHelpers::MultiDomainFunctionTest_Function.

Referenced by addTies(), checkAttributeName(), Mantid::API::FunctionParameterDecorator::clone(), declareAttribute(), Mantid::API::FunctionParameterDecorator::declareParameter(), Mantid::API::ParamFunction::declareParameter(), export_IFunction(), fixParameter(), getAttribute(), Mantid::API::IPeakFunction::getCentreParameterName(), Mantid::API::FunctionGenerator::getError(), Mantid::API::FunctionParameterDecorator::getError(), Mantid::API::ParamFunction::getError(), getFunction(), Mantid::API::FunctionGenerator::getParameter(), Mantid::API::FunctionParameterDecorator::getParameter(), Mantid::API::ParamFunction::getParameter(), hasAttribute(), Mantid::API::FunctionGenerator::hasParameter(), Mantid::API::FunctionParameterDecorator::hasParameter(), Mantid::API::ParamFunction::hasParameter(), Mantid::CurveFitting::Constraints::BoundaryConstraint::initialize(), Mantid::API::FunctionGenerator::parameterIndex(), Mantid::API::FunctionParameterDecorator::parameterIndex(), Mantid::API::ParamFunction::parameterIndex(), registerFunctionUsage(), setAttribute(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::setAttribute(), Mantid::API::FunctionGenerator::setError(), Mantid::API::FunctionParameterDecorator::setError(), Mantid::API::ParamFunction::setError(), setMatrixWorkspace(), Mantid::API::IPowderDiffPeakFunction::setMillerIndex(), Mantid::API::FunctionGenerator::setParameter(), Mantid::API::FunctionParameterDecorator::setParameter(), Mantid::API::IPeakFunction::setParameter(), Mantid::API::IPowderDiffPeakFunction::setParameter(), Mantid::API::ParamFunction::setParameter(), Mantid::API::FunctionGenerator::setParameterDescription(), Mantid::API::FunctionParameterDecorator::setParameterDescription(), Mantid::API::ParamFunction::setParameterDescription(), Mantid::CurveFitting::Functions::CrystalFieldUtils::setWidthConstraint(), storeAttributeValue(), storeReadOnlyAttribute(), unfixParameter(), Mantid::CurveFitting::ParameterEstimator::whichFunction(), and writeToString().

◆ nameOfActive()

std::string Mantid::API::IFunction::nameOfActive ( size_t  i) const
virtual

Returns the name of active parameter i.

Returns the name of an active parameter.

Parameters
i:: Index of a parameter. The parameter must be active.

Reimplemented in Mantid::API::CompositeFunction.

Definition at line 1008 of file IFunction.cpp.

References isActive(), and parameterName().

◆ nAttributes()

size_t Mantid::API::IFunction::nAttributes ( ) const
virtual

◆ nFunctions()

virtual std::size_t Mantid::API::IFunction::nFunctions ( ) const
inlinevirtual

◆ nParams()

virtual size_t Mantid::API::IFunction::nParams ( ) const
pure virtual

◆ operator=()

IFunction & Mantid::API::IFunction::operator= ( const IFunction )
delete

No copying.

◆ parameterDescription()

virtual std::string Mantid::API::IFunction::parameterDescription ( size_t  i) const
pure virtual

◆ parameterIndex()

virtual size_t Mantid::API::IFunction::parameterIndex ( const std::string &  name) const
pure virtual

◆ parameterName()

virtual std::string Mantid::API::IFunction::parameterName ( size_t  i) const
pure virtual

◆ registerFunctionUsage()

void Mantid::API::IFunction::registerFunctionUsage ( bool  internal)
virtual

Registers the usage of the algorithm with the UsageService.

Registers the usage of the function with the UsageService.

Reimplemented in Mantid::API::CompositeFunction.

Definition at line 97 of file IFunction.cpp.

References Mantid::Kernel::Function, Mantid::Kernel::SingletonHolder< T >::Instance(), m_isRegistered, and name().

◆ removeConstraint()

void Mantid::API::IFunction::removeConstraint ( const std::string &  parName)
virtual

Remove a constraint.

Parameters
parName:: The name of a parameter which constarint to remove.

Reimplemented in Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.

Definition at line 403 of file IFunction.cpp.

References m_constraints, and parameterIndex().

Referenced by export_IFunction(), Mantid::API::CompositeFunction::removeConstraint(), and Mantid::CurveFitting::Functions::CrystalFieldUtils::setWidthConstraint().

◆ removeTie() [1/2]

void Mantid::API::IFunction::removeTie ( const std::string &  parName)
virtual

Removes the tie off a parameter.

The parameter becomes active This method can be used when constructing and editing the IFunction in a GUI

Parameters
parName:: The name of the parameter which ties will be removed.

Reimplemented in Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.

Definition at line 254 of file IFunction.cpp.

References parameterIndex(), and removeTie().

Referenced by export_IFunction(), removeTie(), Mantid::API::CompositeFunction::removeTie(), and Mantid::CurveFitting::Functions::Gaussian::unfixIntensity().

◆ removeTie() [2/2]

bool Mantid::API::IFunction::removeTie ( size_t  i)
virtual

Removes i-th parameter's tie.

Removes i-th parameter's tie if it is tied or does nothing.

Parameters
i:: The index of the tied parameter.
Returns
True if successfull

Reimplemented in Mantid::API::CompositeFunction, Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.

Definition at line 338 of file IFunction.cpp.

References Active, m_ties, nParams(), setParameterStatus(), and unfix().

◆ reportProgress()

void Mantid::API::IFunction::reportProgress ( const std::string &  msg = "") const

Reports progress with an optional message.

If a reporter object is set, reports progress with an optional message.

Parameters
msg:: A message to display (default = "")

Definition at line 132 of file IFunction.cpp.

References m_progReporter.

Referenced by Mantid::API::IFunctionMD::evaluateFunction().

◆ setActiveParameter()

void Mantid::API::IFunction::setActiveParameter ( size_t  i,
double  value 
)
virtual

◆ setAttribute()

void Mantid::API::IFunction::setAttribute ( const std::string &  name,
const Attribute value 
)
virtual

Set a value to attribute attName.

Set a value to a named attribute.

Can be overridden in the inheriting class, the default just stores the value

Parameters
name:: The name of the attribute
value:: The value of the attribute

Reimplemented in Mantid::PythonInterface::IFunctionAdapter, Mantid::CurveFitting::Functions::BSpline, Mantid::CurveFitting::Functions::Chebyshev, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::ReflectivityMulf, Mantid::CurveFitting::Functions::Resolution, Mantid::MDAlgorithms::UserFunctionMD, Mantid::CurveFitting::Functions::PawleyParameterFunction, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::UserFunction, Mantid::API::FunctionParameterDecorator, Mantid::Crystal::PeakHKLErrors, Mantid::Crystal::SCDPanelErrors, Mantid::CurveFitting::Functions::TabulatedFunction, Mantid::CurveFitting::Functions::FunctionQDepends, Mantid::CurveFitting::Functions::DiffRotDiscreteCircle, Mantid::CurveFitting::Functions::DiffSphere, Mantid::CurveFitting::Functions::IsoRotDiff, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::CurveFitting::Functions::CrystalFieldControl, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::CrystalFieldMultiSpectrum, Mantid::CurveFitting::Functions::CrystalFieldPeaksBase, Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::ComptonScatteringCountRate, Mantid::CurveFitting::Functions::GramCharlierComptonProfile, Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile, and Mantid::CurveFitting::Functions::VesuvioResolution.

Definition at line 1409 of file IFunction.cpp.

References name(), storeAttributeValue(), and value.

Referenced by Mantid::CurveFitting::Functions::CrystalFieldControl::parseStringListAttribute(), Mantid::PythonInterface::IFunctionAdapter::setAttribute(), Mantid::CurveFitting::Functions::DynamicKuboToyabe::setAttribute(), Mantid::CurveFitting::Functions::UserFunction::setAttribute(), Mantid::Crystal::SCDPanelErrors::setAttribute(), Mantid::CurveFitting::Functions::TabulatedFunction::setAttribute(), Mantid::CurveFitting::Functions::FunctionQDepends::setAttribute(), Mantid::API::CompositeFunction::setAttribute(), Mantid::API::FunctionGenerator::setAttribute(), Mantid::CurveFitting::Functions::CrystalFieldControl::setAttribute(), Mantid::CurveFitting::Functions::CrystalFieldFunction::setAttribute(), Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::setAttribute(), Mantid::CurveFitting::Functions::ComptonPeakProfile::setAttribute(), Mantid::CurveFitting::Functions::GramCharlierComptonProfile::setAttribute(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::setAttribute(), Mantid::CurveFitting::Functions::VesuvioResolution::setAttribute(), Mantid::PythonInterface::IFunctionAdapter::setAttributePythonValue(), MantidQt::MantidWidgets::FunctionTreeView::setAttributeToFunction(), and setAttributeValue().

◆ setAttributeValue() [1/3]

void Mantid::API::IFunction::setAttributeValue ( const std::string &  attName,
const char *  value 
)

Overload for const char* values.

Parameters
attName:: Attribute name
value:: New attribute value to set

Definition at line 1346 of file IFunction.cpp.

References setAttributeValue(), and value.

◆ setAttributeValue() [2/3]

void Mantid::API::IFunction::setAttributeValue ( const std::string &  attName,
const std::string &  value 
)

Set string attribute by value.

Make sure that quoted style doesn't change.

Parameters
attName:: Attribute name
value:: New attribute value to set

Definition at line 1356 of file IFunction.cpp.

References getAttribute(), setAttribute(), Mantid::API::IFunction::Attribute::setString(), and value.

◆ setAttributeValue() [3/3]

template<typename T >
void Mantid::API::IFunction::setAttributeValue ( const std::string &  attName,
const T &  value 
)
inline

◆ setConstraintPenaltyFactor()

void Mantid::API::IFunction::setConstraintPenaltyFactor ( const std::string &  parName,
const double &  c 
)
virtual

Set a constraint penalty.

Parameters
parName:: The name of a constraint
c:: The penalty

Definition at line 417 of file IFunction.cpp.

References Mantid::API::g_log, m_constraints, parameterIndex(), and Mantid::Kernel::Logger::warning().

Referenced by export_IFunction().

◆ setCovarianceMatrix()

void Mantid::API::IFunction::setCovarianceMatrix ( const std::shared_ptr< Kernel::Matrix< double > > &  covar)

Set the covariance matrix.

Algorithm Fit sets this matrix to the top-level function after fitting. If the function is composite the matrix isn't set to its members. The matrix must be square and its size equal to the number of parameters of this function.

Parameters
covar:: A matrix to set.

Definition at line 1496 of file IFunction.cpp.

References m_covar, and nParams().

◆ setError() [1/2]

virtual void Mantid::API::IFunction::setError ( const std::string &  name,
double  err 
)
pure virtual

◆ setError() [2/2]

virtual void Mantid::API::IFunction::setError ( size_t  i,
double  err 
)
pure virtual

◆ setHandler()

void Mantid::API::IFunction::setHandler ( std::unique_ptr< FunctionHandler handler)

Set a function handler.

Parameters
handler:: A new handler

Definition at line 562 of file IFunction.cpp.

References m_handler.

◆ setMatrixWorkspace()

void Mantid::API::IFunction::setMatrixWorkspace ( std::shared_ptr< const API::MatrixWorkspace workspace,
size_t  wi,
double  startX,
double  endX 
)
virtual

◆ setParallel()

void Mantid::API::IFunction::setParallel ( bool  on)
inline

Set the parallel hint.

Definition at line 634 of file IFunction.h.

◆ setParameter() [1/2]

virtual void Mantid::API::IFunction::setParameter ( const std::string &  name,
const double &  value,
bool  explicitlySet = true 
)
pure virtual

◆ setParameter() [2/2]

virtual void Mantid::API::IFunction::setParameter ( size_t  ,
const double &  value,
bool  explicitlySet = true 
)
pure virtual

◆ setParameterDescription() [1/2]

virtual void Mantid::API::IFunction::setParameterDescription ( const std::string &  name,
const std::string &  description 
)
pure virtual

◆ setParameterDescription() [2/2]

virtual void Mantid::API::IFunction::setParameterDescription ( size_t  ,
const std::string &  description 
)
pure virtual

◆ setParameterStatus()

virtual void Mantid::API::IFunction::setParameterStatus ( size_t  i,
ParameterStatus  status 
)
pure virtual

◆ setProgressReporter()

void Mantid::API::IFunction::setProgressReporter ( std::shared_ptr< Kernel::ProgressBase reporter)

Attach a progress reporter.

Parameters
reporter:: A pointer to a progress reporter that can be called during function evaluation

Definition at line 123 of file IFunction.cpp.

References m_progReporter.

◆ setReducedChiSquared()

void Mantid::API::IFunction::setReducedChiSquared ( double  chi2)
inline

Set the reduced chi^2.

Definition at line 629 of file IFunction.h.

◆ setStepSizeMethod()

void Mantid::API::IFunction::setStepSizeMethod ( const StepSizeMethod  method)
virtual

Sets the StepSizeMethod to use when calculation the step size.

Sets the function to use when calculating the step size.

Parameters
method:: An enum indicating which method to use when calculating the step size.

Reimplemented in Mantid::API::CompositeFunction.

Definition at line 1082 of file IFunction.cpp.

References DEFAULT, m_stepSizeFunction, and SQRT_EPSILON.

◆ setUpForFit()

void Mantid::API::IFunction::setUpForFit ( )
virtual

◆ setWorkspace()

virtual void Mantid::API::IFunction::setWorkspace ( std::shared_ptr< const Workspace ws)
inlinevirtual

◆ sortTies()

void Mantid::API::IFunction::sortTies ( )

Put all ties in order in which they will be applied correctly.

Definition at line 1584 of file IFunction.cpp.

References Mantid::API::ParameterTie::asString(), getParameterIndex(), getTie(), ignoreTie(), m_orderedTies, nParams(), and tie().

◆ storeAttributeValue()

void Mantid::API::IFunction::storeAttributeValue ( const std::string &  name,
const API::IFunction::Attribute value 
)
protected

◆ storeReadOnlyAttribute()

void Mantid::API::IFunction::storeReadOnlyAttribute ( const std::string &  name,
const API::IFunction::Attribute value 
) const
protected

A read-only ("mutable") attribute can be stored in a const method.

Store a value to a named attribute if it can be considered "mutable" or read only, which simply reflects the current state of the function.

Parameters
name:: The name of the attribute
value:: The value of the attribute

Definition at line 1483 of file IFunction.cpp.

References name(), storeAttributeValue(), and value.

Referenced by Mantid::CurveFitting::Functions::CrystalFieldSpectrum::buildTargetFunction(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::updateTargetFunction().

◆ tie()

void Mantid::API::IFunction::tie ( const std::string &  parName,
const std::string &  expr,
bool  isDefault = false 
)
virtual

◆ unfix()

void Mantid::API::IFunction::unfix ( size_t  i)

Restores a declared parameter i to the active status.

Makes a parameter active again.

It doesn't change the parameter's tie.

Parameters
i:: A declared parameter index to be restored to active

Definition at line 197 of file IFunction.cpp.

References Active, getParameterStatus(), parameterName(), setParameterStatus(), Tied, and std::to_string().

Referenced by export_IFunction(), removeTie(), unfixAll(), unfixAllDefault(), and unfixParameter().

◆ unfixAll()

void Mantid::API::IFunction::unfixAll ( )

Free all parameters.

Definition at line 1538 of file IFunction.cpp.

References isFixed(), nParams(), and unfix().

Referenced by export_IFunction().

◆ unfixAllDefault()

void Mantid::API::IFunction::unfixAllDefault ( )

Free all parameters fixed by default.

Definition at line 1547 of file IFunction.cpp.

References FixedByDefault, getParameterStatus(), nParams(), and unfix().

Referenced by Mantid::CurveFitting::Functions::CrystalFieldUtils::updatePeak().

◆ unfixParameter()

void Mantid::API::IFunction::unfixParameter ( const std::string &  name)

◆ writeConstraints()

std::string Mantid::API::IFunction::writeConstraints ( ) const

Write a parameter constraint to a string.

Write all parameter constraints owned by this function to a string.

Returns
A constraint string for the parameter.

Definition at line 441 of file IFunction.cpp.

References m_constraints.

Referenced by export_IFunction(), writeToString(), Mantid::API::CompositeFunction::writeToString(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().

◆ writeTies()

std::string Mantid::API::IFunction::writeTies ( ) const

Write a parameter tie to a string.

Write all parameter ties owned by this function to a string.

Returns
A tie string for the parameter.

Definition at line 261 of file IFunction.cpp.

References m_ties, and tie().

Referenced by export_IFunction(), writeToString(), Mantid::API::CompositeFunction::writeToString(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().

◆ writeToString()

std::string Mantid::API::IFunction::writeToString ( const std::string &  parentLocalAttributesStr = "") const
protectedvirtual

Writes itself into a string.

Writes this function into a string.

Parameters
parentLocalAttributesStr:: A preformatted string with local attributes of a parent composite function. Can be passed in by a CompositeFunction (eg MultiDomainFunction).
Returns
string representation of the function

Reimplemented in Mantid::API::CompositeFunction, Mantid::API::ImmutableCompositeFunction, and Mantid::CurveFitting::Functions::CrystalFieldSpectrum.

Definition at line 471 of file IFunction.cpp.

References Fixed, getAttribute(), getAttributeNames(), getParameter(), getParameterStatus(), Mantid::Kernel::Strings::join(), name(), nParams(), parameterName(), Mantid::API::IFunction::Attribute::value(), writeConstraints(), and writeTies().

Referenced by asString(), and Mantid::API::ImmutableCompositeFunction::writeToString().

Friends And Related Function Documentation

◆ CompositeFunction

friend class CompositeFunction
friend

◆ FunctionGenerator

friend class FunctionGenerator
friend

Definition at line 701 of file IFunction.h.

◆ FunctionParameterDecorator

friend class FunctionParameterDecorator
friend

Definition at line 700 of file IFunction.h.

◆ ParameterTie

friend class ParameterTie
friend

Definition at line 698 of file IFunction.h.

Member Data Documentation

◆ m_attrs

std::map<std::string, API::IFunction::Attribute> Mantid::API::IFunction::m_attrs
private

◆ m_chiSquared

double Mantid::API::IFunction::m_chiSquared
private

The chi-squared of the last fit.

Definition at line 718 of file IFunction.h.

◆ m_constraints

std::vector<std::unique_ptr<IConstraint> > Mantid::API::IFunction::m_constraints
private

Holds the constraints added to function.

Definition at line 722 of file IFunction.h.

Referenced by addConstraint(), clearConstraints(), getConstraint(), removeConstraint(), setConstraintPenaltyFactor(), setUpForFit(), and writeConstraints().

◆ m_covar

std::shared_ptr<Kernel::Matrix<double> > Mantid::API::IFunction::m_covar
private

The covariance matrix of the fitting parameters.

Definition at line 716 of file IFunction.h.

Referenced by setCovarianceMatrix().

◆ m_handler

std::unique_ptr<FunctionHandler> Mantid::API::IFunction::m_handler
protected

Pointer to a function handler.

Definition at line 707 of file IFunction.h.

Referenced by setHandler().

◆ m_isParallel

bool Mantid::API::IFunction::m_isParallel
protected

Flag to hint that the function is being used in parallel computations.

Definition at line 704 of file IFunction.h.

◆ m_isRegistered

bool Mantid::API::IFunction::m_isRegistered {false}
private

whether the function usage has been registered

Definition at line 726 of file IFunction.h.

Referenced by registerFunctionUsage().

◆ m_orderedTies

std::vector<ParameterTie *> Mantid::API::IFunction::m_orderedTies
private

Ties ordered in order of correct application.

Definition at line 724 of file IFunction.h.

Referenced by applyOrderedTies(), hasOrderedTies(), and sortTies().

◆ m_progReporter

std::shared_ptr<Kernel::ProgressBase> Mantid::API::IFunction::m_progReporter
protected

Pointer to the progress handler.

Definition at line 710 of file IFunction.h.

Referenced by cancellationRequestReceived(), reportProgress(), and setProgressReporter().

◆ m_stepSizeFunction

std::function<double(const double)> Mantid::API::IFunction::m_stepSizeFunction
private

The function used to calculate the step size.

Definition at line 728 of file IFunction.h.

Referenced by calculateStepSize(), and setStepSizeMethod().

◆ m_ties

std::vector<std::unique_ptr<ParameterTie> > Mantid::API::IFunction::m_ties
private

Holds parameter ties.

Definition at line 720 of file IFunction.h.

Referenced by addTie(), applyTies(), clearTies(), getTie(), removeTie(), and writeTies().


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