BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Math::WrappedMultiFunction< Func > Class Template Reference

Description

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 154 of file WrappedFunction.h.

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

Public Types

typedef T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

 WrappedMultiFunction (Func f, unsigned int dim=1)
 
WrappedMultiFunctionClone () const
 clone (required by the interface) More...
 
unsigned int NDim () const
 
operator() (const T *x) const
 

Private Member Functions

virtual double DoEval (const double *x) const
 

Private Attributes

unsigned int fDim
 
Func fFunc
 

Member Typedef Documentation

◆ BackendType

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

Definition at line 66 of file IFunction.h.

◆ BaseFunc

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

Definition at line 67 of file IFunction.h.

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 162 of file WrappedFunction.h.

162  :
163  fFunc( f ),
164  fDim( dim)
165  { /* no op */ }

Referenced by ROOT::Math::WrappedMultiFunction< Func >::Clone().

Member Function Documentation

◆ Clone()

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

clone (required by the interface)

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

Definition at line 170 of file WrappedFunction.h.

170  {
171  return new WrappedMultiFunction(fFunc,fDim);
172  }
WrappedMultiFunction(Func f, unsigned int dim=1)

References ROOT::Math::WrappedMultiFunction< Func >::WrappedMultiFunction(), ROOT::Math::WrappedMultiFunction< Func >::fDim, and ROOT::Math::WrappedMultiFunction< Func >::fFunc.

Here is the call graph for this function:

◆ DoEval()

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

Definition at line 180 of file WrappedFunction.h.

180  {
181  return fFunc( x );
182  }

References ROOT::Math::WrappedMultiFunction< Func >::fFunc.

◆ NDim()

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

Retrieve the dimension of the function

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

Definition at line 174 of file WrappedFunction.h.

174 { return fDim; }

References ROOT::Math::WrappedMultiFunction< Func >::fDim.

◆ 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 92 of file IFunction.h.

93  {
94  return DoEval(x);
95  }
virtual T DoEval(const T *x) const =0

References ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval().

Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().

Here is the call graph for this function:

Member Data Documentation

◆ fDim

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

◆ fFunc

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

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