@Status(stage=DEVELOPMENT, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2009-09-28") @ThreadSafety(level=NOT_THREAD_SAFE) public class RootFinderContext extends Object
Constructor and Description |
---|
RootFinderContext(RootFinderStrategy strategy)
Constructs this RootFinder from the supplied strategy.
|
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 a
RootFinderStrategy . |
void |
setRootFinderStrategy(RootFinderStrategy strategy)
Sets the strategy to find a root of a function.
|
public RootFinderContext(RootFinderStrategy strategy)
strategy
- The strategy to find a root of a function.NullPointerException
- When the supplied strategy is null.public void setRootFinderStrategy(RootFinderStrategy strategy)
strategy
- The strategy to find a root of a function.NullPointerException
- When the supplied strategy is null.public double findRoot(SingleParameterFunction function, double left, double right)
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.