Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::WrappedParamFunction< FuncPtr > Class Template Reference

template<typename FuncPtr = FreeParamMultiFunctionPtr>
class ROOT::Math::WrappedParamFunction< FuncPtr >

WrappedParamFunction class to wrap any multi-dimensional function object 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 44 of file WrappedParamFunction.h.

Public Member Functions

template<class Iterator >
 WrappedParamFunction (FuncPtr func, unsigned int dim, Iterator begin, Iterator end)
 Constructor a wrapped function from a pointer to a callable object, the function dimension and an iterator specifying begin and end of parameters.
 
 WrappedParamFunction (FuncPtr func, unsigned int dim=1, unsigned int npar=0, double *par=nullptr)
 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.
 
IMultiGenFunctionClone () const override
 clone the function
 
unsigned int NDim () const override
 Retrieve the dimension of the function.
 
unsigned int NPar () const override
 Return the number of Parameters.
 
const doubleParameters () const override
 Access the parameter values.
 
void SetParameters (const double *p) override
 Set the parameter values.
 
- Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDimTempl< double >
double operator() (const double *x) const
 
double operator() (const double *x, const double *p) const
 Evaluate function at a point x and for given parameters p.
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
virtual ~IBaseFunctionMultiDimTempl ()=default
 
virtual bool HasGradient () const
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 
- Public Member Functions inherited from ROOT::Math::IBaseParam
virtual ~IBaseParam ()
 Virtual Destructor (no operations)
 
virtual std::string ParameterName (unsigned int i) const
 Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...")
 

Private Member Functions

double DoEvalPar (const double *x, const double *p) const override
 evaluate the function given values and parameters (requested interface)
 

Private Attributes

unsigned int fDim
 
FuncPtr fFunc
 
std::vector< doublefParams
 

Additional Inherited Members

- Public Types inherited from ROOT::Math::IParametricFunctionMultiDimTempl< double >
typedef IBaseFunctionMultiDimTempl< doubleBaseFunc
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

#include <Math/WrappedParamFunction.h>

Inheritance diagram for ROOT::Math::WrappedParamFunction< FuncPtr >:
[legend]

Constructor & Destructor Documentation

◆ WrappedParamFunction() [1/2]

template<typename FuncPtr = FreeParamMultiFunctionPtr>
ROOT::Math::WrappedParamFunction< FuncPtr >::WrappedParamFunction ( FuncPtr  func,
unsigned int  dim = 1,
unsigned int  npar = 0,
double par = nullptr 
)
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 52 of file WrappedParamFunction.h.

◆ WrappedParamFunction() [2/2]

template<typename FuncPtr = FreeParamMultiFunctionPtr>
template<class Iterator >
ROOT::Math::WrappedParamFunction< FuncPtr >::WrappedParamFunction ( FuncPtr  func,
unsigned int  dim,
Iterator  begin,
Iterator  end 
)
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 78 of file WrappedParamFunction.h.

Member Function Documentation

◆ Clone()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
IMultiGenFunction * ROOT::Math::WrappedParamFunction< FuncPtr >::Clone ( ) const
inlineoverridevirtual

clone the function

Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.

Definition at line 96 of file WrappedParamFunction.h.

◆ DoEvalPar()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
double ROOT::Math::WrappedParamFunction< FuncPtr >::DoEvalPar ( const double x,
const double p 
) const
inlineoverrideprivatevirtual

evaluate the function given values and parameters (requested interface)

Implements ROOT::Math::IParametricFunctionMultiDimTempl< double >.

Definition at line 116 of file WrappedParamFunction.h.

◆ NDim()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunction< FuncPtr >::NDim ( ) const
inlineoverridevirtual

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.

Definition at line 110 of file WrappedParamFunction.h.

◆ NPar()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunction< FuncPtr >::NPar ( ) const
inlineoverridevirtual

Return the number of Parameters.

Implements ROOT::Math::IBaseParam.

Definition at line 108 of file WrappedParamFunction.h.

◆ Parameters()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
const double * ROOT::Math::WrappedParamFunction< FuncPtr >::Parameters ( ) const
inlineoverridevirtual

Access the parameter values.

Implements ROOT::Math::IBaseParam.

Definition at line 100 of file WrappedParamFunction.h.

◆ SetParameters()

template<typename FuncPtr = FreeParamMultiFunctionPtr>
void ROOT::Math::WrappedParamFunction< FuncPtr >::SetParameters ( const double p)
inlineoverridevirtual

Set the parameter values.

Parameters
pvector 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 104 of file WrappedParamFunction.h.

Member Data Documentation

◆ fDim

template<typename FuncPtr = FreeParamMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunction< FuncPtr >::fDim
private

Definition at line 122 of file WrappedParamFunction.h.

◆ fFunc

template<typename FuncPtr = FreeParamMultiFunctionPtr>
FuncPtr ROOT::Math::WrappedParamFunction< FuncPtr >::fFunc
private

Definition at line 121 of file WrappedParamFunction.h.

◆ fParams

template<typename FuncPtr = FreeParamMultiFunctionPtr>
std::vector<double> ROOT::Math::WrappedParamFunction< FuncPtr >::fParams
private

Definition at line 123 of file WrappedParamFunction.h.

  • math/mathcore/inc/Math/WrappedParamFunction.h