Mantid
|
This is an interface to a fitting function - a semi-abstarct class. More...
#include <IFunction.h>
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< IFunction > | clone () 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... | |
IFunction & | operator= (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 ParameterTie * | getTie (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 IConstraint * | getConstraint (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< FunctionHandler > | m_handler |
Pointer to a function handler. More... | |
std::shared_ptr< Kernel::ProgressBase > | m_progReporter |
Pointer to the progress handler. More... | |
std::map< std::string, API::IFunction::Attribute > | m_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< IFunction > | getFunction (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... | |
FunctionHandler * | getHandler () 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... | |
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.
Definition at line 163 of file IFunction.h.
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.
|
strong |
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.
Mantid::API::IFunction::IFunction | ( | ) |
Constructor.
Definition at line 86 of file IFunction.cpp.
|
virtual |
|
delete |
No copying.
|
virtual |
Value of i-th active parameter.
Override this method to make fitted parameters different from the declared
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionParameterDecorator, Mantid::CurveFitting::Functions::AsymmetricPearsonVII, Mantid::CurveFitting::Functions::Gaussian, Mantid::CurveFitting::Functions::Keren, and Mantid::PythonInterface::IFunctionAdapter.
Definition at line 988 of file IFunction.cpp.
References getParameter(), isActive(), and parameterName().
Referenced by Mantid::PythonInterface::IFunctionAdapter::activeParameter(), calNumericalDeriv(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::HallRossSQE::functionDeriv1D(), and Mantid::CurveFitting::Functions::TeixeiraWaterSQE::functionDeriv1D().
|
virtual |
Add a constraint to function.
Add a constraint.
ic | :: Pointer to a constraint. |
Reimplemented in Mantid::API::FunctionParameterDecorator.
Definition at line 376 of file IFunction.cpp.
References m_constraints.
Referenced by Mantid::CurveFitting::Functions::PawleyParameterFunction::addAngleConstraint(), addConstraints(), Mantid::CurveFitting::Functions::PawleyParameterFunction::addLengthConstraint(), Mantid::CurveFitting::Functions::AsymmetricPearsonVII::init(), Mantid::CurveFitting::Functions::ElasticDiffRotDiscreteCircle::init(), Mantid::CurveFitting::Functions::ElasticDiffSphere::init(), Mantid::CurveFitting::Functions::ElasticIsoRotDiff::init(), Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle::init(), Mantid::CurveFitting::Functions::InelasticIsoRotDiff::init(), Mantid::CurveFitting::Functions::BivariateNormal::initCommon(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::lowerConstraint0(), setMatrixWorkspace(), and Mantid::CurveFitting::Functions::CrystalFieldUtils::setWidthConstraint().
|
virtual |
Add a list of conatraints from a string.
Add a list of constraints from a string.
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().
|
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.
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().
|
virtual |
Add several ties.
Add ties to the function.
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().
|
protected |
Definition at line 297 of file IFunction.cpp.
References m_orderedTies, and tie().
Referenced by applyTies(), and Mantid::API::CompositeFunction::applyTies().
|
virtual |
Apply the ties.
Reimplemented in Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.
Definition at line 306 of file IFunction.cpp.
References applyOrderedTies(), hasOrderedTies(), m_ties, and tie().
Referenced by addTies(), Mantid::API::CompositeFunction::applyTies(), calNumericalDeriv(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::HallRossSQE::functionDeriv1D(), and Mantid::CurveFitting::Functions::TeixeiraWaterSQE::functionDeriv1D().
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.
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<<().
|
virtual |
Get name of ith attribute.
Return the name of the ith attribute by querying the stored attributes in m_attrs.
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().
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.
parameterValue | :: The value of the active parameter. |
Definition at line 1077 of file IFunction.cpp.
References m_stepSizeFunction.
Referenced by calNumericalDeriv().
void Mantid::API::IFunction::calNumericalDeriv | ( | const FunctionDomain & | domain, |
Jacobian & | jacobian | ||
) |
Calculate numerical derivatives.
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().
bool Mantid::API::IFunction::cancellationRequestReceived | ( | ) | const |
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.
|
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.
|
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().
|
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().
|
protected |
Check Attribute to declare does not already exist.
Checks Attribute of "name" does not exist.
name | :: The name of the attribute |
Definition at line 1445 of file IFunction.cpp.
References m_attrs, and name().
Referenced by declareAttribute().
|
virtual |
Remove all constraints.
Definition at line 431 of file IFunction.cpp.
References m_constraints.
Referenced by Mantid::API::ParamFunction::clearAllParameters().
|
virtual |
Remove all ties.
Reimplemented in Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.
Definition at line 366 of file IFunction.cpp.
References Active, m_ties, nParams(), and setParameterStatus().
Referenced by Mantid::API::ParamFunction::clearAllParameters(), and Mantid::API::CompositeFunction::clearTies().
|
virtual |
Virtual copy constructor.
Reimplemented in Mantid::API::FunctionParameterDecorator, and Mantid::API::IFunctionMD.
Definition at line 109 of file IFunction.cpp.
References asString(), error, getError(), Mantid::Kernel::SingletonHolder< T >::Instance(), and nParams().
Referenced by Mantid::API::IFunctionMD::clone(), export_IFunction(), and Mantid::API::PeakFunctionIntegrator::integrateError().
|
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.
value | :: assumed to be in unit of workspace |
outUnit | :: unit to convert to |
ws | :: workspace |
wsIndex | :: workspace index |
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().
|
protected |
Convert values from unit defined in workspace (ws) to outUnit.
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.
|
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().
|
protected |
Declare a single attribute.
Declares a single attribute.
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().
|
protected |
Declare a single attribute with validator.
Declares a single attribute with a validator.
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().
|
inlineprotectedvirtual |
Override to declare function attributes.
Reimplemented in Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::FunctionQDepends, Mantid::CurveFitting::Functions::GramCharlierComptonProfile, Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile, and Mantid::CurveFitting::Functions::VesuvioResolution.
Definition at line 676 of file IFunction.h.
Referenced by Mantid::CurveFitting::Functions::GramCharlierComptonProfile::declareAttributes(), Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile::declareAttributes(), and init().
|
protectedpure virtual |
Declare a new parameter.
Implemented in Mantid::API::FunctionParameterDecorator, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by Mantid::CurveFitting::Functions::PawleyParameterFunction::createLatticeSystemParameters(), Mantid::PythonInterface::IFunctionAdapter::declareFitParameter(), and Mantid::CurveFitting::Functions::IkedaCarpenterPV::init().
|
inlineprotectedvirtual |
Override to declare function parameters.
Reimplemented in Mantid::CurveFitting::Functions::ChudleyElliotSQE, Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::FickDiffusionSQE, Mantid::CurveFitting::Functions::GaussianComptonProfile, Mantid::CurveFitting::Functions::GramCharlierComptonProfile, Mantid::CurveFitting::Functions::HallRossSQE, Mantid::CurveFitting::Functions::MultivariateGaussianComptonProfile, Mantid::CurveFitting::Functions::TeixeiraWaterSQE, and Mantid::CurveFitting::Functions::Voigt.
Definition at line 678 of file IFunction.h.
Referenced by init().
|
virtual |
Returns the name of active parameter i.
Returns the description of an active parameter.
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().
|
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.
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.
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().
void Mantid::API::IFunction::fixAll | ( | bool | isDefault = false | ) |
Fix all 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().
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.
isDefault | :: If true fix them by default. |
Definition at line 1560 of file IFunction.cpp.
References Active, fix(), getParameterStatus(), and nParams().
void Mantid::API::IFunction::fixParameter | ( | const std::string & | name, |
bool | isDefault = false |
||
) |
Fix a parameter.
name | :: A name of a parameter to fix |
isDefault | :: If true fix it by default |
Definition at line 1515 of file IFunction.cpp.
References fix(), name(), and parameterIndex().
Referenced by export_IFunction(), Mantid::CurveFitting::Functions::Gaussian::fixCentre(), Mantid::CurveFitting::Functions::Lorentzian::fixCentre(), Mantid::CurveFitting::Functions::Lorentzian::fixIntensity(), and Mantid::CurveFitting::Functions::CrystalFieldUtils::setWidthConstraint().
|
pure virtual |
Evaluates the function for all arguments in the domain.
domain | :: Provides arguments for the function. |
values | :: A buffer to store the function values. It must be large enogh to store domain.size() values. |
Implemented in Mantid::CurveFitting::Functions::CrystalFieldSpectrumControl, Mantid::CurveFitting::Functions::CrystalFieldPhysPropControl, Mantid::CurveFitting::Functions::CrystalFieldPeaksBaseImpl, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::PawleyParameterFunction, Mantid::CurveFitting::Functions::PawleyFunction, Mantid::CurveFitting::Functions::ProductFunction, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::IFunction1D, Mantid::API::IFunction1DSpectrum, Mantid::API::IFunctionGeneral, Mantid::API::IFunctionMD, Mantid::API::ILatticeFunction, Mantid::API::IPeakFunction, Mantid::API::IPowderDiffPeakFunction, Mantid::API::MultiDomainFunction, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, and Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt.
Referenced by Mantid::CurveFitting::Algorithms::CalculateChiSquared::calcChiSquared(), Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateDerivative(), calNumericalDeriv(), Mantid::CurveFitting::Functions::ChebfunBase::fit(), and Mantid::CurveFitting::Functions::ChebfunBase::fitOdd().
|
virtual |
Derivatives of function with respect to active parameters.
Base class implementation calculates the derivatives numerically.
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().
|
virtual |
Return a value of attribute attName.
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().
|
virtual |
Returns a list of attribute names.
Reimplemented in Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::Crystal::PeakHKLErrors, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::BSpline, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::Resolution, Mantid::CurveFitting::Functions::TabulatedFunction, Mantid::CurveFitting::Functions::UserFunction, and Mantid::MDAlgorithms::UserFunctionMD.
Definition at line 1368 of file IFunction.cpp.
References attributeName(), and nAttributes().
Referenced by Mantid::CurveFitting::Functions::CrystalFieldFunction::buildAttributeNames(), export_IFunction(), Mantid::API::FunctionGenerator::getAttributeNames(), Mantid::CurveFitting::Functions::TabulatedFunction::getAttributeNames(), MantidQt::MantidWidgets::FunctionModel::updateMultiDatasetAttributes(), writeToString(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().
|
virtual |
Get constraint of i-th parameter.
Get constraint of parameter number i.
i | :: The index of a declared parameter. |
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Definition at line 392 of file IFunction.cpp.
References m_constraints.
Referenced by Mantid::Crystal::PeakHKLErrors::function1D(), Mantid::CurveFitting::Functions::BivariateNormal::function1D(), Mantid::API::CompositeFunction::getConstraint(), Mantid::API::FunctionGenerator::getConstraint(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getConstraint(), Mantid::CurveFitting::Functions::BivariateNormal::initCommon(), and Mantid::API::CompositeFunction::removeConstraint().
|
inline |
Get the covariance matrix.
Definition at line 627 of file IFunction.h.
|
pure virtual |
Get the fitting error for a parameter by name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
|
pure virtual |
Get the fitting error for a parameter.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by clone(), MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), export_IFunction(), and Mantid::CurveFitting::Functions::PawleyParameterFunction::getUnitCellFromParameters().
|
virtual |
Returns the pointer to i-th child function.
Returns the pointer to a child function.
Definition at line 1363 of file IFunction.cpp.
References name().
Referenced by Mantid::CurveFitting::Algorithms::EstimatePeakErrors::exec(), export_IFunction(), MantidQt::MantidWidgets::ConvolutionFunctionModel::iterateThroughFunction(), Mantid::API::ParameterReference::reset(), and MantidQt::MantidWidgets::ConvolutionFunctionModel::setPrefix().
|
inline |
Return the handler.
Definition at line 641 of file IFunction.h.
|
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().
|
pure virtual |
|
pure virtual |
Get i-th parameter.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by activeParameter(), Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateHessian(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::centre(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::constFunction(), MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), export_IFunction(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::expWidth(), Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityBase::function1D(), Mantid::CurveFitting::Functions::CrystalFieldPeaks::functionGeneral(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::functionLocal(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::functionLocal(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::fwhm(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::fwhm(), Mantid::API::ParameterReference::getParameter(), Mantid::CurveFitting::Functions::PawleyParameterFunction::getUnitCellFromParameters(), Mantid::CurveFitting::Functions::Bk2BkExpConvPV::height(), Mantid::CurveFitting::ParameterEstimator::setBackToBackExponential(), setMatrixWorkspace(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::setMatrixWorkspace(), Mantid::CurveFitting::ParameterEstimator::setValues(), and writeToString().
|
pure virtual |
Return parameter index from a parameter reference.
Usefull for constraints and ties in composite functions
Implemented in Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, and Mantid::API::ParamFunction.
Referenced by addTie(), Mantid::API::ParameterTie::asString(), Mantid::API::ReferenceEqual::operator()(), Mantid::API::ParameterReference::parameterIndex(), Mantid::API::ParameterTie::set(), sortTies(), and tie().
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().
|
pure virtual |
Get status of parameter.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by fix(), fixAllActive(), isActive(), isFixed(), isFixedByDefault(), unfix(), unfixAllDefault(), and writeToString().
|
inline |
Get the reduced chi^2.
Definition at line 631 of file IFunction.h.
|
virtual |
Get the tie of i-th parameter.
Get tie of parameter number i.
i | :: The index of a declared parameter. |
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Definition at line 356 of file IFunction.cpp.
References m_ties.
Referenced by Mantid::API::CompositeFunction::getTie(), Mantid::API::FunctionGenerator::getTie(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getTie(), Mantid::CurveFitting::Functions::BivariateNormal::initCommon(), and sortTies().
|
virtual |
Get number of values for a given domain.
domain | :: A domain. |
Reimplemented in Mantid::API::IFunctionGeneral.
Definition at line 1510 of file IFunction.cpp.
References Mantid::API::FunctionDomain::size().
Referenced by calNumericalDeriv().
|
virtual |
Check if attribute attName exists.
Check if attribute named exists.
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::UserFunction, Mantid::MDAlgorithms::UserFunctionMD, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Definition at line 1339 of file IFunction.cpp.
References m_attrs, and name().
Referenced by Mantid::PythonInterface::IFunctionAdapter::declareAttribute(), export_IFunction(), getAttribute(), Mantid::API::FunctionGenerator::getAttribute(), Mantid::CurveFitting::Functions::Resolution::hasAttribute(), Mantid::API::FunctionGenerator::hasAttribute(), Mantid::API::FunctionGenerator::setAttribute(), and storeAttributeValue().
|
protected |
Definition at line 295 of file IFunction.cpp.
References m_orderedTies.
Referenced by applyTies(), and Mantid::API::CompositeFunction::applyTies().
|
pure virtual |
Check if function has a parameter with this name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by export_IFunction().
|
inlinevirtual |
Ignore a tie.
Reimplemented in Mantid::CurveFitting::Functions::CrystalFieldFunction.
Definition at line 558 of file IFunction.h.
Referenced by sortTies().
|
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().
|
inlinevirtual |
Iinialize the function.
Definition at line 422 of file IFunction.h.
Referenced by export_IFunction(), Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeak(), and Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeaksFromTable().
bool Mantid::API::IFunction::isActive | ( | size_t | i | ) | const |
Check if an active parameter i is actually active.
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().
|
pure virtual |
Checks if a parameter has been set explicitly.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by export_IFunction(), setMatrixWorkspace(), and Mantid::CurveFitting::ParameterEstimator::whichFunction().
bool Mantid::API::IFunction::isFixed | ( | size_t | i | ) | const |
Check if a parameter i is fixed.
Query if the parameter is fixed.
i | :: The index of a declared parameter |
Definition at line 167 of file IFunction.cpp.
References Fixed, FixedByDefault, and getParameterStatus().
Referenced by export_IFunction(), unfixAll(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().
bool Mantid::API::IFunction::isFixedByDefault | ( | size_t | i | ) | const |
Check if a parameter i is fixed by default (not by user).
i | :: The index of a parameter |
Definition at line 175 of file IFunction.cpp.
References FixedByDefault, and getParameterStatus().
|
inline |
Get the parallel hint.
Definition at line 636 of file IFunction.h.
|
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.
|
inlinevirtual |
Called at the start of each iteration.
Reimplemented in Mantid::API::MultiDomainFunction, Mantid::CurveFitting::Functions::ComptonScatteringCountRate, and Mantid::FrameworkTestHelpers::FunctionChangesNParams.
Definition at line 458 of file IFunction.h.
|
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().
|
virtual |
Returns the name of active parameter i.
Returns the name of an active parameter.
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().
|
virtual |
Returns the number of attributes associated with the function.
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::Crystal::PeakHKLErrors, Mantid::CurveFitting::Functions::BivariateNormal, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::FullprofPolynomial, Mantid::CurveFitting::Functions::Polynomial, Mantid::CurveFitting::Functions::Resolution, Mantid::CurveFitting::Functions::TabulatedFunction, and Mantid::CurveFitting::Functions::UserFunction.
Definition at line 1336 of file IFunction.cpp.
References m_attrs.
Referenced by Mantid::API::FunctionGenerator::attributeName(), attributeName(), Mantid::CurveFitting::Functions::CrystalFieldFunction::buildAttributeNames(), export_IFunction(), getAttributeNames(), Mantid::API::FunctionGenerator::nAttributes(), Mantid::CurveFitting::Functions::TabulatedFunction::nAttributes(), and MantidQt::MantidWidgets::FunctionModel::updateMultiDatasetAttributes().
|
inlinevirtual |
Number of child functions.
Reimplemented in Mantid::API::CompositeFunction.
Definition at line 611 of file IFunction.h.
Referenced by MantidQt::MantidWidgets::ConvolutionFunctionModel::iterateThroughFunction(), and MantidQt::MantidWidgets::ConvolutionFunctionModel::setPrefix().
|
pure virtual |
Total number of parameters.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateDerivative(), Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateHessian(), calNumericalDeriv(), clearTies(), clone(), MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), Mantid::CurveFitting::EigenJacobian::EigenJacobian(), Mantid::CurveFitting::Algorithms::EstimatePeakErrors::exec(), export_IFunction(), fixAll(), fixAllActive(), getParameterNames(), Mantid::CurveFitting::Functions::CrystalFieldFunction::makeMapsForFunction(), Mantid::CurveFitting::Functions::Convolution::refreshResolution(), removeTie(), setCovarianceMatrix(), setMatrixWorkspace(), sortTies(), unfixAll(), unfixAllDefault(), and writeToString().
|
pure virtual |
Returns the description of parameter i.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by descriptionOfActive(), and export_IFunction().
|
pure virtual |
Returns the index of parameter name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by Mantid::API::ParameterTie::AddVariable(), Mantid::CurveFitting::Constraints::BoundaryConstraint::BoundaryConstraint(), export_IFunction(), fixParameter(), Mantid::CurveFitting::Constraints::BoundaryConstraint::initialize(), removeConstraint(), removeTie(), Mantid::API::ParameterReference::reset(), setConstraintPenaltyFactor(), Mantid::CurveFitting::Functions::IkedaCarpenterPV::setMatrixWorkspace(), and unfixParameter().
|
pure virtual |
Returns the name of parameter i.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by activeParameter(), Mantid::CurveFitting::Functions::PawleyParameterFunction::addAngleConstraint(), Mantid::CurveFitting::Functions::PawleyParameterFunction::addLengthConstraint(), MantidQt::MantidWidgets::FitPropertyBrowser::addTieToFunction(), Mantid::API::ParameterTie::asString(), MantidQt::MantidWidgets::FitPropertyBrowser::deleteTie(), descriptionOfActive(), export_IFunction(), fix(), Mantid::CurveFitting::Functions::CrystalFieldFunction::makeMapsForFunction(), nameOfActive(), Mantid::API::ParameterReference::parameterName(), Mantid::API::ParameterTie::set(), setActiveParameter(), setMatrixWorkspace(), unfix(), and writeToString().
|
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().
|
virtual |
Remove a constraint.
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().
|
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
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().
|
virtual |
Removes i-th parameter's tie.
Removes i-th parameter's tie if it is tied or does nothing.
i | :: The index of the tied parameter. |
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().
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.
msg | :: A message to display (default = "") |
Definition at line 132 of file IFunction.cpp.
References m_progReporter.
Referenced by Mantid::API::IFunctionMD::evaluateFunction().
|
virtual |
Set new value of i-th active parameter.
Override this method to make fitted parameters different from the declared
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionParameterDecorator, Mantid::CurveFitting::Functions::Abragam, Mantid::CurveFitting::Functions::AsymmetricPearsonVII, Mantid::CurveFitting::Functions::DynamicKuboToyabe, Mantid::CurveFitting::Functions::EndErfc, Mantid::CurveFitting::Functions::ExpDecayOsc, Mantid::CurveFitting::Functions::GausDecay, Mantid::CurveFitting::Functions::GausOsc, Mantid::CurveFitting::Functions::Gaussian, Mantid::CurveFitting::Functions::Keren, and Mantid::PythonInterface::IFunctionAdapter.
Definition at line 997 of file IFunction.cpp.
References isActive(), parameterName(), setParameter(), and value.
Referenced by calNumericalDeriv(), Mantid::CurveFitting::Functions::ChudleyElliotSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::FickDiffusionSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::HallRossSQE::functionDeriv1D(), Mantid::CurveFitting::Functions::TeixeiraWaterSQE::functionDeriv1D(), and Mantid::PythonInterface::IFunctionAdapter::setActiveParameter().
|
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
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().
void Mantid::API::IFunction::setAttributeValue | ( | const std::string & | attName, |
const char * | value | ||
) |
Overload for const char* values.
attName | :: Attribute name |
value | :: New attribute value to set |
Definition at line 1346 of file IFunction.cpp.
References setAttributeValue(), and value.
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.
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.
|
inline |
Set an attribute value.
Definition at line 597 of file IFunction.h.
References value.
Referenced by Mantid::CurveFitting::Functions::CrystalFieldPeaksBase::calculateEigenSystem(), Mantid::CurveFitting::Functions::DiffRotDiscreteCircle::init(), Mantid::CurveFitting::Functions::DiffSphere::init(), Mantid::CurveFitting::Functions::CrystalFieldControl::setAttribute(), setAttributeValue(), Mantid::CurveFitting::Functions::FunctionQDepends::setMatrixWorkspace(), and Mantid::CurveFitting::Functions::CubicSpline::setXAttribute().
|
virtual |
Set a constraint penalty.
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().
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.
covar | :: A matrix to set. |
Definition at line 1496 of file IFunction.cpp.
|
pure virtual |
Set the fitting error for a parameter by name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
|
pure virtual |
Set the fitting error for a parameter.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), and export_IFunction().
void Mantid::API::IFunction::setHandler | ( | std::unique_ptr< FunctionHandler > | handler | ) |
Set a function handler.
handler | :: A new handler |
Definition at line 562 of file IFunction.cpp.
References m_handler.
|
virtual |
Set matrix workspace.
Initialize the function providing it the workspace.
workspace | :: The workspace to set |
wi | :: The workspace index |
startX | :: The lower bin index |
endX | :: The upper bin index |
Reimplemented in Mantid::CurveFitting::Functions::ComptonScatteringCountRate, Mantid::API::CompositeFunction, Mantid::API::IFunctionMW, Mantid::CurveFitting::Functions::Bk2BkExpConvPV, Mantid::CurveFitting::Functions::GramCharlierComptonProfile, Mantid::CurveFitting::Functions::IkedaCarpenterPV, Mantid::CurveFitting::Functions::PawleyFunction, Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::VesuvioResolution, Mantid::CurveFitting::Functions::FunctionQDepends, and Mantid::API::FunctionParameterDecorator.
Definition at line 1100 of file IFunction.cpp.
References addConstraint(), convertValue(), Mantid::Kernel::Logger::debug(), detectorIndex, Mantid::Kernel::Logger::error(), Mantid::API::g_log, getParameter(), Mantid::Kernel::SingletonHolder< T >::Instance(), isExplicitlySet(), name(), nParams(), parameterName(), setParameter(), Mantid::API::IConstraint::setPenaltyFactor(), tie(), UNUSED_ARG, Mantid::Kernel::Logger::warning(), and workspace.
Referenced by Mantid::API::IFunctionMW::setMatrixWorkspace().
|
inline |
Set the parallel hint.
Definition at line 634 of file IFunction.h.
|
pure virtual |
Set parameter by name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::IPeakFunction, Mantid::API::IPowderDiffPeakFunction, Mantid::API::ParamFunction, Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::CrystalFieldFunction, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PseudoVoigt, and Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt.
|
pure virtual |
Set i-th parameter.
Implemented in Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::IPowderDiffPeakFunction, Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::CubicSpline, Mantid::CurveFitting::Functions::NeutronBk2BkExpConvPVoigt, Mantid::CurveFitting::Functions::PseudoVoigt, Mantid::CurveFitting::Functions::ThermalNeutronBk2BkExpConvPVoigt, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::IPeakFunction, Mantid::API::ParamFunction, Mantid::CurveFitting::Functions::CrystalFieldFunction, and Mantid::CurveFitting::Functions::CubicSpline.
Referenced by Mantid::CurveFitting::CostFunctions::CostFuncPoisson::calculateHessian(), MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), export_IFunction(), setActiveParameter(), Mantid::CurveFitting::ParameterEstimator::setBackToBackExponential(), setMatrixWorkspace(), Mantid::API::ParameterReference::setParameter(), Mantid::CurveFitting::Functions::PawleyParameterFunction::setParametersFromUnitCell(), Mantid::CurveFitting::ParameterEstimator::setValues(), and tie().
|
pure virtual |
Set description of parameter by name.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
|
pure virtual |
Set i-th parameter description.
Implemented in Mantid::API::FunctionParameterDecorator, Mantid::API::ImmutableCompositeFunction, Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
|
pure virtual |
Change status of parameter.
Implemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::API::ParamFunction, and Mantid::CurveFitting::Functions::CrystalFieldFunction.
Referenced by addTie(), clearTies(), fix(), removeTie(), and unfix().
void Mantid::API::IFunction::setProgressReporter | ( | std::shared_ptr< Kernel::ProgressBase > | reporter | ) |
Attach a progress reporter.
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.
|
inline |
Set the reduced chi^2.
Definition at line 629 of file IFunction.h.
|
virtual |
Sets the StepSizeMethod to use when calculation the step size.
Sets the function to use when calculating the step size.
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.
|
virtual |
Set up the function for a fit.
Reimplemented in Mantid::API::CompositeFunction, Mantid::API::FunctionGenerator, Mantid::API::FunctionParameterDecorator, Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::ComptonProfile, Mantid::CurveFitting::Functions::Convolution, Mantid::CurveFitting::Functions::CrystalFieldFunction, and Mantid::CurveFitting::Functions::VesuvioResolution.
Definition at line 433 of file IFunction.cpp.
References m_constraints.
Referenced by Mantid::API::CompositeFunction::setUpForFit(), Mantid::API::FunctionGenerator::setUpForFit(), and Mantid::CurveFitting::Functions::CrystalFieldFunction::setUpForFit().
|
inlinevirtual |
Set the workspace.
ws | :: Shared pointer to a workspace |
Reimplemented in Mantid::CurveFitting::Functions::ComptonPeakProfile, Mantid::CurveFitting::Functions::InelasticDiffRotDiscreteCircle, Mantid::CurveFitting::Functions::InelasticDiffSphere, Mantid::API::CompositeFunction, Mantid::API::FunctionParameterDecorator, and Mantid::API::IFunctionMD.
Definition at line 417 of file IFunction.h.
References UNUSED_ARG.
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().
|
protected |
Store an attribute's value.
Set a value to a named attribute, retaining validator.
name | :: The name of the attribute |
value | :: The value of the attribute |
Definition at line 1464 of file IFunction.cpp.
References hasAttribute(), m_attrs, name(), and value.
Referenced by Mantid::CurveFitting::Functions::BSpline::resetKnots(), Mantid::PythonInterface::IFunctionAdapter::setAttribute(), Mantid::CurveFitting::Functions::BSpline::setAttribute(), Mantid::CurveFitting::Functions::Chebyshev::setAttribute(), Mantid::CurveFitting::Functions::CubicSpline::setAttribute(), Mantid::CurveFitting::Functions::ReflectivityMulf::setAttribute(), Mantid::CurveFitting::Functions::TabulatedFunction::setAttribute(), setAttribute(), and storeReadOnlyAttribute().
|
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.
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().
|
virtual |
Tie a parameter to other parameters (or a constant)
Ties a parameter to other parameters.
parName | :: The name of the parameter to tie. |
expr | :: A math expression |
isDefault | :: Flag to mark as default the value of an object associated with this reference: a tie or a constraint. |
Reimplemented in Mantid::API::FunctionParameterDecorator.
Definition at line 214 of file IFunction.cpp.
References addTie(), fix(), getParameterIndex(), and setParameter().
Referenced by addTie(), addTies(), applyOrderedTies(), applyTies(), export_IFunction(), Mantid::CurveFitting::Functions::Gaussian::fixIntensity(), Mantid::API::CompositeFunction::getTie(), Mantid::API::FunctionGenerator::getTie(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getTie(), Mantid::CurveFitting::Functions::CrystalFieldFunction::ignoreTie(), Mantid::CurveFitting::Functions::BivariateNormal::initCommon(), Mantid::API::CompositeFunction::removeFunction(), setMatrixWorkspace(), Mantid::API::CompositeFunction::setUpForFit(), sortTies(), writeTies(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().
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.
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().
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().
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().
void Mantid::API::IFunction::unfixParameter | ( | const std::string & | name | ) |
Free a parameter.
name | :: A name of a parameter to free |
Definition at line 1522 of file IFunction.cpp.
References name(), parameterIndex(), and unfix().
Referenced by export_IFunction(), Mantid::CurveFitting::Functions::Gaussian::unfixCentre(), Mantid::CurveFitting::Functions::Lorentzian::unfixCentre(), and Mantid::CurveFitting::Functions::Lorentzian::unfixIntensity().
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.
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().
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.
Definition at line 261 of file IFunction.cpp.
Referenced by export_IFunction(), writeToString(), Mantid::API::CompositeFunction::writeToString(), and Mantid::CurveFitting::Functions::CrystalFieldSpectrum::writeToString().
|
protectedvirtual |
Writes itself into a string.
Writes this function into a string.
parentLocalAttributesStr | :: A preformatted string with local attributes of a parent composite function. Can be passed in by a CompositeFunction (eg MultiDomainFunction). |
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().
|
friend |
Definition at line 699 of file IFunction.h.
Referenced by Mantid::CurveFitting::Functions::CrystalFieldFunction::buildMultiSiteSingleSpectrum(), Mantid::CurveFitting::Functions::CrystalFieldFunction::buildSingleSiteSingleSpectrum(), and Mantid::CurveFitting::Functions::CrystalFieldFunction::buildSpectrum().
|
friend |
Definition at line 701 of file IFunction.h.
|
friend |
Definition at line 700 of file IFunction.h.
|
friend |
Definition at line 698 of file IFunction.h.
|
private |
The declared attributes.
Definition at line 714 of file IFunction.h.
Referenced by attributeName(), checkAttributeName(), declareAttribute(), getAttribute(), hasAttribute(), nAttributes(), storeAttributeValue(), and ~IFunction().
|
private |
The chi-squared of the last fit.
Definition at line 718 of file IFunction.h.
|
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().
|
private |
The covariance matrix of the fitting parameters.
Definition at line 716 of file IFunction.h.
Referenced by setCovarianceMatrix().
|
protected |
Pointer to a function handler.
Definition at line 707 of file IFunction.h.
Referenced by setHandler().
|
protected |
Flag to hint that the function is being used in parallel computations.
Definition at line 704 of file IFunction.h.
|
private |
whether the function usage has been registered
Definition at line 726 of file IFunction.h.
Referenced by registerFunctionUsage().
|
private |
Ties ordered in order of correct application.
Definition at line 724 of file IFunction.h.
Referenced by applyOrderedTies(), hasOrderedTies(), and sortTies().
|
protected |
Pointer to the progress handler.
Definition at line 710 of file IFunction.h.
Referenced by cancellationRequestReceived(), reportProgress(), and setProgressReporter().
|
private |
The function used to calculate the step size.
Definition at line 728 of file IFunction.h.
Referenced by calculateStepSize(), and setStepSizeMethod().
|
private |
Holds parameter ties.
Definition at line 720 of file IFunction.h.
Referenced by addTie(), applyTies(), clearTies(), getTie(), removeTie(), and writeTies().