ROOT  6.06/09
Reference Guide
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::WrappedParamFunction< FuncPtr > Class Template Reference

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

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

Public Member Functions

 WrappedParamFunction (FuncPtr func, unsigned int dim=1, unsigned int npar=0, double *par=0)
 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. More...
 
template<class Iterator >
 WrappedParamFunction (FuncPtr func, unsigned int dim, Iterator begin, Iterator end)
 Constructor a wrapped function from a non-const pointer to a callable object, the function dimension and number of parameters which are set to zero by default This constructor is needed in the case FuncPtr is a std::auto_ptr which has a copy ctor taking non const objects. More...
 
IMultiGenFunctionClone () const
 Constructor a wrapped function from a non - const pointer to a callable object, the function dimension and an iterator specifying begin and end of parameters. More...
 
const doubleParameters () const
 Access the parameter values. More...
 
void SetParameters (const double *p)
 Set the parameter values. More...
 
unsigned int NPar () const
 Return the number of Parameters. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
- Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDim
double operator() (const double *x, const double *p) const
 Evaluate function at a point x and for given parameters p. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDim
 IBaseFunctionMultiDim ()
 
virtual ~IBaseFunctionMultiDim ()
 virtual destructor More...
 
double operator() (const double *x) const
 Evaluate the function at a point x[]. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseParam
virtual ~IBaseParam ()
 Virtual Destructor (no operations) More...
 
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, ...") More...
 

Private Member Functions

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

Private Attributes

FuncPtr fFunc
 
unsigned int fDim
 
std::vector< doublefParams
 

Additional Inherited Members

- Public Types inherited from ROOT::Math::IParametricFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 

#include <Math/WrappedParamFunction.h>

+ Inheritance diagram for ROOT::Math::WrappedParamFunction< FuncPtr >:
+ Collaboration diagram for ROOT::Math::WrappedParamFunction< FuncPtr >:

Constructor & Destructor Documentation

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

Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::Clone().

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 non-const pointer to a callable object, the function dimension and number of parameters which are set to zero by default This constructor is needed in the case FuncPtr is a std::auto_ptr which has a copy ctor taking non const objects.

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

Member Function Documentation

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

Constructor a wrapped function from a non - const pointer to a callable object, the function dimension and an iterator specifying begin and end of parameters.

This constructor is needed in the case FuncPtr is a std::auto_ptr which has a copy ctor taking non const objectsclone the function

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 95 of file WrappedParamFunction.h.

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

evaluate the function given values and parameters (requested interface)

Implements ROOT::Math::IParametricFunctionMultiDim.

Definition at line 115 of file WrappedParamFunction.h.

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

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 109 of file WrappedParamFunction.h.

Referenced by testLargeTreeFit(), and testTreeFit().

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

Return the number of Parameters.

Implements ROOT::Math::IBaseParam.

Definition at line 107 of file WrappedParamFunction.h.

Referenced by ROOT::Math::WrappedParamFunction< FuncPtr >::SetParameters(), testLargeTreeFit(), and testTreeFit().

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

Access the parameter values.

Implements ROOT::Math::IBaseParam.

Definition at line 99 of file WrappedParamFunction.h.

template<typename FuncPtr = FreeParamMultiFunctionPtr>
void ROOT::Math::WrappedParamFunction< 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 103 of file WrappedParamFunction.h.

Referenced by DoBinFit(), and testHisto2DFit().

Member Data Documentation

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

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