Logo ROOT  
Reference Guide
ROOT::Math::MultiDimParamGradFunctionAdapter Class Reference

MultiDimParamGradFunctionAdapter class to wrap a one-dimensional parametric gradient function in a multi dimensional parameteric gradient function interface This is used typically in fitting where internally the function is stored as multidimension.

To wrap a non-parametric one-dim gradient function in a multi-dim interface one can use simply a a ROOT::Math::GradFunctor

The parameters are not stored in the adapter class and by default the pointer to the 1D function is owned. This means that deleteing the class deletes also the 1D function and copying the class copies also the 1D function This class differs from WrappedParamFunction in the fact that the parameters are not stored in the adapter class and optionally it keeps a cloned and managed copy of the adapter class.

Definition at line 174 of file MultiDimParamFunctionAdapter.h.

Public Types

typedef IParamMultiGradFunction::BaseFunc BaseFunc
 
- Public Types inherited from ROOT::Math::IParametricGradFunctionMultiDimTempl< T >
using BaseFunc = typename IParametricFunctionMultiDimTempl< T >::BaseFunc
 
using BaseGradFunc = IGradientFunctionMultiDimTempl< T >
 
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 T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 MultiDimParamGradFunctionAdapter (const IParamGradFunction &f)
 Constructor from a param one dim function interface from a const reference Copy and manage the own function pointer. More...
 
 MultiDimParamGradFunctionAdapter (const MultiDimParamGradFunctionAdapter &rhs)
 Copy constructor. More...
 
 MultiDimParamGradFunctionAdapter (IParamGradFunction &f)
 Constructor from a param one dim function interface from a non const reference Do not own the function pointer in this case. More...
 
virtual ~MultiDimParamGradFunctionAdapter ()
 Destructor (no operations) More...
 
virtual BaseFuncClone () const
 clone More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
unsigned int NPar () const
 Return the number of Parameters. More...
 
MultiDimParamGradFunctionAdapteroperator= (const MultiDimParamGradFunctionAdapter &rhs)
 Assignment operator. More...
 
void ParameterGradient (const double *x, const double *p, double *grad) const
 
const double * Parameters () const
 Access the parameter values. More...
 
void SetParameters (const double *p)
 Set the parameter values. More...
 
- Public Member Functions inherited from ROOT::Math::IParametricGradFunctionMultiDimTempl< T >
virtual ~IParametricGradFunctionMultiDimTempl ()
 Virtual Destructor (no operations) More...
 
operator() (const T *x) const
 
operator() (const T *x, const double *p) const
 
ParameterDerivative (const T *x, const double *p, unsigned int ipar=0) const
 Evaluate the partial derivative w.r.t a parameter ipar from values and parameters. More...
 
ParameterDerivative (const T *x, unsigned int ipar=0) const
 Evaluate partial derivative using cached parameter values. More...
 
virtual void ParameterGradient (const T *x, const double *p, T *grad) const
 Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x. More...
 
void ParameterGradient (const T *x, T *grad) const
 Evaluate all derivatives using cached parameter values. More...
 
- Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDimTempl< T >
operator() (const T *x) const
 
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...
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 Clone a function. More...
 
virtual unsigned int NDim () const =0
 Retrieve the dimension of the function. 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...
 
virtual unsigned int NPar () const =0
 Return the number of Parameters. 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...
 
virtual const double * Parameters () const =0
 Access the parameter values. More...
 
virtual void SetParameters (const double *p)=0
 Set the parameter values. More...
 

Private Member Functions

double DoEvalPar (const double *x, const double *p) const
 functions needed by interface More...
 
double DoParameterDerivative (const double *x, const double *p, unsigned int ipar) const
 

Private Attributes

IParamGradFunctionfFunc
 
bool fOwn
 

#include <Math/MultiDimParamFunctionAdapter.h>

Inheritance diagram for ROOT::Math::MultiDimParamGradFunctionAdapter:
[legend]

