Package dev.nm.analysis.root.univariate
Interface Uniroot
-
- All Known Implementing Classes:
BisectionRoot
,BrentRoot
,HalleyRoot
,NewtonRoot
public interface Uniroot
A root-finding algorithm is a numerical algorithm for finding a value x such that f(x) = 0, for a given function f. Such an x is called a root of the function f. The R equivalent function isuniroot
.- See Also:
- Wikipedia: Root-finding algorithm
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
solve(UnivariateRealFunction f, double lower, double upper, double... guess)
Search for a root, x, in the interval [lower, upper] such that f(x) = 0.
-
-
-
Method Detail
-
solve
double solve(UnivariateRealFunction f, double lower, double upper, double... guess) throws NoRootFoundException
Search for a root, x, in the interval [lower, upper] such that f(x) = 0.- Parameters:
f
- a univariate functionlower
- the lower bound of the bracketing intervalupper
- the upper bound of the bracketing intervalguess
- an initial guess of the root within [lower, upper]. Note thatguess
is adouble[]
. This signature allows multiple initial guesses for certain types of uniroot algorithms, e.g., Brent's algorithm.- Returns:
- an approximate root
- Throws:
NoRootFoundException
- when the search fails to find a root
-
-