@Status(stage=PRODUCTION, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2011-12-16", reason="Initial review") @ThreadSafety(level=NOT_THREAD_SAFE) public final class FunctionInterval extends Object
Constructor and Description |
---|
FunctionInterval(SingleParameterFunction function,
double left,
double right)
Creates this FunctionInterval from the supplied function and left and right sides of the interval.
|
Modifier and Type | Method and Description |
---|---|
double |
a()
Gets the left side of this interval.
|
double |
b()
Gets the right side of this interval.
|
double |
c()
Gets the point between a and b.
|
void |
checkForRoot()
Checks this interval for having a possible root so this interval can be
used by a root finding method like the
Bisection method or the
RegulaFalsi method. |
double |
fa()
Gets f(a).
|
double |
fb()
Gets f(b).
|
double |
fc()
Gets f(c).
|
void |
setA(double a)
Sets the left side for this interval.
|
void |
setB(double b)
Sets the right side for this interval.
|
void |
setC(double c)
Sets a value c between a and calculates f(c).
|
void |
setFa(double fa)
Sets f(a).
|
void |
setFb(double fb)
Sets f(b).
|
public FunctionInterval(SingleParameterFunction function, double left, double right)
function
- The function corresponding to this interval.left
- The left side of the interval.right
- The right side of the interval.NullPointerException
- When the supplied function is null.public void checkForRoot()
Bisection
method or the
RegulaFalsi
method.
IllegalArgumentException
- When this interval does not represent
an interval as described by the rules above.public double a()
public void setA(double a)
a
- The left side of this interval.public double fa()
public void setFa(double fa)
fa
- f(a).public double b()
public void setB(double b)
b
- The right side of this interval.public double fb()
public void setFb(double fb)
fb
- f(b).public double c()
public double fc()
public void setC(double c)
c
- A value between a and b.
Note: No check is made whether c is actually between a and b.Copyright © 2008–2018. All rights reserved.