Member Typedef Documentation

◆ BaseFunc

Constructor & Destructor Documentation

◆ MultiDimParamGradFunctionAdapter() [1/3]

ROOT::Math::MultiDimParamGradFunctionAdapter::MultiDimParamGradFunctionAdapter ( const IParamGradFunction f)
inline

Constructor from a param one dim function interface from a const reference Copy and manage the own function pointer.

Definition at line 185 of file MultiDimParamFunctionAdapter.h.

◆ MultiDimParamGradFunctionAdapter() [2/3]

ROOT::Math::MultiDimParamGradFunctionAdapter::MultiDimParamGradFunctionAdapter ( IParamGradFunction f)
inline

Constructor from a param one dim function interface from a non const reference Do not own the function pointer in this case.

Definition at line 195 of file MultiDimParamFunctionAdapter.h.

◆ MultiDimParamGradFunctionAdapter() [3/3]

ROOT::Math::MultiDimParamGradFunctionAdapter::MultiDimParamGradFunctionAdapter ( const MultiDimParamGradFunctionAdapter rhs)
inline

Copy constructor.

Different behaviour according if function is owned or not

Definition at line 204 of file MultiDimParamFunctionAdapter.h.

◆ ~MultiDimParamGradFunctionAdapter()

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

Destructor (no operations)

Definition at line 217 of file MultiDimParamFunctionAdapter.h.

Member Function Documentation

◆ Clone()

virtual BaseFunc * ROOT::Math::MultiDimParamGradFunctionAdapter::Clone ( ) const
inlinevirtual

◆ DoEvalPar()

double ROOT::Math::MultiDimParamGradFunctionAdapter::DoEvalPar ( const double *  x,
const double *  p 
) const
inlineprivate

functions needed by interface

Definition at line 283 of file MultiDimParamFunctionAdapter.h.

◆ DoParameterDerivative()

double ROOT::Math::MultiDimParamGradFunctionAdapter::DoParameterDerivative ( const double *  x,
const double *  p,
unsigned int  ipar 
) const
inlineprivate

Definition at line 292 of file MultiDimParamFunctionAdapter.h.

◆ NDim()

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

Retrieve the dimension of the function.

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

Definition at line 264 of file MultiDimParamFunctionAdapter.h.

◆ NPar()

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

Return the number of Parameters.

Implements ROOT::Math::IBaseParam.

Definition at line 259 of file MultiDimParamFunctionAdapter.h.

◆ operator=()

MultiDimParamGradFunctionAdapter & ROOT::Math::MultiDimParamGradFunctionAdapter::operator= ( const MultiDimParamGradFunctionAdapter rhs)
inline

Assignment operator.

Definition at line 226 of file MultiDimParamFunctionAdapter.h.

◆ ParameterGradient()

void ROOT::Math::MultiDimParamGradFunctionAdapter::ParameterGradient ( const double *  x,
const double *  p,
double *  grad 
) const
inline

Definition at line 273 of file MultiDimParamFunctionAdapter.h.

◆ Parameters()

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

Access the parameter values.

Implements ROOT::Math::IBaseParam.

Definition at line 249 of file MultiDimParamFunctionAdapter.h.

◆ SetParameters()

void ROOT::Math::MultiDimParamGradFunctionAdapter::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 254 of file MultiDimParamFunctionAdapter.h.

Member Data Documentation

◆ fFunc

IParamGradFunction* ROOT::Math::MultiDimParamGradFunctionAdapter::fFunc
private

Definition at line 300 of file MultiDimParamFunctionAdapter.h.

◆ fOwn

bool ROOT::Math::MultiDimParamGradFunctionAdapter::fOwn
private

Definition at line 299 of file MultiDimParamFunctionAdapter.h.

Libraries for ROOT::Math::MultiDimParamGradFunctionAdapter:
[legend]

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