void NumericGradRichardson(TRealFunction Fun, TVec *Pars, TVec *Consts, const DewArray<tObject *> &ObjConst, TVec *Grad);
Numerical gradient by high precision numerical differentiation.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Fun | TRealFunction | Real function of several variables. |
| 2 | Pars | TVec * | Function variables. |
| 3 | Consts | TVec * | Array of additional constants which can be used in math formula. |
| 4 | ObjConst | const DewArray<tObject *> & | Array of additional constants (pointers) which can be used in math formula. |
| 5 | Grad | TVec * | Returns calculated gradient. If needed, Grad Length and Complex properties are adjusted automatically. |
Remarks:
Calculates the numerical gradient by high precision numerical differentiation. The algorithm uses Richardson extrapolation of three values of the symmetric difference quotient. The gradient step size is defined by GradStepSize global variable. Normally the optimal stepsize depends on seventh partial derivatives of the function. Since they are not available, the initial value for GradientStepSize is Exp(Ln(EPS)/7)*0.25, as suggested by Spellucci.
Declared in Dew::Math::Units::MtxIntDiff · Dew.Math/Units.MtxIntDiff.h · Cross-compiler