Logo ROOT   6.08/07
Reference Guide
List of all members | Public Types | Public Member Functions | List of all members
ROOT::Math::WrappedMultiTF1 Class Reference

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::IParamMultiFunction::BaseFunc BaseFunc
 
typedef ROOT::Math::IParamMultiGradFunction BaseParamFunc
 
- Public Types inherited from ROOT::Math::IParametricGradFunctionMultiDim
typedef IParametricFunctionMultiDim::BaseFunc BaseFunc
 
typedef IGradientFunctionMultiDim BaseGradFunc
 
typedef IParametricFunctionMultiDim BaseParamFunc
 
- Public Types inherited from ROOT::Math::IParametricFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 

Public Member Functions

 WrappedMultiTF1 (TF1 &f, unsigned int dim=0)
 constructor from a function pointer to a TF1 If dim = 0 dimension is taken from TF1::GetNdim(). More...
 
 WrappedMultiTF1 (const WrappedMultiTF1 &rhs)
 Copy constructor. More...
 
virtual ~WrappedMultiTF1 ()
 Destructor (no operations). More...
 
WrappedMultiTF1operator= (const WrappedMultiTF1 &rhs)
 Assignment operator. More...
 
interface inherited from IFunction
IMultiGenFunctionClone () const
 Clone the wrapper but not the original function. More...
 
unsigned int NDim () const
 function dimension More...
 
- Public Member Functions inherited from ROOT::Math::IParametricGradFunctionMultiDim
virtual ~IParametricGradFunctionMultiDim ()
 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::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...
 

interface inherited from IParamFunction

bool fLinear
 
bool fPolynomial
 
bool fOwnFunc
 
TF1fFunc
 
unsigned int fDim
 
static double fgEps = 0.001
 
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 derivative of the function with respect to the parameters 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...
 
double DoEvalPar (const double *x, const double *p) const
 evaluate function passing coordinates x and vector of parameters More...
 
double DoEval (const double *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::WrappedMultiTF1:
[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

◆ WrappedMultiTF1() [1/2]

ROOT::Math::WrappedMultiTF1::WrappedMultiTF1 ( 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 138 of file WrappedTF1.cxx.

◆ ~WrappedMultiTF1()

virtual ROOT::Math::WrappedMultiTF1::~WrappedMultiTF1 ( )
inlinevirtual

Destructor (no operations).

Function pointer is not owned

Definition at line 63 of file WrappedMultiTF1.h.

◆ WrappedMultiTF1() [2/2]

ROOT::Math::WrappedMultiTF1::WrappedMultiTF1 ( const WrappedMultiTF1 rhs)

Copy constructor.

Definition at line 170 of file WrappedTF1.cxx.

Member Function Documentation

◆ Clone()

IMultiGenFunction* ROOT::Math::WrappedMultiTF1::Clone ( ) const
inlinevirtual

Clone the wrapper but not the original function.

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 81 of file WrappedMultiTF1.h.

◆ DoEval()

double ROOT::Math::WrappedMultiTF1::DoEval ( const double *  x) const
inlineprivatevirtual

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

Reimplemented from ROOT::Math::IParametricFunctionMultiDim.

Definition at line 146 of file WrappedMultiTF1.h.

◆ DoEvalPar()

double ROOT::Math::WrappedMultiTF1::DoEvalPar ( const double *  x,
const double *  p 
) const
inlineprivatevirtual

evaluate function passing coordinates x and vector of parameters

Implements ROOT::Math::IParametricFunctionMultiDim.

Definition at line 139 of file WrappedMultiTF1.h.

◆ DoParameterDerivative()

double ROOT::Math::WrappedMultiTF1::DoParameterDerivative ( const double *  x,
const double *  p,
unsigned int  ipar 
) const
privatevirtual

evaluate the partial derivative with respect to the parameter

Implements ROOT::Math::IParametricGradFunctionMultiDim.

Definition at line 216 of file WrappedTF1.cxx.

◆ GetDerivPrecision()

double ROOT::Math::WrappedMultiTF1::GetDerivPrecision ( )
static

get precision value used for calculating the derivative step-size

Definition at line 240 of file WrappedTF1.cxx.

◆ GetFunction()

const TF1* ROOT::Math::WrappedMultiTF1::GetFunction ( ) const
inline

method to retrieve the internal function pointer

Definition at line 128 of file WrappedMultiTF1.h.

◆ NDim()

unsigned int ROOT::Math::WrappedMultiTF1::NDim ( ) const
inlinevirtual

function dimension

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 86 of file WrappedMultiTF1.h.

◆ NPar()

unsigned int ROOT::Math::WrappedMultiTF1::NPar ( ) const
inlinevirtual

return number of parameters

Implements ROOT::Math::IBaseParam.

Definition at line 106 of file WrappedMultiTF1.h.

◆ operator=()

WrappedMultiTF1 & ROOT::Math::WrappedMultiTF1::operator= ( const WrappedMultiTF1 rhs)

Assignment operator.

Definition at line 185 of file WrappedTF1.cxx.

◆ ParameterGradient()

void ROOT::Math::WrappedMultiTF1::ParameterGradient ( const double *  x,
const double *  par,
double *  grad 
) const
virtual

evaluate the derivative of the function with respect to the parameters

Reimplemented from ROOT::Math::IParametricGradFunctionMultiDim.

Definition at line 197 of file WrappedTF1.cxx.

◆ ParameterName()

std::string ROOT::Math::WrappedMultiTF1::ParameterName ( unsigned int  i) const
inlinevirtual

return parameter name (from TF1)

Reimplemented from ROOT::Math::IBaseParam.

Definition at line 112 of file WrappedMultiTF1.h.

◆ Parameters()

const double* ROOT::Math::WrappedMultiTF1::Parameters ( ) const
inlinevirtual

get the parameter values (return values from TF1)

Implements ROOT::Math::IBaseParam.

Definition at line 94 of file WrappedMultiTF1.h.

◆ SetAndCopyFunction()

void ROOT::Math::WrappedMultiTF1::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 242 of file WrappedTF1.cxx.

◆ SetDerivPrecision()

void ROOT::Math::WrappedMultiTF1::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 238 of file WrappedTF1.cxx.

◆ SetParameters()

void ROOT::Math::WrappedMultiTF1::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 100 of file WrappedMultiTF1.h.

Member Data Documentation

◆ fDim

unsigned int ROOT::Math::WrappedMultiTF1::fDim
private

Definition at line 162 of file WrappedMultiTF1.h.

◆ fFunc

TF1* ROOT::Math::WrappedMultiTF1::fFunc
private

Definition at line 161 of file WrappedMultiTF1.h.

◆ fgEps

double ROOT::Math::WrappedMultiTF1::fgEps = 0.001
staticprivate

Definition at line 165 of file WrappedMultiTF1.h.

◆ fLinear

bool ROOT::Math::WrappedMultiTF1::fLinear
private

Definition at line 158 of file WrappedMultiTF1.h.

◆ fOwnFunc

bool ROOT::Math::WrappedMultiTF1::fOwnFunc
private

Definition at line 160 of file WrappedMultiTF1.h.

◆ fPolynomial

bool ROOT::Math::WrappedMultiTF1::fPolynomial
private

Definition at line 159 of file WrappedMultiTF1.h.


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