@Status(stage=PRODUCTION, unitTests=ABSENT) @Review(by="Kees Schotanus", at="2009-09-28") @ThreadSafety(level=IMMUTABLE) public final class RegulaFalsi extends AbstractRootFinder implements RootFinderStrategy
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ITERATIONS
Maximum number of iterations to perform before bailing out.
|
Constructor and Description |
---|
RegulaFalsi(double accuracy)
Creates this RegulaFalsi root finder using the supplied accuracy.
|
RegulaFalsi(int iterations)
Creates this RegulaFalsi root finder using the supplied number of
iterations.
|
Modifier and Type | Method and Description |
---|---|
double |
findRoot(SingleParameterFunction function,
double left,
double right)
Finds a root of the supplied function within the supplied interval [left,
right] using the Regula Falsi method.
|
getAccuracy, getInterval, getIterations, setAccuracy, setInterval, setIterations
public static final int MAX_ITERATIONS
public RegulaFalsi(int iterations)
iterations
- The maximum number of iterations to find a root.IllegalArgumentException
- When the supplied iterations <= 0.public RegulaFalsi(double accuracy)
accuracy
- The accuracy of the found root.IllegalArgumentException
- When the supplied accuracy <= 0.public double findRoot(SingleParameterFunction function, double left, double right)
findRoot
in interface RootFinderStrategy
function
- The function for which a root should be found.left
- x value of the left side of the interval.
right
- x value of the right side of the interval.
IllegalArgumentException
- When left equals right or when both
function(left) and function(right) are of equal sign or when either
function(left) or function(right) is "Not a Number".NullPointerException
- when the supplied function is null.Copyright © 2008–2018. All rights reserved.