SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.univariate
Class BracketSearch

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.univariate.BracketSearch
Direct Known Subclasses:
Brent, Fibonacci, Golden

public abstract class BracketSearch
extends java.lang.Object

This class provides support for the type of univariate optimization algorithms that is based on bracketing. Examples are Bisection method, Fibonacci search, and Golden-section search.

Starting with a 3-point bracketing interval of a minimum, i.e., xl, xa, xu, we iteratively reduce the length of the interval. We compute a 4th point, xb, according to an interval dividing schedule, to form two overlapping sub-intervals, e.g., [xl, xa], and [xb, xu]. We choose the sub-interval that contains the new minimum and repeat the procedure.

This algorithm is most effective for a uni-modal function in interval [xl, xu].

See Also:
"Chapter 4. Practical Optimization: Algorithms and Engineering Applications. Andreas Antoniou and Wu-Sheng Lu. Springer."

Field Summary
protected  UnivariateRealFunction f
          the function to be minimized
protected  double tol
          the convergence tolerance It should be no less than the square root of the machine precision.
 
Constructor Summary
BracketSearch()
           
 
Method Summary
 double minimum()
          Get the minimum found.
 double search(int maxIterations, double lower, double initial, double upper)
           
 void solve(UnivariateRealFunction f, double tol)
          Construct an instance of BracketSearch to minimize a function f.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f

protected UnivariateRealFunction f
the function to be minimized


tol

protected double tol
the convergence tolerance

It should be no less than the square root of the machine precision.

Constructor Detail

BracketSearch

public BracketSearch()
Method Detail

solve

public void solve(UnivariateRealFunction f,
                  double tol)
Construct an instance of BracketSearch to minimize a function f.

Parameters:
f - the function to be minimized
tol - a convergence tolerance; tol should be no less than the square root of the machine precision. If it is, it will default to the square root of the machine precision.

search

public double search(int maxIterations,
                     double lower,
                     double initial,
                     double upper)

minimum

public double minimum()
Get the minimum found.

This is especially useful for an objective function that takes a long time to compute.

Returns:
the minimum found

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.