Logo ROOT   6.10/09
Reference Guide
List of all members | Public Types | Public Member Functions | List of all members
ROOT::Math::WrappedMultiTF1Templ< T > Class Template Reference

template<class T>
class ROOT::Math::WrappedMultiTF1Templ< T >

Class to Wrap a ROOT Function class (like TF1) in a IParamMultiFunction interface of multi-dimensions to be used in the ROOT::Math numerical algorithm.

This wrapper class does not own the TF1 pointer, so it assumes it exists during the wrapper lifetime. The class copy the TF1 pointer only when it owns it.

The class from ROOT version 6.03 does not contain anymore a copy of the parameters. The parameters are stored in the TF1 class.

Definition at line 44 of file WrappedMultiTF1.h.

Public Types

typedef ROOT::Math::IParametricFunctionMultiDimTempl< T >::BaseFunc BaseFunc
 
typedef ROOT::Math::IParametricGradFunctionMultiDimTempl< T > BaseParamFunc
 
- Public Types inherited from ROOT::Math::IParametricGradFunctionMultiDimTempl< T >
using BaseFunc = typename IParametricFunctionMultiDimTempl< T >::BaseFunc
 
using BaseGradFunc = IGradientFunctionMultiDim
 
using BaseParamFunc = IParametricFunctionMultiDimTempl< T >
 
- Public Types inherited from ROOT::Math::IParametricFunctionMultiDimTempl< T >
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 WrappedMultiTF1Templ (TF1 &f, unsigned int dim=0)
 constructor from a function pointer to a TF1 If dim = 0 dimension is taken from TF1::GetNdim(). More...
 
 WrappedMultiTF1Templ (const WrappedMultiTF1Templ< T > &rhs)
 Copy constructor. More...
 
 ~WrappedMultiTF1Templ ()
 Destructor (no operations). More...
 
WrappedMultiTF1Temploperator= (const WrappedMultiTF1Templ< T > &rhs)
 Assignment operator. More...
 
- Public Member Functions inherited from ROOT::Math::IParametricGradFunctionMultiDimTempl< T >
virtual ~IParametricGradFunctionMultiDimTempl ()
 Virtual Destructor (no operations) More...
 
double ParameterDerivative (const double *x, const double *p, unsigned int ipar=0) const
 Evaluate the partial derivative w.r.t a parameter ipar from values and parameters. More...
 
double ParameterDerivative (const double *x, unsigned int ipar=0) const
 Evaluate partial derivative using cached parameter values. More...
 
void ParameterGradient (const double *x, double *grad) const
 Evaluate all derivatives using cached parameter values. More...
 
- Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDimTempl< T >
operator() (const T *x, const double *p) const
 Evaluate function at a point x and for given parameters p. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor More...
 
