**26.1**** ****Bracketing a
Minimum** (.NET, C#, CSharp, VB, Visual Basic, F#)

Minima of univariate
functions must be *bracketed* before
they can be isolated. A bracket is a triplet of points, *x** _{lower}* <

*x*

*<*

_{interior}*x*

*, such that*

_{upper}*f(x*

_{interior}*)*<

*f(x*

_{lower}*)*and

*f(x*

_{interior}*)*<

*f(x*

_{upper}*)*. These conditions ensure that there is some local minimum in the interval (

*x*

*,*

_{lower}*x*

*,).*

_{upper}If you know in advance that a local minimum falls within
a given interval, you can simply call the **NMath**
minimization routines using that interval. Before beginning minimization,
the routine will search for an interior point that satisfies the bracketing
condition.

Otherwise, construct a **Bracket**
object. Beginning with a pair of points, **Bracket**
searches in the downhill direction for a new pair of points that bracket
a minimum of a function. For example, if function
is a **OneVariableFunction**:

Code Example – C# minimization

var bracket = new Bracket( function, 0, 1 );

Code Example – VB minimization

Dim Bracket As New Bracket( MyFunction, 0, 1 )

Once constructed, a **Bracket**
object provides the following properties:

● Function gets the function whose minimum is bracketed.

● Lower gets a lower bound on a minimum of the function.

● Upper gets an upper bound on a minimum of the function.

● Interior gets a point between the lower and upper
bound such that *x** _{lower}* <

*x*

*<*

_{interior}*x*

*,*

_{upper}*f(x*

_{interior}*)*<

*f(x*

_{lower}*),*and

*f(x*

_{interior}*)*<

*f(x*

_{upper}*)*

● FLower gets the function evaluated at the lower bound.

● FUpper gets the function evaluated at the upper bound.

● FInterior gets the function evaluated at the interior point.