|
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.analysis.uniroot.Uniroot
com.numericalmethod.suanshu.analysis.uniroot.Halley
public class Halley
Halley's method is an iterative root finding method for a univariate function with a continuous second derivative, i.e., a C2 function.
It has the following properties.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.numericalmethod.suanshu.analysis.uniroot.Uniroot |
|---|
Uniroot.NoRootFoundException |
| Field Summary | |
|---|---|
UnivariateRealFunction |
d2f
the 2nd derivative of f, d2f/dx2 |
UnivariateRealFunction |
df
the 1st derivative of f, df/dx |
| Fields inherited from class com.numericalmethod.suanshu.analysis.uniroot.Uniroot |
|---|
f, tol |
| Constructor Summary | |
|---|---|
Halley(UnivariateRealFunction f,
double tol)
Construct an instance of Halley's root finding algorithm. |
|
Halley(UnivariateRealFunction f,
UnivariateRealFunction df,
UnivariateRealFunction d2f,
double tol)
Construct an instance of Halley's root finding algorithm. |
|
| Method Summary | |
|---|---|
double |
solve(int maxIterations,
double guess)
Solve f(x) = 0 using Halley's algorithm
with an initial guess for the maximum number of iterations. |
double |
solve(int iterations,
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 |
| Field Detail |
|---|
public final UnivariateRealFunction df
f, df/dx
public final UnivariateRealFunction d2f
f, d2f/dx2
| Constructor Detail |
|---|
public Halley(UnivariateRealFunction f,
UnivariateRealFunction df,
UnivariateRealFunction d2f,
double tol)
f - the function to be solveddf - the first derivative of the functiond2f - the second derivative of the functiontol - the convergence tolerance
public Halley(UnivariateRealFunction f,
double tol)
f - the function to be solvedtol - the convergence tolerance| Method Detail |
|---|
public double solve(int maxIterations,
double guess)
f(x) = 0 using Halley's algorithm
with an initial guess for the maximum number of iterations.
maxIterations - the maximum number of iterationsguess - an initial guess
public double solve(int iterations,
double lower,
double upper,
double... guess)
Uniroot
solve in class Unirootiterations - the maximum number of iterationslower - the lower bound of the bracketing intervalupper - the upper bound of the bracketing intervalguess - an initial guess of the root. It should lie between [lower, upper].
Note that guess is a double[] array.
This signature allows multiple initial guesses for certain types of uniroot algorithms, e.g., Brent's algorithm.
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||