public class BracketRoot extends Object
Function) $f(x)$,
initial values for the interval, $x_1$ and $x_2$, are supplied.
A root is assumed to be bracketed if $f(x_1)f(x_2) < 0$. If this condition is not satisfied, then either $|f(x_1)| < |f(x_2)|$, in which case the lower value $x_1$ is shifted in the negative $x$ direction, or the upper value $x_2$ is shifted in the positive $x$ direction. The amount by which to shift is the difference between the two $x$ values multiplied by a constant ratio (1.6). If a root is not bracketed after 50 attempts, an exception is thrown.
| Constructor and Description |
|---|
BracketRoot() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
getBracketedPoints(Function<Double,Double> f,
double xLower,
double xUpper)
Gets the bracketed roots.
|
double[] |
getBracketedPoints(Function<Double,Double> f,
double xLower,
double xUpper,
double minX,
double maxX)
Gets the bracketed roots.
|
public double[] getBracketedPoints(Function<Double,Double> f, double xLower, double xUpper)
f - The function, not nullxLower - Initial value of lower bracketxUpper - Initial value of upper bracketMathException - If a root is not bracketed in 50 attempts.public double[] getBracketedPoints(Function<Double,Double> f, double xLower, double xUpper, double minX, double maxX)
f - The function, not nullxLower - Initial value of lower bracketxUpper - Initial value of upper bracketminX - the minimum xmaxX - the maximum xMathException - If a root is not bracketed in 50 attempts.Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.