brmin, brmid, brmax, numevals] = minbrack(f, a, b, fa)
finds a bracket of three points around a local minimum of
f
. The function f
must have a one dimensional domain.
a < b
is an initial guess at the minimum and maximum points
of a bracket, but minbrack
will search outside this interval if
necessary. The bracket consists of three points (in increasing order)
such that f(brmid) < f(brmin)
and f(brmid) < f(brmax)
.
fa
is the value of the function at a
: it is included to
avoid unnecessary function evaluations in the optimization routines.
The return value numevals
is the number of function evaluations
in minbrack
.
minbrack(f, a, b, fa, p1, p2, ...)
allows additional
arguments to be passed to f
f
in the direction sd
can be found in linemin
[min, mid, max, nevals]] = minbrack('linef', 0.0, 1.0, fa, f, pt, dir);where the function
linef
is used to turn a general function f
into a one dimensional one.
linemin
, linef
Copyright (c) Ian T Nabney (1996-9)