com.numericalmethod.suanshu.analysis.uniroot
Class Brent
java.lang.Object
com.numericalmethod.suanshu.analysis.uniroot.Uniroot
com.numericalmethod.suanshu.analysis.uniroot.Brent
public class Brent
- extends Uniroot
Brent's root-finding algorithm combines superlinear convergence with reliability of bisection.
It uses the secant method or inverse quadratic interpolation whenever possible because they converge faster,
but falls back to the more robust bisection method if necessary.
Brent's algorithm does not need the derivatives of the function.
Brent's algorithm is the preferred method of choice.
- See Also:
- Wikipedia: Brent's method
| Fields inherited from class com.numericalmethod.suanshu.analysis.uniroot.Uniroot |
f, tol |
|
Method Summary |
double |
solve(int maxIterations,
double lower,
double upper,
double... guess)
The implementation of a specific uniroot finding algorithm. |
| Methods inherited from class com.numericalmethod.suanshu.analysis.uniroot.Uniroot |
solve |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Brent
public Brent(UnivariateRealFunction f,
double tol)
- Construct an instance of Brent's root finding algorithm.
- Parameters:
f - the function to solvetol - the convergence tolerance
solve
public double solve(int maxIterations,
double lower,
double upper,
double... guess)
- The implementation of a specific uniroot finding algorithm.
Note: it is important that
[lower, upper] must bracket the root.
- Specified by:
solve in class Uniroot
- Parameters:
maxIterations - the maximum number of iterationslower - lower bound for the rootupper - upper bound for the rootguess - not used
- Returns:
- the root an (approximate) root
Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.