|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.optimization.univariate.BracketSearch
public abstract class BracketSearch
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].
| 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 |
|---|
protected UnivariateRealFunction f
protected double tol
It should be no less than the square root of the machine precision.
| Constructor Detail |
|---|
public BracketSearch()
| Method Detail |
|---|
public void solve(UnivariateRealFunction f,
double tol)
f.
f - the function to be minimizedtol - 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.
public double search(int maxIterations,
double lower,
double initial,
double upper)
public double minimum()
This is especially useful for an objective function that takes a long time to compute.
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||