Logo ROOT  
Reference Guide
No Matches
ROOT::Math::MultiDimParamFunctionAdapter Class Reference

MultiDimParamFunctionAdapter class to wrap a one-dimensional parametric function in a multi dimensional parametric function interface This is used typically in fitting where internally the function is stored as multidimensional.

To wrap a non-parametric one-dim function in a multi-dim interface one can use simply a ROOT::Math::WrappedFunction<ROOT::Math::IGenFunction> or ROOT::Math::Functor and ROOT::Math::GradFunctor for gradient functions

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 41 of file MultiDimParamFunctionAdapter.h.

Public Types

typedef IParamMultiFunction::BaseFunc BaseFunc
- 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

Public Member Functions

 MultiDimParamFunctionAdapter (const IParamFunction &f)
 Constructor from a parametric one dim function interface from a const reference Own the function in this case.
 MultiDimParamFunctionAdapter (const MultiDimParamFunctionAdapter &rhs)
 Copy constructor.
 MultiDimParamFunctionAdapter (IParamFunction &f)
 Constructor from a parametric one dim function interface from a non-const reference Do not own the function in this case.
 ~MultiDimParamFunctionAdapter () override
 Destructor (no operations)
BaseFuncClone () const override
unsigned int NDim () const override
 Retrieve the dimension of the function.
unsigned int NPar () const override
 Return the number of Parameters.
MultiDimParamFunctionAdapteroperator= (const MultiDimParamFunctionAdapter &rhs)
 Assignment operator.
const doubleParameters () const override
 Access the parameter values.
void SetParameters (const double *p) override
 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 >
virtual ~IBaseFunctionMultiDimTempl ()=default
virtual bool HasGradient () const
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

double DoEvalPar (const double *x, const double *p) const override
 needed by the interface

Private Attributes

bool fOwn

#include <Math/MultiDimParamFunctionAdapter.h>

Inheritance diagram for ROOT::Math::MultiDimParamFunctionAdapter:

Member Typedef Documentation

◆ BaseFunc

Constructor & Destructor Documentation

◆ MultiDimParamFunctionAdapter() [1/3]

ROOT::Math::MultiDimParamFunctionAdapter::MultiDimParamFunctionAdapter ( const IParamFunction f)

Constructor from a parametric one dim function interface from a const reference Own the function in this case.

Definition at line 52 of file MultiDimParamFunctionAdapter.h.

◆ MultiDimParamFunctionAdapter() [2/3]

ROOT::Math::MultiDimParamFunctionAdapter::MultiDimParamFunctionAdapter ( IParamFunction f)

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

Definition at line 62 of file MultiDimParamFunctionAdapter.h.

◆ MultiDimParamFunctionAdapter() [3/3]

ROOT::Math::MultiDimParamFunctionAdapter::MultiDimParamFunctionAdapter ( const MultiDimParamFunctionAdapter rhs)

Copy constructor.

Different behaviour according if function is owned or not

Definition at line 71 of file MultiDimParamFunctionAdapter.h.

◆ ~MultiDimParamFunctionAdapter()

ROOT::Math::MultiDimParamFunctionAdapter::~MultiDimParamFunctionAdapter ( )

Destructor (no operations)

Definition at line 84 of file MultiDimParamFunctionAdapter.h.

Member Function Documentation

◆ Clone()

BaseFunc * ROOT::Math::MultiDimParamFunctionAdapter::Clone ( ) const

◆ DoEvalPar()

double ROOT::Math::MultiDimParamFunctionAdapter::DoEvalPar ( const double x,
const double p 
) const

needed by the interface

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

Definition at line 140 of file MultiDimParamFunctionAdapter.h.

◆ NDim()

unsigned int ROOT::Math::MultiDimParamFunctionAdapter::NDim ( ) const

Retrieve the dimension of the function.

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

Definition at line 131 of file MultiDimParamFunctionAdapter.h.

◆ NPar()

unsigned int ROOT::Math::MultiDimParamFunctionAdapter::NPar ( ) const

Return the number of Parameters.

Implements ROOT::Math::IBaseParam.

Definition at line 126 of file MultiDimParamFunctionAdapter.h.

◆ operator=()

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

Assignment operator.

Definition at line 93 of file MultiDimParamFunctionAdapter.h.

◆ Parameters()

const double * ROOT::Math::MultiDimParamFunctionAdapter::Parameters ( ) const

Access the parameter values.

Implements ROOT::Math::IBaseParam.

Definition at line 116 of file MultiDimParamFunctionAdapter.h.

◆ SetParameters()

void ROOT::Math::MultiDimParamFunctionAdapter::SetParameters ( const double p)

Set the parameter values.

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 121 of file MultiDimParamFunctionAdapter.h.

Member Data Documentation

◆ fFunc

IParamFunction* ROOT::Math::MultiDimParamFunctionAdapter::fFunc

Definition at line 149 of file MultiDimParamFunctionAdapter.h.

◆ fOwn

bool ROOT::Math::MultiDimParamFunctionAdapter::fOwn

Definition at line 148 of file MultiDimParamFunctionAdapter.h.

Libraries for ROOT::Math::MultiDimParamFunctionAdapter:

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