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

A reference to a parameter in a function. More...

#include <ParameterReference.h>

Inheritance diagram for Mantid::API::ParameterReference:
Mantid::API::IConstraint Mantid::API::ParameterTie Mantid::CurveFitting::Constraints::BoundaryConstraint

Public Member Functions

IFunctiongetLocalFunction () const
 Return pointer to the local function. More...
 
std::size_t getLocalIndex () const
 Return parameter index in the local function. More...
 
double getParameter () const
 Get the value of the parameter. More...
 
bool isDefault () const
 Returns the default value flag. More...
 
bool isParameterOf (const IFunction *fun) const
 Find out if this refers to a parameter of a function: direct or via composite function member. More...
 
IFunctionownerFunction () const
 
std::size_t parameterIndex () const
 Return parameter index in the owning function. More...
 
std::string parameterName () const
 Return parameter name in the owning function. More...
 
 ParameterReference ()
 Default constructor. More...
 
 ParameterReference (IFunction *fun, std::size_t index, bool isDefault=false)
 Constructor. More...
 
void setParameter (const double &value, bool isExplicitlySet=true)
 Set the parameter. More...
 
virtual ~ParameterReference ()=default
 

Protected Member Functions

void reset (IFunction *fun, std::size_t index, bool isDefault=false)
 Reset the reference. More...
 

Private Attributes

IFunctionm_function
 Function that together with m_index uniquely identify the parameter. More...
 
std::size_t m_index
 Index of the parameter in m_function. More...
 
bool m_isDefault
 Flag to mark as default the value of an object associated with this reference: a tie or a constraint. More...
 
IFunctionm_owner
 Function-owner of this reference. More...
 

Detailed Description

A reference to a parameter in a function.

To uniquely identify a parameter in a composite function

Author
Roman Tolchenov, Tessella Support Services plc
Date
26/02/2010

Definition at line 25 of file ParameterReference.h.

Constructor & Destructor Documentation

◆ ParameterReference() [1/2]

Mantid::API::ParameterReference::ParameterReference ( )

Default constructor.

Definition at line 13 of file ParameterReference.cpp.

◆ ParameterReference() [2/2]

Mantid::API::ParameterReference::ParameterReference ( IFunction fun,
std::size_t  index,
bool  isDefault = false 
)

Constructor.

Parameters
fun:: Pointer to a function (composite or simple).
index:: Index of a parameter of fun
isDefault:: Flag to mark as default the value of an object associated with this reference: a tie or a constraint.

Definition at line 23 of file ParameterReference.cpp.

References index, isDefault(), and reset().

◆ ~ParameterReference()

virtual Mantid::API::ParameterReference::~ParameterReference ( )
virtualdefault

Member Function Documentation

◆ getLocalFunction()

IFunction * Mantid::API::ParameterReference::getLocalFunction ( ) const

◆ getLocalIndex()

std::size_t Mantid::API::ParameterReference::getLocalIndex ( ) const

◆ getParameter()

double Mantid::API::ParameterReference::getParameter ( ) const

◆ isDefault()

bool Mantid::API::ParameterReference::isDefault ( ) const

◆ isParameterOf()

bool Mantid::API::ParameterReference::isParameterOf ( const IFunction fun) const

Find out if this refers to a parameter of a function: direct or via composite function member.

Parameters
fun:: A function to check.

Definition at line 86 of file ParameterReference.cpp.

References Mantid::API::CompositeFunction::functionIndex(), m_function, and m_index.

◆ ownerFunction()

IFunction * Mantid::API::ParameterReference::ownerFunction ( ) const

Definition at line 78 of file ParameterReference.cpp.

References m_owner.

◆ parameterIndex()

std::size_t Mantid::API::ParameterReference::parameterIndex ( ) const

Return parameter index in the owning function.

Definition at line 35 of file ParameterReference.cpp.

References Mantid::API::IFunction::getParameterIndex(), and m_owner.

Referenced by parameterName().

◆ parameterName()

std::string Mantid::API::ParameterReference::parameterName ( ) const

◆ reset()

void Mantid::API::ParameterReference::reset ( IFunction fun,
std::size_t  index,
bool  isDefault = false 
)
protected

Reset the reference.

Parameters
fun:: Pointer to a function (composite or simple).
index:: Index of a parameter of fun
isDefault:: Flag to mark as default the value of an object associated with this reference: a tie or a constraint.

Definition at line 48 of file ParameterReference.cpp.

References Mantid::API::CompositeFunction::functionIndex(), Mantid::API::IFunction::getFunction(), index, isDefault(), m_function, m_index, m_isDefault, m_owner, and Mantid::API::IFunction::parameterIndex().

Referenced by Mantid::CurveFitting::Constraints::BoundaryConstraint::BoundaryConstraint(), Mantid::CurveFitting::Constraints::BoundaryConstraint::initialize(), and ParameterReference().

◆ setParameter()

void Mantid::API::ParameterReference::setParameter ( const double &  value,
bool  isExplicitlySet = true 
)

Set the parameter.

Parameters
value:: A value to set.
isExplicitlySet:: Flag that user explicitly set this parameter.

Definition at line 71 of file ParameterReference.cpp.

References m_function, m_index, Mantid::API::IFunction::setParameter(), and value.

Referenced by Mantid::API::ParameterTie::eval(), and Mantid::CurveFitting::Constraints::BoundaryConstraint::setParamToSatisfyConstraint().

Member Data Documentation

◆ m_function

IFunction* Mantid::API::ParameterReference::m_function
private

Function that together with m_index uniquely identify the parameter.

Definition at line 48 of file ParameterReference.h.

Referenced by getLocalFunction(), getParameter(), isParameterOf(), reset(), and setParameter().

◆ m_index

std::size_t Mantid::API::ParameterReference::m_index
private

Index of the parameter in m_function.

It is assumed that this index uniquely identifies the parameter withing m_function

Definition at line 51 of file ParameterReference.h.

Referenced by getLocalIndex(), getParameter(), isParameterOf(), reset(), and setParameter().

◆ m_isDefault

bool Mantid::API::ParameterReference::m_isDefault
private

Flag to mark as default the value of an object associated with this reference: a tie or a constraint.

Definition at line 54 of file ParameterReference.h.

Referenced by isDefault(), and reset().

◆ m_owner

IFunction* Mantid::API::ParameterReference::m_owner
private

Function-owner of this reference.

parameterName() and parameterIndex() return values relative to this function.

Definition at line 46 of file ParameterReference.h.

Referenced by ownerFunction(), parameterIndex(), parameterName(), and reset().


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