Optimization::MinBrent Function

Overload List

#SignatureDescription
1int MinBrent(double ax, double bx, TRealFunction Func, const TMtxFloatPrecision FloatPrecision, const DewArray<double> &Consts, const DewArray<tObject *> &ObjConst, double &MinX, int MaxIter, double Accuracy = 1.0E-8, tStrings *Verbose = null);Minimizes single variable function.
2int MinBrent(double ax, double bx, TRealFunction Func, const TMtxFloatPrecision FloatPrecision, const DewArray<double> &Consts, const DewArray<tObject *> &ObjConst, double &MinX);Minimizes single variable function by using default settings and no log.

Overload 1: int MinBrent(double ax, double bx, TRealFunction Func, const TMtxFloatPrecision FloatPrecision, const DewArray<double> &Consts, const DewArray<tObject *> &ObjConst, double &MinX, int MaxIter, double Accuracy = 1.0E-8, tStrings *Verbose = null);

Minimizes single variable function.

#NameTypeDescription
1axdoubleDefines initial lower limit for minimum search.
2bxdoubleDefines initial upper limit for minimum search.
3FuncTRealFunctionReal function of single variable (must be of TRealFunction type) to be minimized.
4FloatPrecisionconst TMtxFloatPrecisionSpecifies the floating point precision to be used by the routine.
5Constsconst DewArray<double> &Additional Fun constant parameters (can be/is usually nil).
6ObjConstconst DewArray<tObject *> &Additional Fun constant parameters (can be/is usually nil).
7MinXdouble &Returns the position of function minimum.
8MaxIterintMaximum allowed numer of minimum search iterations.
9Accuracy = 1.0E-8doubleDesired minimum position tolerance.
10Verbose = nulltStrings *If assigned, stores Func, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

Returns: the number of iterations required to reach the solution(minimum) within given tolerance.

Remarks:

What it computes. Locates a local minimizer x^* of a
real function of one variable on the bracket [a_x,b_x] using Brent's method (golden-section search refined by parabolic interpolation; the modified algol-60 localmin). For the example objective

y(x) = sin(x) + (x+2)^2

Domain. a_x,b_x are finite reals; if b_x < a_x they
are swapped internally, so the order of the bracket does not matter. MaxIter > 0 caps the iterations; Accuracy ≥ 0 is the desired position tolerance.

Defined behaviour. Returns the iteration count and writes the
minimizer to MinX; it converges to a stationary point inside the bracket. MinBrent has no stop-reason output: if Func returns NaN the NaN propagates into MinX (and is reported in Verbose when assigned). The bracket is assumed to contain a minimum; for a monotone objective the result is the corresponding endpoint.

Minimizes the function of one variable. This routine uses slightly modified version of the algol 60 procedure localmin, introduced by Richard Brent.

See Also: TRealFunction
Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler

Overload 2: int MinBrent(double ax, double bx, TRealFunction Func, const TMtxFloatPrecision FloatPrecision, const DewArray<double> &Consts, const DewArray<tObject *> &ObjConst, double &MinX);

Minimizes single variable function by using default settings and no log.

#NameTypeDescription
1axdouble
2bxdouble
3FuncTRealFunction
4FloatPrecisionconst TMtxFloatPrecision
5Constsconst DewArray<double> &
6ObjConstconst DewArray<tObject *> &
7MinXdouble &
Remarks:

Use this version if algorithm step logs are not needed.

Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler