BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
WrappedParamFunction class to wrap any multi-dimensional function pbject implementing the operator()(const double * x, const double * p) in an interface-like IParamFunction with a vector storing and caching internally the parameter values
Definition at line 41 of file WrappedParamFunction.h.
Public Types | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< double > | BaseFunc |
Public Member Functions | |
template<class Iterator > | |
WrappedParamFunction (FuncPtr func, unsigned int dim, Iterator begin, Iterator end) | |
WrappedParamFunction (FuncPtr func, unsigned int dim=1, unsigned int npar=0, double *par=0) | |
IMultiGenFunction * | Clone () const |
clone the function More... | |
unsigned int | NDim () const |
unsigned int | NPar () const |
double | operator() (const double *x) const |
double | operator() (const double *x, const double *p) const |
T | operator() (const T *x) const |
virtual std::string | ParameterName (unsigned int i) const |
const double * | Parameters () const |
void | SetParameters (const double *p) |
Private Member Functions | |
virtual double | DoEval (const double *x) const |
double | DoEvalPar (const double *x, const double *p) const |
evaluate the function given values and parameters (requested interface) More... | |
Private Attributes | |
unsigned int | fDim |
FuncPtr | fFunc |
std::vector< double > | fParams |
|
inherited |
Definition at line 66 of file IFunction.h.
|
inherited |
Definition at line 108 of file IParamFunction.h.
|
inline |
Constructor a wrapped function from a pointer to a callable object, the function dimension and number of parameters which are set to zero by default
Definition at line 49 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fParams.
Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::Clone().
|
inline |
Constructor a wrapped function from a pointer to a callable object, the function dimension and an iterator specifying begin and end of parameters
Definition at line 75 of file WrappedParamFunction.h.
|
inlinevirtual |
clone the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 93 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::WrappedParamFunction(), ROOT::Math::WrappedParamFunction< FuncPtr >::fDim, ROOT::Math::WrappedParamFunction< FuncPtr >::fFunc, and ROOT::Math::WrappedParamFunction< FuncPtr >::fParams.
|
inlineprivatevirtualinherited |
Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values
Reimplemented in ROOT::Math::WrappedParamFunctionGen< FuncPtr >.
Definition at line 140 of file IParamFunction.h.
|
inlineprivatevirtual |
evaluate the function given values and parameters (requested interface)
Implements ROOT::Math::IParametricFunctionMultiDimTempl< double >.
Definition at line 113 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fFunc.
|
inlinevirtual |
Retrieve the dimension of the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 107 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fDim.
|
inlinevirtual |
Return the number of Parameters
Implements ROOT::Math::IBaseParam.
Definition at line 105 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fParams.
Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::SetParameters().
|
inlineinherited |
Definition at line 125 of file IParamFunction.h.
|
inlineinherited |
Evaluate function at a point x and for given parameters p. This method does not change the internal status of the function (internal parameter values). If for some reason one prefers caching the parameter values, SetParameters(p) and then operator()(x) should be called. Use the pure virtual function DoEvalPar to implement it
Definition at line 120 of file IParamFunction.h.
|
inlineinherited |
Evaluate the function at a point x[]. Use the pure virtual private method DoEval which must be implemented by the sub-classes
Definition at line 92 of file IFunction.h.
References ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inlinevirtualinherited |
Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...")
Definition at line 83 of file IParamFunction.h.
References ROOT::Math::IBaseParam::NPar(), and ROOT::Math::Util::ToString().
Referenced by ROOT::Fit::FitConfig::CreateParamsSettings().
|
inlinevirtual |
Access the parameter values
Implements ROOT::Math::IBaseParam.
Definition at line 97 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fParams.
|
inlinevirtual |
Set the parameter values
p | vector of doubles containing the parameter values. |
to be defined: can user change number of params ? At the moment no.
Implements ROOT::Math::IBaseParam.
Definition at line 101 of file WrappedParamFunction.h.
References ROOT::Math::WrappedParamFunction< FuncPtr >::fParams, and ROOT::Math::WrappedParamFunction< FuncPtr >::NPar().
|
private |
Definition at line 119 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::Clone(), and ROOT::Math::WrappedParamFunction< FuncPtr >::NDim().
|
private |
Definition at line 118 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::Clone(), and ROOT::Math::WrappedParamFunction< FuncPtr >::DoEvalPar().
|
private |
Definition at line 120 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::WrappedParamFunction(), ROOT::Math::WrappedParamFunction< FuncPtr >::Clone(), ROOT::Math::WrappedParamFunction< FuncPtr >::NPar(), ROOT::Math::WrappedParamFunction< FuncPtr >::Parameters(), and ROOT::Math::WrappedParamFunction< FuncPtr >::SetParameters().