public class BrentRootSolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ITER
Maximum number of iterations.
|
Constructor and Description |
---|
BrentRootSolver() |
Modifier and Type | Method and Description |
---|---|
static void |
clearIterationCount() |
static void |
clearSolveCount() |
static double |
findRoot(Function1x1 fxn,
double a,
double b,
double eps,
double feps)
Implementation of Brent's root-finding method.
|
static double |
findRoot(Function1x1 fxn,
double a,
double fa,
double b,
double fb,
double eps,
double feps)
Implementation of Brent's root-finding method.
|
static int |
getIterationCount() |
static int |
getSolveCount() |
public static final int MAX_ITER
public static void clearIterationCount()
public static int getIterationCount()
public static void clearSolveCount()
public static int getSolveCount()
public static double findRoot(Function1x1 fxn, double a, double b, double eps, double feps)
fxn
- function to evaluatea
- left-side of intervalb
- right-side of intervaleps
- absolute tolerance for the root.feps
- absolute tolerance for function value, such that
a root is found if |f(s)| <= feps
.NumericalException
- if [a,b] does not bracket the root, or if the
number of iteractions exceeds MAX_ITER
.public static double findRoot(Function1x1 fxn, double a, double fa, double b, double fb, double eps, double feps)
fxn
- function to evaluatea
- left-side of intervalfa
- function evaluated at ab
- right-side of intervalfb
- function evaluated at beps
- absolute tolerance for the root.feps
- absolute tolerance for function value, such that
a root is found if |f(s)| <= feps
.NumericalException
- if [a,b] does not bracket the root, or if the
number of iteractions exceeds MAX_ITER
.