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::FunctorGradHandler< ParentFunctor, Func, GradFunc > Class Template Reference

Description

template<class ParentFunctor, class Func, class GradFunc>
class ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >

Functor Handler class for gradient functions where both callable objects are provided for the function evaluation (type Func) and for the gradient (type GradFunc) . It can be created from any function implementing the correct signature corresponding to the requested type In the case of one dimension the function evaluation object and the derivative function object must implement double operator() (double x). In the case of multi-dimension the function evaluation object must implement double operator() (const double * x) and the gradient function object must implement double operator() (const double * x, int icoord)

Definition at line 152 of file Functor.h.

Inheritance diagram for ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >:
[legend]
Collaboration diagram for ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >:
[legend]

Public Member Functions

 FunctorGradHandler (const Func &fun, const GradFunc &gfun)
 
 FunctorGradHandler (unsigned int dim, const Func &fun, const GradFunc &gfun)
 
virtual ~FunctorGradHandler ()
 
BaseFuncClone () const
 
ImplFuncCopy () const
 
unsigned int NDim () const
 

Private Types

typedef ImplFunc::BaseFunc BaseFunc
 
typedef ParentFunctor::Impl ImplFunc
 

Private Member Functions

double DoDerivative (const double *x, unsigned int icoord) const
 
double DoDerivative (double x) const
 
double DoEval (const double *x) const
 
double DoEval (double x) const
 

Private Attributes

unsigned int fDim
 
Func fFunc
 
GradFunc fGradFunc
 

Member Typedef Documentation

◆ BaseFunc

template<class ParentFunctor , class Func , class GradFunc >
typedef ImplFunc::BaseFunc ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::BaseFunc
private

Definition at line 155 of file Functor.h.

◆ ImplFunc

template<class ParentFunctor , class Func , class GradFunc >
typedef ParentFunctor::Impl ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::ImplFunc
private

Definition at line 154 of file Functor.h.

Constructor & Destructor Documentation

◆ FunctorGradHandler() [1/2]

template<class ParentFunctor , class Func , class GradFunc >
ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::FunctorGradHandler ( const Func &  fun,
const GradFunc &  gfun 
)
inline

Definition at line 161 of file Functor.h.

161  :
162  fDim(1),
163  fFunc(fun),
164  fGradFunc(gfun)
165  {}

Referenced by ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::Copy().

◆ FunctorGradHandler() [2/2]

template<class ParentFunctor , class Func , class GradFunc >
ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::FunctorGradHandler ( unsigned int  dim,
const Func &  fun,
const GradFunc &  gfun 
)
inline

Definition at line 169 of file Functor.h.

169  :
170  fDim(dim),
171  fFunc(fun),
172  fGradFunc( gfun )
173  {}

◆ ~FunctorGradHandler()

template<class ParentFunctor , class Func , class GradFunc >
virtual ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::~FunctorGradHandler ( )
inlinevirtual

Definition at line 175 of file Functor.h.

175 {}

Member Function Documentation

◆ Clone()

template<class ParentFunctor , class Func , class GradFunc >
BaseFunc* ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::Clone ( ) const
inline

Definition at line 181 of file Functor.h.

181 { return Copy(); }
ImplFunc * Copy() const
Definition: Functor.h:178

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::Copy().

Here is the call graph for this function:

◆ Copy()

template<class ParentFunctor , class Func , class GradFunc >
ImplFunc* ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::Copy ( ) const
inline

Definition at line 178 of file Functor.h.

178 { return new FunctorGradHandler(*this); }
FunctorGradHandler(const Func &fun, const GradFunc &gfun)
Definition: Functor.h:161

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::FunctorGradHandler().

Referenced by ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::Clone().

Here is the call graph for this function:

◆ DoDerivative() [1/2]

template<class ParentFunctor , class Func , class GradFunc >
double ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::DoDerivative ( const double *  x,
unsigned int  icoord 
) const
inlineprivate

Definition at line 202 of file Functor.h.

202  {
203  return fGradFunc(x, icoord);
204  }

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fGradFunc.

◆ DoDerivative() [2/2]

template<class ParentFunctor , class Func , class GradFunc >
double ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::DoDerivative ( double  x) const
inlineprivate

Definition at line 198 of file Functor.h.

198  {
199  return fGradFunc(x);
200  }

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fGradFunc.

◆ DoEval() [1/2]

template<class ParentFunctor , class Func , class GradFunc >
double ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::DoEval ( const double *  x) const
inlineprivate

Definition at line 194 of file Functor.h.

194  {
195  return fFunc(x);
196  }

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fFunc.

◆ DoEval() [2/2]

template<class ParentFunctor , class Func , class GradFunc >
double ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::DoEval ( double  x) const
inlineprivate

Definition at line 190 of file Functor.h.

190  {
191  return fFunc(x);
192  }

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fFunc.

◆ NDim()

template<class ParentFunctor , class Func , class GradFunc >
unsigned int ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::NDim ( ) const
inline

Definition at line 184 of file Functor.h.

184  {
185  return fDim;
186  }

References ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fDim.

Member Data Documentation

◆ fDim

template<class ParentFunctor , class Func , class GradFunc >
unsigned int ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fDim
private

◆ fFunc

template<class ParentFunctor , class Func , class GradFunc >
Func ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fFunc
mutableprivate

◆ fGradFunc

template<class ParentFunctor , class Func , class GradFunc >
GradFunc ROOT::Math::FunctorGradHandler< ParentFunctor, Func, GradFunc >::fGradFunc
mutableprivate

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