operator() (const T *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...
 

interface inherited from IParamFunction

bool fLinear
 
bool fPolynomial
 
bool fOwnFunc
 
TF1fFunc
 
unsigned int fDim
 
IMultiGenFunctionTempl< T > * Clone () const
 Clone the wrapper but not the original function. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
const double * Parameters () const
 get the parameter values (return values from TF1) More...
 
void SetParameters (const double *p)
 set parameter values (only the cached one in this class,leave unchanges those of TF1) More...
 
unsigned int NPar () const
 return number of parameters More...
 
std::string ParameterName (unsigned int i) const
 return parameter name (from TF1) More...
 
void ParameterGradient (const double *x, const double *par, double *grad) const
 Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x. More...
 
const TF1GetFunction () const
 method to retrieve the internal function pointer More...
 
void SetAndCopyFunction (const TF1 *f=0)
 method to set a new function pointer and copy it inside. More...
 
static void SetDerivPrecision (double eps)
 precision value used for calculating the derivative step-size h = eps * |x|. More...
 
static double GetDerivPrecision ()
 get precision value used for calculating the derivative step-size More...
 
DoEvalPar (const T *x, const double *p) const
 evaluate function passing coordinates x and vector of parameters More...
 
DoEvalVec (const T *x) const
 evaluate function using the cached parameter values (of TF1) re-implement for better efficiency More...
 
DoEval (const T *x) const
 evaluate function using the cached parameter values (of TF1) re-implement for better efficiency More...
 
double DoParameterDerivative (const double *x, const double *p, unsigned int ipar) const
 evaluate the partial derivative with respect to the parameter More...
 

#include <Math/WrappedMultiTF1.h>

Inheritance diagram for ROOT::Math::WrappedMultiTF1Templ< T >:
[legend]

Member Typedef Documentation

◆ BaseFunc

Definition at line 49 of file WrappedMultiTF1.h.

◆ BaseParamFunc

Definition at line 48 of file WrappedMultiTF1.h.

Constructor & Destructor Documentation

◆ WrappedMultiTF1Templ() [1/2]

template<class T >
ROOT::Math::WrappedMultiTF1Templ< T >::WrappedMultiTF1Templ ( TF1 f,
unsigned int  dim = 0 
)

constructor from a function pointer to a TF1 If dim = 0 dimension is taken from TF1::GetNdim().

IN case of multi-dimensional function created using directly TF1 object the dimension returned by TF1::GetNdim is always 1. The user must then pass the correct value of dim

Definition at line 179 of file WrappedMultiTF1.h.

◆ ~WrappedMultiTF1Templ()

template<class T>
ROOT::Math::WrappedMultiTF1Templ< T >::~WrappedMultiTF1Templ ( )
inline

Destructor (no operations).

Function pointer is not owned

Definition at line 62 of file WrappedMultiTF1.h.

◆ WrappedMultiTF1Templ() [2/2]

template<class T >
ROOT::Math::WrappedMultiTF1Templ< T >::WrappedMultiTF1Templ ( const WrappedMultiTF1Templ< T > &  rhs)

Copy constructor.

Definition at line 211 of file WrappedMultiTF1.h.

Member Function Documentation

◆ Clone()

template<class T>
IMultiGenFunctionTempl<T>* ROOT::Math::WrappedMultiTF1Templ< T >::Clone ( ) const
inlinevirtual

Clone the wrapper but not the original function.

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

Definition at line 82 of file WrappedMultiTF1.h.

◆ DoEval()

template<class T>
T ROOT::Math::WrappedMultiTF1Templ< T >::DoEval ( const T *  x) const
inlineprivatevirtual

evaluate function using the cached parameter values (of TF1) re-implement for better efficiency

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

Definition at line 157 of file WrappedMultiTF1.h.

◆ DoEvalPar()

template<class T>
T ROOT::Math::WrappedMultiTF1Templ< T >::DoEvalPar ( const T *  x,
const double *  p 
) const
inlineprivatevirtual

evaluate function passing coordinates x and vector of parameters

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

Definition at line 143 of file WrappedMultiTF1.h.

◆ DoEvalVec()

template<class T>
T ROOT::Math::WrappedMultiTF1Templ< T >::DoEvalVec ( const T *  x) const
inlineprivate

evaluate function using the cached parameter values (of TF1) re-implement for better efficiency

Definition at line 150 of file WrappedMultiTF1.h.

◆ DoParameterDerivative()

template<class T >
double ROOT::Math::WrappedMultiTF1Templ< T >::DoParameterDerivative ( const double *  x,
const double *  p,
unsigned int  ipar 
) const
privatevirtual

evaluate the partial derivative with respect to the parameter

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

Definition at line 260 of file WrappedMultiTF1.h.

◆ GetDerivPrecision()

template<class T >
double ROOT::Math::WrappedMultiTF1Templ< T >::GetDerivPrecision ( )
static

get precision value used for calculating the derivative step-size

Definition at line 290 of file WrappedMultiTF1.h.

◆ GetFunction()

template<class T>
const TF1* ROOT::Math::WrappedMultiTF1Templ< T >::GetFunction ( ) const
inline

method to retrieve the internal function pointer

Definition at line 132 of file WrappedMultiTF1.h.

◆ NDim()

template<class T>
unsigned int ROOT::Math::WrappedMultiTF1Templ< T >::NDim ( ) const
inlinevirtual

Retrieve the dimension of the function.

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

Definition at line 90 of file WrappedMultiTF1.h.

◆ NPar()

template<class T>
unsigned int ROOT::Math::WrappedMultiTF1Templ< T >::NPar ( ) const
inlinevirtual

return number of parameters

Implements ROOT::Math::IBaseParam.

Definition at line 110 of file WrappedMultiTF1.h.

◆ operator=()

template<class T >
WrappedMultiTF1Templ< T > & ROOT::Math::WrappedMultiTF1Templ< T >::operator= ( const WrappedMultiTF1Templ< T > &  rhs)

Assignment operator.

Definition at line 226 of file WrappedMultiTF1.h.

◆ ParameterGradient()

template<class T >
void ROOT::Math::WrappedMultiTF1Templ< T >::ParameterGradient ( const double *  x,
const double *  p,
double *  grad 
) const
virtual

Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x.

It is optional to be implemented by the derived classes for better efficiency

Reimplemented from ROOT::Math::IParametricGradFunctionMultiDimTempl< T >.

Definition at line 239 of file WrappedMultiTF1.h.

◆ ParameterName()

template<class T>
std::string ROOT::Math::WrappedMultiTF1Templ< T >::ParameterName ( unsigned int  i) const
inlinevirtual

return parameter name (from TF1)

Reimplemented from ROOT::Math::IBaseParam.

Definition at line 117 of file WrappedMultiTF1.h.

◆ Parameters()

template<class T>
const double* ROOT::Math::WrappedMultiTF1Templ< T >::Parameters ( ) const
inlinevirtual

get the parameter values (return values from TF1)

Implements ROOT::Math::IBaseParam.

Definition at line 96 of file WrappedMultiTF1.h.

◆ SetAndCopyFunction()

template<class T >
void ROOT::Math::WrappedMultiTF1Templ< T >::SetAndCopyFunction ( const TF1 f = 0)

method to set a new function pointer and copy it inside.

By calling this method the class manages now the passed TF1 pointer

Definition at line 296 of file WrappedMultiTF1.h.

◆ SetDerivPrecision()

template<class T >
void ROOT::Math::WrappedMultiTF1Templ< T >::SetDerivPrecision ( double  eps)
static

precision value used for calculating the derivative step-size h = eps * |x|.

The default is 0.001, give a smaller in case function changes rapidly

Definition at line 284 of file WrappedMultiTF1.h.

◆ SetParameters()

template<class T>
void ROOT::Math::WrappedMultiTF1Templ< T >::SetParameters ( const double *  p)
inlinevirtual

set parameter values (only the cached one in this class,leave unchanges those of TF1)

Implements ROOT::Math::IBaseParam.

Definition at line 103 of file WrappedMultiTF1.h.

Member Data Documentation

◆ fDim

template<class T>
unsigned int ROOT::Math::WrappedMultiTF1Templ< T >::fDim
private

Definition at line 172 of file WrappedMultiTF1.h.

◆ fFunc

template<class T>
TF1* ROOT::Math::WrappedMultiTF1Templ< T >::fFunc
private

Definition at line 171 of file WrappedMultiTF1.h.

◆ fLinear

template<class T>
bool ROOT::Math::WrappedMultiTF1Templ< T >::fLinear
private

Definition at line 168 of file WrappedMultiTF1.h.

◆ fOwnFunc

template<class T>
bool ROOT::Math::WrappedMultiTF1Templ< T >::fOwnFunc
private

Definition at line 170 of file WrappedMultiTF1.h.

◆ fPolynomial

template<class T>
bool ROOT::Math::WrappedMultiTF1Templ< T >::fPolynomial
private

Definition at line 169 of file WrappedMultiTF1.h.


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