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

template<typename FuncPtr = FreeMultiFunctionPtr>
class ROOT::Math::WrappedParamFunctionGen< FuncPtr >

WrappedParamGenFunction class to wrap any multi-dimensional function implementing the operator()(const double * ) in an interface-like IParamFunction, by fixing some of the variables and define them as parameters.

i.e. transform any multi-dim function in a parametric function

Definition at line 140 of file WrappedParamFunction.h.

Public Member Functions

 WrappedParamFunctionGen (const FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx)
 Constructor a wrapped function from a pointer to a generic callable object implemention operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which becames parameters in the new API.
 
 WrappedParamFunctionGen (FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx)
 Constructor as before but taking now a non - const pointer to a callable object.
 
IMultiGenFunctionClone () const
 clone the function
 
unsigned int NDim () const
 Retrieve the dimension of the function.
 
unsigned int NPar () const
 Return the number of Parameters.
 
const doubleParameters () const
 Access the parameter values.
 
void SetParameters (const double *p)
 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 >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor
 
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

 WrappedParamFunctionGen (const WrappedParamFunctionGen &)
 
double DoEval (const double *x) const
 evaluate the function (re-implement for being more efficient)
 
double DoEvalPar (const double *x, const double *p) const
 implement the required IParamFunction interface
 
void DoInit ()
 
WrappedParamFunctionGenoperator= (const WrappedParamFunctionGen &)
 
void SetParValues (unsigned int npar, const double *p) const
 

Private Attributes

unsigned int fDim
 
FuncPtr fFunc
 
std::vector< doublefParams
 
std::vector< unsigned intfParIndices
 
std::vector< unsigned intfVarIndices
 
std::vector< doublefX
 

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::WrappedParamFunctionGen< FuncPtr >:
[legend]

Constructor & Destructor Documentation

◆ WrappedParamFunctionGen() [1/3]

template<typename FuncPtr = FreeMultiFunctionPtr>
ROOT::Math::WrappedParamFunctionGen< FuncPtr >::WrappedParamFunctionGen ( const FuncPtr &  func,
unsigned int  dim,
unsigned int  npar,
const double par,
const unsigned int idx 
)
inline

Constructor a wrapped function from a pointer to a generic callable object implemention operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which becames parameters in the new API.

Definition at line 149 of file WrappedParamFunction.h.

◆ WrappedParamFunctionGen() [2/3]

template<typename FuncPtr = FreeMultiFunctionPtr>
ROOT::Math::WrappedParamFunctionGen< FuncPtr >::WrappedParamFunctionGen ( FuncPtr &  func,
unsigned int  dim,
unsigned int  npar,
const double par,
const unsigned int idx 
)
inline

Constructor as before but taking now a non - const pointer to a callable object.

This constructor is needed in the case FuncPtr is a std::unique_ptr which has a copy ctor taking non const objects

Definition at line 163 of file WrappedParamFunction.h.

◆ WrappedParamFunctionGen() [3/3]

template<typename FuncPtr = FreeMultiFunctionPtr>
ROOT::Math::WrappedParamFunctionGen< FuncPtr >::WrappedParamFunctionGen ( const WrappedParamFunctionGen< FuncPtr > &  )
private

Member Function Documentation

◆ Clone()

template<typename FuncPtr = FreeMultiFunctionPtr>
IMultiGenFunction * ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone ( ) const
inlinevirtual

clone the function

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

Definition at line 174 of file WrappedParamFunction.h.

◆ DoEval()

template<typename FuncPtr = FreeMultiFunctionPtr>
double ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval ( const double x) const
inlineprivatevirtual

evaluate the function (re-implement for being more efficient)

Reimplemented from ROOT::Math::IParametricFunctionMultiDimTempl< double >.

Definition at line 210 of file WrappedParamFunction.h.

◆ DoEvalPar()

template<typename FuncPtr = FreeMultiFunctionPtr>
double ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEvalPar ( const double x,
const double p 
) const
inlineprivatevirtual

implement the required IParamFunction interface

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

Definition at line 237 of file WrappedParamFunction.h.

◆ DoInit()

template<typename FuncPtr = FreeMultiFunctionPtr>
void ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit ( )
inlineprivate

Definition at line 243 of file WrappedParamFunction.h.

◆ NDim()

template<typename FuncPtr = FreeMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunctionGen< FuncPtr >::NDim ( ) const
inlinevirtual

Retrieve the dimension of the function.

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

Definition at line 197 of file WrappedParamFunction.h.

◆ NPar()

template<typename FuncPtr = FreeMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunctionGen< FuncPtr >::NPar ( ) const
inlinevirtual

Return the number of Parameters.

Implements ROOT::Math::IBaseParam.

Definition at line 195 of file WrappedParamFunction.h.

◆ operator=()

template<typename FuncPtr = FreeMultiFunctionPtr>
WrappedParamFunctionGen & ROOT::Math::WrappedParamFunctionGen< FuncPtr >::operator= ( const WrappedParamFunctionGen< FuncPtr > &  )
private

◆ Parameters()

template<typename FuncPtr = FreeMultiFunctionPtr>
const double * ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Parameters ( ) const
inlinevirtual

Access the parameter values.

Implements ROOT::Math::IBaseParam.

Definition at line 185 of file WrappedParamFunction.h.

◆ SetParameters()

template<typename FuncPtr = FreeMultiFunctionPtr>
void ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParameters ( const double p)
inlinevirtual

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 189 of file WrappedParamFunction.h.

◆ SetParValues()

template<typename FuncPtr = FreeMultiFunctionPtr>
void ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParValues ( unsigned int  npar,
const double p 
) const
inlineprivate

Definition at line 278 of file WrappedParamFunction.h.

Member Data Documentation

◆ fDim

template<typename FuncPtr = FreeMultiFunctionPtr>
unsigned int ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fDim
private

Definition at line 288 of file WrappedParamFunction.h.

◆ fFunc

template<typename FuncPtr = FreeMultiFunctionPtr>
FuncPtr ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fFunc
mutableprivate

Definition at line 287 of file WrappedParamFunction.h.

◆ fParams

template<typename FuncPtr = FreeMultiFunctionPtr>
std::vector<double> ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fParams
private

Definition at line 289 of file WrappedParamFunction.h.

◆ fParIndices

template<typename FuncPtr = FreeMultiFunctionPtr>
std::vector<unsigned int> ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fParIndices
private

Definition at line 291 of file WrappedParamFunction.h.

◆ fVarIndices

template<typename FuncPtr = FreeMultiFunctionPtr>
std::vector<unsigned int> ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fVarIndices
private

Definition at line 290 of file WrappedParamFunction.h.

◆ fX

template<typename FuncPtr = FreeMultiFunctionPtr>
std::vector<double> ROOT::Math::WrappedParamFunctionGen< FuncPtr >::fX
mutableprivate

Definition at line 292 of file WrappedParamFunction.h.

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