public class NewtonRootSolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ITER |
Constructor and Description |
---|
NewtonRootSolver() |
Modifier and Type | Method and Description |
---|---|
static void |
clearIterationCount() |
static double |
findRoot(Diff1Function1x1 fxn,
double a,
double b,
double eps,
double feps)
Safe implementation of Newton's root-finding, which switchs back to
bisection when the Newton's method diverges or doesn't converge fast
enough.
|
static double |
findRoot(Diff1Function1x1 fxn,
double a,
double fa,
double b,
double fb,
double eps,
double feps)
Safe implementation of Newton's root-finding, which switchs back to
bisection when the Newton's method diverges or doesn't converge fast
enough.
|
static int |
getIterationCount() |
public static void clearIterationCount()
public static int getIterationCount()
public static double findRoot(Diff1Function1x1 fxn, double a, double b, double eps, double feps)
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(Diff1Function1x1 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 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