|
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. | |
| bool | cancellationRequestReceived () const |
| Returns true if a progress reporter is set & evalaution has been requested to stop. | |
| virtual const std::vector< std::string > | categories () const |
| Function to return all of the categories that contain this algorithm. | |
| virtual const std::string | category () const |
| The categories the Fit function belong to. | |
| virtual const std::string | categorySeparator () const |
| Function to return the sperator token for the category string. | |
| virtual std::shared_ptr< IFunction > | clone () const |
| Virtual copy constructor. | |
| virtual int64_t | estimateNoProgressCalls () const |
| Returns an estimate of the number of progress reports a single evaluation of the function will have. | |
| virtual void | function (const FunctionDomain &domain, FunctionValues &values) const =0 |
| Evaluates the function for all arguments in the domain. | |
| virtual void | functionDeriv (const FunctionDomain &domain, Jacobian &jacobian) |
| Derivatives of function with respect to active parameters. | |
| IFunction () | |
| Constructor. | |
| IFunction (const IFunction &)=delete | |
| No copying. | |
| virtual void | initialize () |
| Iinialize the function. | |
| virtual void | iterationFinished () |
| Called at the end of an iteration. | |
| virtual void | iterationStarting () |
| Called at the start of each iteration. | |
| virtual std::string | name () const =0 |
| Returns the function's name. | |
| IFunction & | operator= (const IFunction &)=delete |
| No copying. | |
| virtual void | registerFunctionUsage (bool internal) |
| Registers the usage of the algorithm with the UsageService. | |
| void | reportProgress (const std::string &msg="") const |
| Reports progress with an optional message. | |
| virtual void | setMatrixWorkspace (std::shared_ptr< const API::MatrixWorkspace > workspace, size_t wi, double startX, double endX) |
| Set matrix workspace. | |
| void | setProgressReporter (std::shared_ptr< Kernel::ProgressBase > reporter) |
| Attach a progress reporter. | |
| virtual void | setWorkspace (std::shared_ptr< const Workspace > ws) |
| Set the workspace. | |
| virtual | ~IFunction () |
| Virtual destructor. | |
Function parameters | |
| virtual void | setParameter (size_t, const double &value, bool explicitlySet=true)=0 |
| Set i-th parameter. | |
| virtual void | setParameterDescription (size_t, const std::string &description)=0 |
| Set i-th parameter description. | |
| virtual double | getParameter (size_t i) const =0 |
| Get i-th parameter. | |
| virtual void | setParameter (const std::string &name, const double &value, bool explicitlySet=true)=0 |
| Set parameter by name. | |
| virtual void | setParameterDescription (const std::string &name, const std::string &description)=0 |
| Set description of parameter by name. | |
| virtual double | getParameter (const std::string &name) const =0 |
| Get parameter by name. | |
| virtual bool | hasParameter (const std::string &name) const =0 |
| Check if function has a parameter with this name. | |
| virtual size_t | nParams () const =0 |
| Total number of parameters. | |
| virtual size_t | parameterIndex (const std::string &name) const =0 |
| Returns the index of parameter name. | |
| virtual std::string | parameterName (size_t i) const =0 |
| Returns the name of parameter i. | |
| virtual std::string | parameterDescription (size_t i) const =0 |
| Returns the description of parameter i. | |
| virtual bool | isExplicitlySet (size_t i) const =0 |
| Checks if a parameter has been set explicitly. | |
| virtual double | getError (size_t i) const =0 |
| Get the fitting error for a parameter. | |
| virtual double | getError (const std::string &name) const =0 |
| Get the fitting error for a parameter by name. | |
| virtual void | setError (size_t i, double err)=0 |
| Set the fitting error for a parameter. | |
| virtual void | setError (const std::string &name, double err)=0 |
| Set the fitting error for a parameter by name. | |
| bool | isFixed (size_t i) const |
| Check if a parameter i is fixed. | |
| bool | isFixedByDefault (size_t i) const |
| Check if a parameter i is fixed by default (not by user). | |
| void | fix (size_t i, bool isDefault=false) |
| Removes a parameter i from the list of active. | |
| void | unfix (size_t i) |
| Restores a declared parameter i to the active status. | |
| void | fixParameter (const std::string &name, bool isDefault=false) |
| Fix a parameter. | |
| void | unfixParameter (const std::string &name) |
| Free a parameter. | |
| void | fixAll (bool isDefault=false) |
| Fix all parameters. | |
| void | unfixAll () |
| Free all parameters. | |
| void | unfixAllDefault () |
| Free all parameters fixed by default. | |
| void | fixAllActive (bool isDefault=false) |
| Fix all active parameters. | |
| virtual size_t | getParameterIndex (const ParameterReference &ref) const =0 |
| Return parameter index from a parameter reference. | |
| std::vector< std::string > | getParameterNames () const |
| Return a vector with all parameter names. | |
Active parameters | |
| virtual double | activeParameter (size_t i) const |
| Value of i-th active parameter. | |
| virtual void | setActiveParameter (size_t i, double value) |
| Set new value of i-th active parameter. | |
| virtual std::string | nameOfActive (size_t i) const |
| Returns the name of active parameter i. | |
| virtual std::string | descriptionOfActive (size_t i) const |
| Returns the name of active parameter i. | |
| bool | isActive (size_t i) const |
| Check if an active parameter i is actually active. | |
Ties | |
| virtual void | tie (const std::string &parName, const std::string &expr, bool isDefault=false) |
| Tie a parameter to other parameters (or a constant) | |
| virtual void | addTies (const std::string &ties, bool isDefault=false) |
| Add several ties. | |
| virtual void | applyTies () |
| Apply the ties. | |
| virtual void | removeTie (const std::string &parName) |
| Removes the tie off a parameter. | |
| virtual void | clearTies () |
| Remove all ties. | |
| virtual bool | removeTie (size_t i) |
| Removes i-th parameter's tie. | |
| virtual ParameterTie * | getTie (size_t i) const |
| Get the tie of i-th parameter. | |
| virtual bool | ignoreTie (const ParameterTie &) const |
| Ignore a tie. | |
| void | sortTies (const bool checkOnly=false) |
| Put all ties in order in which they will be applied correctly. | |
| std::string | writeTies () const |
| Write a parameter tie to a string. | |
Constraints | |
| virtual void | addConstraints (const std::string &str, bool isDefault=false) |
| Add a list of conatraints from a string. | |
| virtual void | addConstraint (std::unique_ptr< IConstraint > ic) |
| Add a constraint to function. | |
| virtual IConstraint * | getConstraint (size_t i) const |
| Get constraint of i-th parameter. | |
| virtual void | removeConstraint (const std::string &parName) |
| Remove a constraint. | |
| virtual void | setConstraintPenaltyFactor (const std::string &parName, const double &c) |
| Set a constraint penalty. | |
| std::string | writeConstraints () const |
| Write a parameter constraint to a string. | |
| virtual void | clearConstraints () |
| Remove all constraints. | |
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. | |
| std::unique_ptr< FunctionHandler > | m_handler |
| Pointer to a function handler. | |
| std::shared_ptr< Kernel::ProgressBase > | m_progReporter |
| Pointer to the progress handler. | |
| std::map< std::string, API::IFunction::Attribute > | m_attrs |
| The declared attributes. | |
| std::shared_ptr< Kernel::Matrix< double > > | m_covar |
| The covariance matrix of the fitting parameters. | |
| double | m_chiSquared |
| The chi-squared of the last fit. | |
| std::vector< std::unique_ptr< ParameterTie > > | m_ties |
| Holds parameter ties. | |
| std::vector< std::unique_ptr< IConstraint > > | m_constraints |
| Holds the constraints added to function. | |
| std::vector< ParameterTie * > | m_orderedTies |
| Ties ordered in order of correct application. | |
| bool | m_isRegistered {false} |
| whether the function usage has been registered | |
| std::function< double(const double)> | m_stepSizeFunction |
| The function used to calculate the step size. | |
| virtual size_t | nAttributes () const |
| Returns the number of attributes associated with the function. | |
| virtual std::vector< std::string > | getAttributeNames () const |
| Returns a list of attribute names. | |
| virtual std::string | attributeName (size_t index) const |
| Get name of ith attribute. | |
| virtual Attribute | getAttribute (const std::string &name) const |
| Return a value of attribute attName. | |
| virtual void | setAttribute (const std::string &name, const Attribute &) |
| Set a value to attribute attName. | |
| virtual bool | hasAttribute (const std::string &name) const |
| Check if attribute attName exists. | |
| template<typename T > | |
| void | setAttributeValue (const std::string &attName, const T &value) |
| Set an attribute value. | |
| void | setAttributeValue (const std::string &attName, const char *value) |
| Overload for const char* values. | |
| void | setAttributeValue (const std::string &attName, const std::string &value) |
| Set string attribute by value. | |
| virtual std::shared_ptr< IFunction > | getFunction (size_t i) const |
| Returns the pointer to i-th child function. | |
| virtual std::size_t | nFunctions () const |
| Number of child functions. | |
| virtual void | setUpForFit () |
| Set up the function for a fit. | |
| virtual size_t | getValuesSize (const FunctionDomain &domain) const |
| Get number of values for a given domain. | |
| virtual size_t | getNumberDomains () const |
| Get number of domains required by this function. | |
| virtual std::vector< std::shared_ptr< IFunction > > | createEquivalentFunctions () const |
| Split this function (if needed) into a list of independent functions. | |
| void | calNumericalDeriv (const FunctionDomain &domain, Jacobian &jacobian) |
| Calculate numerical derivatives. | |
| double | calculateStepSize (const double parameterValue) const |
| Calculate step size for the given parameter value. | |
| void | setCovarianceMatrix (const std::shared_ptr< Kernel::Matrix< double > > &covar) |
| Set the covariance matrix. | |
| std::shared_ptr< const Kernel::Matrix< double > > | getCovarianceMatrix () const |
| Get the covariance matrix. | |
| void | setReducedChiSquared (double chi2) |
| Set the reduced chi^2. | |
| double | getReducedChiSquared () const |
| Get the reduced chi^2. | |
| void | setParallel (bool on) |
| Set the parallel hint. | |
| bool | isParallel () const |
| Get the parallel hint. | |
| void | setHandler (std::unique_ptr< FunctionHandler > handler) |
| Set a function handler. | |
| FunctionHandler * | getHandler () const |
| Return the handler. | |
| virtual void | setParameterStatus (size_t i, ParameterStatus status)=0 |
| Change status of parameter. | |
| virtual ParameterStatus | getParameterStatus (size_t i) const =0 |
| Get status of parameter. | |
| virtual void | setStepSizeMethod (const StepSizeMethod method) |
| Sets the StepSizeMethod to use when calculation the step size. | |
| virtual void | init () |
| Function initialization. Declare function parameters in this method. | |
| virtual void | declareParameter (const std::string &name, double initValue=0, const std::string &description="")=0 |
| Declare a new parameter. | |
| 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) | |
| 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. | |
| virtual void | declareAttributes () |
| Override to declare function attributes. | |
| virtual void | declareParameters () |
| Override to declare function parameters. | |
| void | declareAttribute (const std::string &name, const API::IFunction::Attribute &defaultValue) |
| Declare a single attribute. | |
| void | declareAttribute (const std::string &name, const API::IFunction::Attribute &defaultValue, const Kernel::IValidator &validator) |
| Declare a single attribute with validator. | |
| void | checkAttributeName (const std::string &name) |
| Check Attribute to declare does not already exist. | |
| void | storeAttributeValue (const std::string &name, const API::IFunction::Attribute &value) |
| Store an attribute's value. | |
| void | storeReadOnlyAttribute (const std::string &name, const API::IFunction::Attribute &value) const |
| A read-only ("mutable") attribute can be stored in a const method. | |
| virtual void | addTie (std::unique_ptr< ParameterTie > tie) |
| Add a new tie. Derived classes must provide storage for ties. | |
| bool | hasOrderedTies () const |
| void | applyOrderedTies () |
| virtual std::string | writeToString (const std::string &parentLocalAttributesStr="") const |
| Writes itself into a string. | |
| std::unique_ptr< ParameterTie > | createAndProcessTie (const std::string &parName, const std::string &expr, bool isDefault) |
| Creates and processes a single tie, handling constant expressions and validation. | |
| std::pair< std::size_t, std::string > | insertTie (std::unique_ptr< ParameterTie > tie) |
| Insert a new tie to the correct position. | |
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 166 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 654 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 663 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 1063 of file IFunction.cpp.
References getParameter(), isActive(), and parameterName().
Referenced by Mantid::PythonInterface::IFunctionAdapter::activeParameter(), Mantid::API::IFunction1D::calcNumericalDerivative1D(), 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 452 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 596 of file IFunction.cpp.
References addConstraint(), Mantid::API::Expression::begin(), Mantid::API::Expression::end(), 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 353 of file IFunction.cpp.
References getParameterIndex(), insertTie(), m_ties, parameterName(), removeTie(), sortTies(), and tie().
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. |
Reimplemented in Mantid::API::FunctionParameterDecorator.
Definition at line 250 of file IFunction.cpp.
References applyTies(), createAndProcessTie(), getParameterIndex(), insertTie(), m_ties, n, parameterName(), Mantid::API::Expression::parse(), removeTie(), sortTies(), and Mantid::API::Expression::toList().
Referenced by Mantid::API::ImmutableCompositeFunction::addDefaultTies(), and export_IFunction().
|
protected |
Definition at line 373 of file IFunction.cpp.
References m_orderedTies.
Referenced by applyTies(), and Mantid::API::CompositeFunction::applyTies().
|
virtual |
Apply the ties.
Reimplemented in Mantid::API::CompositeFunction, and Mantid::API::FunctionParameterDecorator.
Definition at line 382 of file IFunction.cpp.
References applyOrderedTies(), hasOrderedTies(), and m_ties.
Referenced by addTies(), Mantid::API::CompositeFunction::applyTies(), Mantid::API::IFunction1D::calcNumericalDerivative1D(), 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 537 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 1457 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 1152 of file IFunction.cpp.
References m_stepSizeFunction.
Referenced by Mantid::API::IFunction1D::calcNumericalDerivative1D(), and 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 1106 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 Mantid::Kernel::ProgressBase::hasCancellationBeenRequested(), and 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 647 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::ChudleyElliotSQE, Mantid::CurveFitting::Functions::ConvTempCorrection, Mantid::CurveFitting::Functions::CriticalPeakRelaxationRate, 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::CrystalFieldSusceptibility, Mantid::CurveFitting::Functions::CrystalFieldSusceptibilityCalculation, 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::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::Meier, 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 443 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 448 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 1520 of file IFunction.cpp.
References m_attrs, and name().
Referenced by declareAttribute(), and declareAttribute().
|
virtual |
Remove all constraints.
Definition at line 506 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 442 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(), 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 1342 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 1369 of file IFunction.cpp.
References Mantid::Kernel::Logger::error(), and Mantid::API::g_log.
|
private |
Creates and processes a single tie, handling constant expressions and validation.
| parName | :: The name of the parameter to tie |
| expr | :: A math expression |
| isDefault | :: Flag to mark as default |
Definition at line 213 of file IFunction.cpp.
References fix(), getParameterIndex(), and setParameter().
|
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 1654 of file IFunction.cpp.
References asString().
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 1493 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::API::CompositeFunction::declareAttribute(), Mantid::PythonInterface::IFunctionAdapter::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::Meier::init(), 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(), Mantid::CurveFitting::Functions::TabulatedFunction::TabulatedFunction(), and Mantid::CurveFitting::Functions::UserFunction::UserFunction().
|
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 1505 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 681 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 683 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 1094 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 428 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 createAndProcessTie(), export_IFunction(), fixAll(), fixAllActive(), fixParameter(), and Mantid::CurveFitting::ParameterEstimator::setBackToBackExponential().
| void Mantid::API::IFunction::fixAll | ( | bool | isDefault = false | ) |
Fix all parameters.
| isDefault | :: If true fix them by default |
Definition at line 1604 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 1635 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 1590 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 1469 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::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::Meier::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 1443 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 468 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 632 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 1438 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 646 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 1647 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(), and Mantid::CurveFitting::ParameterEstimator::setValues().
|
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(), addTies(), Mantid::API::ParameterTie::asString(), createAndProcessTie(), insertTie(), Mantid::API::ReferenceEqual::operator()(), Mantid::API::ParameterReference::parameterIndex(), Mantid::API::ParameterTie::set(), and sortTies().
| std::vector< std::string > Mantid::API::IFunction::getParameterNames | ( | ) | const |
Return a vector with all parameter names.
Definition at line 626 of file IFunction.cpp.
References nParams(), and parameterName().
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(), and unfixAllDefault().
|
inline |
Get the reduced chi^2.
Definition at line 636 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 432 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(), insertTie(), and sortTies().
|
virtual |
Get number of values for a given domain.
| domain | :: A domain. |
Reimplemented in Mantid::API::IFunctionGeneral.
Definition at line 1585 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 1414 of file IFunction.cpp.
References m_attrs, and name().
Referenced by Mantid::PythonInterface::IFunctionAdapter::declareAttribute(), 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 371 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 561 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::Meier, 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 1529 of file IFunction.cpp.
References declareAttributes(), and declareParameters().
|
inlinevirtual |
Iinialize the function.
Definition at line 425 of file IFunction.h.
Referenced by export_IFunction(), Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeak(), and Mantid::CurveFitting::Algorithms::FitPowderDiffPeaks::genPeaksFromTable().
|
private |
Insert a new tie to the correct position.
| tie | :: the tie |
Definition at line 322 of file IFunction.cpp.
References getParameterIndex(), getTie(), m_ties, setParameterStatus(), tie(), and Tied.
| 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::API::IFunction1D::calcNumericalDerivative1D(), 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 641 of file IFunction.h.
|
inlinevirtual |
Called at the end of an iteration.
Reimplemented in Mantid::API::MultiDomainFunction, and Mantid::FrameworkTestHelpers::FunctionChangesNParams.
Definition at line 463 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 461 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::Meier, 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 checkAttributeName(), Mantid::API::FunctionParameterDecorator::clone(), declareAttribute(), 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::Functions::CrystalFieldFunction::ignoreTie(), 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 1083 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 1411 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 616 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::API::IFunction1D::calcNumericalDerivative1D(), 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(), and unfixAllDefault().
|
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(), 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(), addTie(), addTies(), MantidQt::MantidWidgets::FitPropertyBrowser::addTieToFunction(), Mantid::API::ParameterTie::asString(), MantidQt::MantidWidgets::FitPropertyBrowser::deleteTie(), descriptionOfActive(), export_IFunction(), fix(), getParameterNames(), Mantid::CurveFitting::Functions::CrystalFieldFunction::makeMapsForFunction(), nameOfActive(), Mantid::API::ParameterReference::parameterName(), Mantid::API::ParameterTie::set(), setActiveParameter(), setMatrixWorkspace(), and unfix().
|
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, 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 479 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 294 of file IFunction.cpp.
References parameterIndex(), and removeTie().
Referenced by addTie(), addTies(), 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 414 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 1072 of file IFunction.cpp.
References isActive(), parameterName(), setParameter(), and value.
Referenced by Mantid::API::IFunction1D::calcNumericalDerivative1D(), 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 1484 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 1421 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 1431 of file IFunction.cpp.
References getAttribute(), setAttribute(), Mantid::API::IFunction::Attribute::setString(), and value.
|
inline |
Set an attribute value.
Definition at line 601 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 492 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 1571 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 637 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 1175 of file IFunction.cpp.
References addConstraint(), convertValue(), Mantid::Kernel::Logger::debug(), detectorIndex, Mantid::Kernel::Logger::error(), Mantid::API::g_log, getParameter(), 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 639 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(), createAndProcessTie(), export_IFunction(), setActiveParameter(), Mantid::CurveFitting::ParameterEstimator::setBackToBackExponential(), setMatrixWorkspace(), Mantid::API::ParameterReference::setParameter(), Mantid::CurveFitting::Functions::PawleyParameterFunction::setParametersFromUnitCell(), and Mantid::CurveFitting::ParameterEstimator::setValues().
|
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 clearTies(), fix(), insertTie(), 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 634 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 1157 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 508 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 420 of file IFunction.h.
References UNUSED_ARG.
| void Mantid::API::IFunction::sortTies | ( | const bool | checkOnly = false | ) |
Put all ties in order in which they will be applied correctly.
| checkOnly | :: If true then do not clear or write to m_orderedTies, only check for circular and self ties. |
| std::runtime_error | :: On finding a circular or self tie |
Definition at line 1661 of file IFunction.cpp.
References Mantid::API::ParameterTie::asString(), getParameterIndex(), getTie(), ignoreTie(), m_orderedTies, and nParams().
|
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 1539 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 1558 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 233 of file IFunction.cpp.
References addTie(), and createAndProcessTie().
Referenced by addTie(), 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(), insertTie(), Mantid::API::CompositeFunction::removeFunction(), setMatrixWorkspace(), Mantid::API::CompositeFunction::setUpForFit(), 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 1613 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 1622 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 1597 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 516 of file IFunction.cpp.
References m_constraints.
Referenced by export_IFunction(), 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 301 of file IFunction.cpp.
References m_ties.
Referenced by export_IFunction(), 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 546 of file IFunction.cpp.
References getAttribute(), getAttributeNames(), name(), and Mantid::API::IFunction::Attribute::value().
Referenced by asString(), and Mantid::API::ImmutableCompositeFunction::writeToString().
|
friend |
Definition at line 704 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 706 of file IFunction.h.
|
friend |
Definition at line 705 of file IFunction.h.
|
friend |
Definition at line 703 of file IFunction.h.
|
private |
The declared attributes.
Definition at line 719 of file IFunction.h.
Referenced by attributeName(), checkAttributeName(), declareAttribute(), declareAttribute(), getAttribute(), hasAttribute(), nAttributes(), storeAttributeValue(), and ~IFunction().
|
private |
The chi-squared of the last fit.
Definition at line 723 of file IFunction.h.
|
private |
Holds the constraints added to function.
Definition at line 727 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 721 of file IFunction.h.
Referenced by setCovarianceMatrix().
|
protected |
Pointer to a function handler.
Definition at line 712 of file IFunction.h.
Referenced by setHandler().
|
protected |
Flag to hint that the function is being used in parallel computations.
Definition at line 709 of file IFunction.h.
|
private |
whether the function usage has been registered
Definition at line 731 of file IFunction.h.
Referenced by registerFunctionUsage().
|
private |
Ties ordered in order of correct application.
Definition at line 729 of file IFunction.h.
Referenced by applyOrderedTies(), hasOrderedTies(), and sortTies().
|
protected |
Pointer to the progress handler.
Definition at line 715 of file IFunction.h.
Referenced by cancellationRequestReceived(), reportProgress(), and setProgressReporter().
|
private |
The function used to calculate the step size.
Definition at line 733 of file IFunction.h.
Referenced by calculateStepSize(), and setStepSizeMethod().
|
private |
Holds parameter ties.
Definition at line 725 of file IFunction.h.
Referenced by addTie(), addTies(), applyTies(), clearTies(), getTie(), insertTie(), removeTie(), and writeTies().