SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.univariate
Class Brent

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.univariate.BracketSearch
      extended by com.numericalmethod.suanshu.optimization.univariate.Brent

public class Brent
extends BracketSearch

Brent's algorithm is a root-finding algorithm that combines the bisection method, the secant method and the inverse quadratic interpolation.

It has the reliability of bisection but it can be as quick as some of the less reliable methods. The idea is to use the secant method or the inverse quadratic interpolation if possible, because they converge faster, but to fall back to the more robust bisection method if necessary.

This is the preferred method for finding the minimum for univariate functions.

See Also:
Wikipedia: Brent's method

Field Summary
 
Fields inherited from class com.numericalmethod.suanshu.optimization.univariate.BracketSearch
f, tol
 
Constructor Summary
Brent()
           
 
Method Summary
 double search(int maxIterations, double lower, double upper)
          Search for a minimum within the interval [lower, upper].
 double search(int maxIterations, double lower, double initial, double upper)
           
 
Methods inherited from class com.numericalmethod.suanshu.optimization.univariate.BracketSearch
minimum, solve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Brent

public Brent()
Method Detail

search

public double search(int maxIterations,
                     double lower,
                     double initial,
                     double upper)
Overrides:
search in class BracketSearch

search

public double search(int maxIterations,
                     double lower,
                     double upper)
Search for a minimum within the interval [lower, upper].

Parameters:
maxIterations - number of iterations
lower - lower bound for the bracketing interval which contains a minimum
upper - upper bound for the bracketing interval which contains a minimum
Returns:
an approximate minimizer

SuanShu, a Java numerical and statistical library

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