Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr > Class Template Reference

template<typename FuncObj, typename MemFuncPtr>
class ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >

Definition at line 182 of file WrappedFunction.h.

Public Types

typedefBackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 WrappedMemMultiFunction (FuncObj &obj, MemFuncPtr memFn, unsigned int dim=1)
 construct from the pointer to the object and the member function
 
WrappedMemMultiFunctionClone () const override
 clone (required by the interface)
 
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 bool HasGradient () const
 
unsigned int NDim () const override
 Retrieve the dimension of the function.
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 

Private Member Functions

virtualDoDerivative (const T *, unsigned int) const
 Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class.
 
virtualDoDerivativeWithPrevResult (const T *x, unsigned int icoord, T *, T *, T *) const
 In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
 
double DoEval (const double *x) const override
 

Private Attributes

unsigned int fDim
 
MemFuncPtr fMemFunc
 
FuncObjfObj
 

#include <Math/WrappedFunction.h>

Inheritance diagram for ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >:
ROOT::Math::IBaseFunctionMultiDimTempl< T >

Member Typedef Documentation

◆ BackendType

template<class T >
typedef T ROOT::Math::IBaseFunctionMultiDimTempl< T >::BackendType
inherited

Definition at line 67 of file IFunction.h.

◆ BaseFunc

Definition at line 68 of file IFunction.h.

Constructor & Destructor Documentation

◆ WrappedMemMultiFunction()

template<typename FuncObj , typename MemFuncPtr >
ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::WrappedMemMultiFunction ( FuncObj & obj,
MemFuncPtr memFn,
unsigned int dim = 1 )
inline

construct from the pointer to the object and the member function

Definition at line 190 of file WrappedFunction.h.

Member Function Documentation

◆ Clone()

template<typename FuncObj , typename MemFuncPtr >
WrappedMemMultiFunction * ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::Clone ( ) const
inlineoverridevirtual

clone (required by the interface)

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

Definition at line 199 of file WrappedFunction.h.

◆ Derivative() [1/2]

template<class T >
T ROOT::Math::IBaseFunctionMultiDimTempl< T >::Derivative ( const T * x,
unsigned int icoord,
T * previous_grad,
T * previous_g2,
T * previous_gstep ) const
inlineinherited

In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.

The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.

Definition at line 120 of file IFunction.h.

◆ Derivative() [2/2]

template<class T >
T ROOT::Math::IBaseFunctionMultiDimTempl< T >::Derivative ( const T * x,
unsigned int icoord = 0 ) const
inlineinherited

Return the partial derivative with respect to the passed coordinate.

Definition at line 115 of file IFunction.h.

◆ DoDerivative()

template<class T >
virtual T ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoDerivative ( const T * ,
unsigned int  ) const
inlineprivatevirtualinherited

Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class.

Definition at line 131 of file IFunction.h.

◆ DoDerivativeWithPrevResult()

template<class T >
virtual T ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoDerivativeWithPrevResult ( const T * x,
unsigned int icoord,
T * ,
T * ,
T *  ) const
inlineprivatevirtualinherited

In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.

The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.

Definition at line 136 of file IFunction.h.

◆ DoEval()

template<typename FuncObj , typename MemFuncPtr >
double ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::DoEval ( const double * x) const
inlineoverrideprivate

Definition at line 208 of file WrappedFunction.h.

◆ FdF()

template<class T >
virtual void ROOT::Math::IBaseFunctionMultiDimTempl< T >::FdF ( const T * x,
T & f,
T * df ) const
inlinevirtualinherited

Optimized method to evaluate at the same time the function value and derivative at a point x.

Often both value and derivatives are needed and it is often more efficient to compute them at the same time. Derived class should implement this method if performances play an important role and if it is faster to evaluate value and derivative at the same time

Definition at line 108 of file IFunction.h.

◆ Gradient()

template<class T >
virtual void ROOT::Math::IBaseFunctionMultiDimTempl< T >::Gradient ( const T * x,
T * grad ) const
inlinevirtualinherited

Evaluate all the vector of function derivatives (gradient) at a point x.

Derived classes must re-implement it if more efficient than evaluating one at a time

Definition at line 96 of file IFunction.h.

◆ HasGradient()

template<class T >
virtual bool ROOT::Math::IBaseFunctionMultiDimTempl< T >::HasGradient ( ) const
inlinevirtualinherited

Reimplemented in ROOT::Math::IGradientFunctionMultiDimTempl< T >.

Definition at line 92 of file IFunction.h.

◆ NDim()

template<typename FuncObj , typename MemFuncPtr >
unsigned int ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::NDim ( ) const
inlineoverridevirtual

Retrieve the dimension of the function.

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

Definition at line 204 of file WrappedFunction.h.

◆ operator()()

template<class T >
T ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator() ( const T * x) const
inlineinherited

Evaluate the function at a point x[].

Use the pure virtual private method DoEval which must be implemented by the sub-classes.

Definition at line 81 of file IFunction.h.

Member Data Documentation

◆ fDim

template<typename FuncObj , typename MemFuncPtr >
unsigned int ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::fDim
private

Definition at line 215 of file WrappedFunction.h.

◆ fMemFunc

template<typename FuncObj , typename MemFuncPtr >
MemFuncPtr ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::fMemFunc
private

Definition at line 214 of file WrappedFunction.h.

◆ fObj

template<typename FuncObj , typename MemFuncPtr >
FuncObj* ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >::fObj
private

Definition at line 213 of file WrappedFunction.h.


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