BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
GradFunctor class for Multidimensional gradient functions. It is used to wrap in a very C++ callable object to make gradient functions. It can be constructed in three different way:
The function dimension is required when constructing the functor.
Public Types | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
typedef IGradientMultiDimTempl< T > | BaseGrad |
typedef FunctorImpl< IGradientFunctionMultiDim > | Impl |
typedef IGradientFunctionMultiDim::BaseFunc | ImplBase |
Public Member Functions | |
GradFunctor () | |
template<typename Func , typename GradFunc > | |
GradFunctor (const Func &f, const GradFunc &g, int dim) | |
template<typename Func > | |
GradFunctor (const Func &f, unsigned int dim) | |
GradFunctor (const GradFunctor &rhs) | |
template<class PtrObj , typename MemFn , typename GradMemFn > | |
GradFunctor (const PtrObj &p, MemFn memFn, GradMemFn gradFn, unsigned int dim) | |
virtual | ~GradFunctor () |
ImplBase * | Clone () const |
T | Derivative (const T *x, unsigned int icoord=0) const |
virtual void | FdF (const T *x, T &f, T *df) const |
virtual void | Gradient (const T *x, T *grad) const |
unsigned int | NDim () const |
virtual unsigned int | NDim () const=0 |
T | operator() (const T *x) const |
GradFunctor & | operator= (const GradFunctor &rhs) |
Private Member Functions | |
double | DoDerivative (const double *x, unsigned int icoord) const |
double | DoEval (const double *x) const |
Private Attributes | |
std::unique_ptr< Impl > | fImpl |
|
inherited |
Definition at line 66 of file IFunction.h.
|
inherited |
Definition at line 330 of file IFunction.h.
|
inherited |
Definition at line 331 of file IFunction.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
Copy constructor for functor based on ROOT::Math::IMultiGradFunction
Definition at line 629 of file Functor.h.
References fImpl.
|
inlinevirtual |
Clone a function. Each derived class must implement their version of the Clone method
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 647 of file Functor.h.
References GradFunctor().
|
inlineinherited |
Return the partial derivative with respect to the passed coordinate
Definition at line 217 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::DoDerivative().
Referenced by ROOT::Math::MinimTransformFunction::DoDerivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient().
|
inlineprivate |
|
inlineprivate |
|
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
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 357 of file IFunction.h.
References ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), and ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator()().
|
inlinevirtualinherited |
Evaluate all the vector of function derivatives (gradient) at a point x. Derived classes must re-implement it if more efficient than evaluting one at a time
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 342 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::Derivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::NDim().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inlinevirtual |
Retrieve the dimension of the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 650 of file Functor.h.
References fImpl.
|
inherited |
Retrieve the dimension of the function
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), ROOT::Math::MinimTransformFunction::NTot(), and ROOT::Math::GSLMultiMinimizer::Set().
|
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.
References ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inline |
|
private |
Definition at line 664 of file Functor.h.
Referenced by GradFunctor(), DoDerivative(), DoEval(), NDim(), and operator=().