Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::WrappedMultiFunction< Func > Class Template Reference

template<typename Func = FreeMultiFunctionPtr>
class ROOT::Math::WrappedMultiFunction< Func >

Template class to wrap any C++ callable object implementing operator() (const double * x) in a multi-dimensional function interface.

It provides a ROOT::Math::IGenMultiFunction-like signature

Note: If you want to wrap just the reference (to avoid copying) you need to use Func& or const Func & as template parameter. The former should be used when the operator() is not a const method of Func

Definition at line 143 of file WrappedFunction.h.

Public Member Functions

 WrappedMultiFunction (Func f, unsigned int dim=1)
 construct from the pointer to the object and the member function
 
WrappedMultiFunctionClone () const override
 clone (required by the interface)
 
unsigned int NDim () const override
 Retrieve the dimension of the function.
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
virtual ~IBaseFunctionMultiDimTempl ()=default
 
Derivative (const T *x, unsigned int icoord, T *previous_grad, T *previous_g2, T *previous_gstep) const
 In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
 
Derivative (const T *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate.
 
virtual void FdF (const T *x, T &f, T *df) const
 Optimized method to evaluate at the same time the function value and derivative at a point x.
 
virtual void Gradient (const T *x, T *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x.
 
virtual void GradientWithPrevResult (const T *x, T *grad, T *previous_grad, T *previous_g2, T *previous_gstep) const
 In some cases, the gradient algorithm will use information from the previous step, these can be passed in with this overload.
 
virtual bool HasGradient () const
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 
virtual bool returnsInMinuit2ParameterSpace () const
 

Private Member Functions

double DoEval (const double *x) const override
 

Private Attributes

unsigned int fDim
 
Func fFunc
 

Additional Inherited Members

- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedefBackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

#include <Math/WrappedFunction.h>

Inheritance diagram for ROOT::Math::WrappedMultiFunction< Func >:
[legend]

Constructor & Destructor Documentation

◆ WrappedMultiFunction()

template<typename Func = FreeMultiFunctionPtr>
ROOT::Math::WrappedMultiFunction< Func >::WrappedMultiFunction ( Func f,
unsigned int dim = 1 )
inline

construct from the pointer to the object and the member function

Definition at line 151 of file WrappedFunction.h.

Member Function Documentation

◆ Clone()

template<typename Func = FreeMultiFunctionPtr>
WrappedMultiFunction * ROOT::Math::WrappedMultiFunction< Func >::Clone ( ) const
inlineoverridevirtual

clone (required by the interface)

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

Definition at line 159 of file WrappedFunction.h.

◆ DoEval()

template<typename Func = FreeMultiFunctionPtr>
double ROOT::Math::WrappedMultiFunction< Func >::DoEval ( const double * x) const
inlineoverrideprivate

Definition at line 169 of file WrappedFunction.h.

◆ NDim()

template<typename Func = FreeMultiFunctionPtr>
unsigned int ROOT::Math::WrappedMultiFunction< Func >::NDim ( ) const
inlineoverridevirtual

Retrieve the dimension of the function.

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

Definition at line 163 of file WrappedFunction.h.

Member Data Documentation

◆ fDim

template<typename Func = FreeMultiFunctionPtr>
unsigned int ROOT::Math::WrappedMultiFunction< Func >::fDim
private

Definition at line 175 of file WrappedFunction.h.

◆ fFunc

template<typename Func = FreeMultiFunctionPtr>
Func ROOT::Math::WrappedMultiFunction< Func >::fFunc
private

Definition at line 174 of file WrappedFunction.h.

  • math/mathcore/inc/Math/WrappedFunction.h