BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Interface (abstract class) for multi-dimensional functions providing a gradient calculation. It implements both the ROOT::Math::IBaseFunctionMultiDimTempl and ROOT::Math::IGradientMultiDimTempl interfaces. The method ROOT::Math::IFunction::Gradient calculates the full gradient vector, ROOT::Math::IFunction::Derivative calculates the partial derivative for each coordinate and ROOT::Math::Fdf calculates the gradient and the function value at the same time. The pure private virtual method DoDerivative() must be implemented by the derived classes, while Gradient and FdF are by default implemented using DoDerivative, butthey can be overloaded by the derived classes to improve the efficiency in the derivative calculation.
Definition at line 326 of file IFunction.h.
Public Types | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
typedef IGradientMultiDimTempl< T > | BaseGrad |
Public Member Functions | |
virtual | ~IGradientFunctionMultiDimTempl () |
virtual IBaseFunctionMultiDimTempl< T > * | Clone () const =0 |
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 |
virtual unsigned int | NDim () const =0 |
virtual unsigned int | NDim () const=0 |
T | operator() (const T *x) const |
Private Member Functions | |
virtual T | DoDerivative (const T *x, unsigned int icoord) const =0 |
virtual T | DoEval (const T *x) const =0 |
|
inherited |
Definition at line 66 of file IFunction.h.
typedef IBaseFunctionMultiDimTempl<T> ROOT::Math::IGradientFunctionMultiDimTempl< T >::BaseFunc |
Definition at line 330 of file IFunction.h.
typedef IGradientMultiDimTempl<T> ROOT::Math::IGradientFunctionMultiDimTempl< T >::BaseGrad |
Definition at line 331 of file IFunction.h.
|
inlinevirtual |
|
pure virtualinherited |
Clone a function. Each derived class must implement their version of the Clone method
Implemented in ROOT::Math::WrappedParamFunctionGen< FuncPtr >, ROOT::Math::WrappedParamFunction< FuncPtr >, ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >, ROOT::Math::WrappedMultiFunction< Func >, ROOT::Math::MultiNumGradFunction, ROOT::Math::MinimTransformFunction, ROOT::Math::LSResidualFunc, ROOT::Math::GradFunctor, ROOT::Math::Functor, and ROOT::Fit::FcnAdapter.
Referenced by ROOT::Math::MultiNumGradFunction::Clone().
|
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().
|
privatepure virtualinherited |
function to evaluate the derivative with respect each coordinate. To be implemented by the derived class
Referenced by ROOT::Math::IGradientMultiDimTempl< T >::Derivative().
|
privatepure virtualinherited |
Implementation of the evaluation function. Must be implemented by derived classes
Implemented in ROOT::Math::IParametricGradFunctionMultiDimTempl< T >, and ROOT::Math::IParametricFunctionMultiDimTempl< T >.
Referenced by ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator()().
|
inlinevirtual |
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()().
|
inlinevirtual |
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().
|
pure virtualinherited |
Retrieve the dimension of the function
Implemented in ROOT::Math::WrappedParamFunctionGen< FuncPtr >, ROOT::Math::WrappedParamFunction< FuncPtr >, ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >, ROOT::Math::WrappedMultiFunction< Func >, ROOT::Math::MultiNumGradFunction, ROOT::Math::MinimTransformFunction, ROOT::Math::LSResidualFunc, ROOT::Math::GradFunctor, ROOT::Math::Functor, and ROOT::Fit::FcnAdapter.
virtual unsigned int ROOT::Math::IBaseFunctionMultiDimTempl< T >::NDim |
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().