public class BisectionRootSolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ITER |
Constructor and Description |
---|
BisectionRootSolver() |
Modifier and Type | Method and Description |
---|---|
static void |
clearIterationCount() |
static double |
findRoot(Function1x1 fxn,
double a,
double b,
double eps,
double feps)
Finds a root by bisection, given
a and b that bracket the
root. |
static double |
findRoot(Function1x1 fxn,
double a,
double fa,
double b,
double fb,
double eps,
double feps)
Finds a root by bisection, given
a and b that bracket the
root. |
static int |
getIterationCount() |
public static void clearIterationCount()
public static int getIterationCount()
public static double findRoot(Function1x1 fxn, double a, double b, double eps, double feps)
a
and b
that bracket the
root.fxn
- function to evaluatea
- left-side of intervalb
- right-side of intervaleps
- absolute interval tolerance for the rootfeps
- absolute tolerance for function value, such that
a root is found if |f(s)| <= feps
NumericalException
- if [a,b] does not bracket the rootpublic static double findRoot(Function1x1 fxn, double a, double fa, double b, double fb, double eps, double feps)
a
and b
that bracket the
root.fxn
- function to evaluatea
- left-side of intervalfa
- function evaluated at ab
- right-side of intervalfb
- function evaluated at beps
- absolute interval tolerance for the rootfeps
- absolute tolerance for function value, such that
a root is found if |f(s)| <= feps
NumericalException
- if [a,b] does not bracket the root