MultiNumGradFunction class to wrap a normal function in a gradient function using numerical gradient calculation provided by the class Derivator (based on GSL numerical derivation)
Definition at line 49 of file MultiNumGradFunction.h.
|
| | MultiNumGradFunction (const IMultiGenFunction &f) |
| | Constructor from a IMultiGenFunction interface.
|
| |
| template<class FuncType > |
| | MultiNumGradFunction (FuncType f, int n) |
| | Constructor from a generic function (pointer or reference) and number of dimension implementing operator () (double * x)
|
| |
| | ~MultiNumGradFunction () override |
| | Destructor (no operations)
|
| |
| IMultiGenFunction * | Clone () const override |
| | Clone a function.
|
| |
| T | 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.
|
| |
| T | 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.
|
| |
| bool | HasGradient () const override |
| |
| unsigned int | NCalls () const |
| |
| unsigned int | NDim () const override |
| | Retrieve the dimension of the function.
|
| |
| T | operator() (const T *x) const |
| | Evaluate the function at a point x[].
|
| |
| void | SetOwnership (bool on=true) |
| |
#include <Math/MultiNumGradFunction.h>
◆ BackendType
◆ BaseFunc
◆ MultiNumGradFunction() [1/2]
| ROOT::Math::MultiNumGradFunction::MultiNumGradFunction |
( |
const IMultiGenFunction & | f | ) |
|
|
inline |
◆ MultiNumGradFunction() [2/2]
template<class FuncType >
| ROOT::Math::MultiNumGradFunction::MultiNumGradFunction |
( |
FuncType | f, |
|
|
int | n ) |
|
inline |
Constructor from a generic function (pointer or reference) and number of dimension implementing operator () (double * x)
Definition at line 70 of file MultiNumGradFunction.h.
◆ ~MultiNumGradFunction()
| ROOT::Math::MultiNumGradFunction::~MultiNumGradFunction |
( |
| ) |
|
|
inlineoverride |
◆ Clone()
◆ Derivative() [1/2]
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]
Return the partial derivative with respect to the passed coordinate.
Definition at line 115 of file IFunction.h.
◆ DoDerivative()
| double ROOT::Math::MultiNumGradFunction::DoDerivative |
( |
const double * | x, |
|
|
unsigned int | icoord ) const |
|
overrideprivate |
◆ DoDerivativeWithPrevResult()
template<class T >
|
|
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()
| double ROOT::Math::MultiNumGradFunction::DoEval |
( |
const double * | x | ) |
const |
|
inlineoverrideprivate |
◆ FdF()
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.
◆ GetDerivPrecision()
| double ROOT::Math::MultiNumGradFunction::GetDerivPrecision |
( |
| ) |
|
|
static |
◆ Gradient()
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 >
|
|
inlineoverridevirtualinherited |
◆ NCalls()
| unsigned int ROOT::Math::MultiNumGradFunction::NCalls |
( |
| ) |
const |
|
inline |
◆ NDim()
| unsigned int ROOT::Math::MultiNumGradFunction::NDim |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ operator()()
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.
◆ SetDerivPrecision()
| void ROOT::Math::MultiNumGradFunction::SetDerivPrecision |
( |
double | eps | ) |
|
|
static |
precision value used for calculating the derivative step-size h = eps * |x|.
The default is 0.001, give a smaller in case function chanes rapidly
Definition at line 54 of file MultiNumGradFunction.cxx.
◆ SetOwnership()
| void ROOT::Math::MultiNumGradFunction::SetOwnership |
( |
bool | on = true | ) |
|
|
inline |
◆ fDim
| unsigned int ROOT::Math::MultiNumGradFunction::fDim |
|
private |
◆ fFunc
◆ fgEps
| double ROOT::Math::MultiNumGradFunction::fgEps = 0.001 |
|
staticprivate |
◆ fNCalls
| unsigned int ROOT::Math::MultiNumGradFunction::fNCalls |
|
mutableprivate |
◆ fOwner
| bool ROOT::Math::MultiNumGradFunction::fOwner |
|
private |