public class MullerSolver extends AbstractUnivariateSolver
Muller's method applies to both real and complex functions, but here we
restrict ourselves to real functions.
This class differs from MullerSolver
in the way it avoids complex
operations.
Normally Muller's method converges quadratically in the vicinity of a zero, however it may be very slow in regions far away from zeros. For example, f(x) = exp(x) - 1, min = -50, max = 100. In such case we use bisection as a safety backup if it performs very poorly.
The formulas here use divided differences directly.
MullerSolver2
Modifier and Type | Field and Description |
---|---|
private static double |
DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy.
|
Constructor and Description |
---|
MullerSolver()
Construct a solver with default accuracy (1e-6).
|
MullerSolver(double absoluteAccuracy)
Construct a solver.
|
MullerSolver(double relativeAccuracy,
double absoluteAccuracy)
Construct a solver.
|
Modifier and Type | Method and Description |
---|---|
protected double |
doSolve()
Method for implementing actual optimization algorithms in derived
classes.
|
private double |
solve(double min,
double max,
double fMin,
double fMax)
Find a real root in the given interval.
|
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solve
private static final double DEFAULT_ABSOLUTE_ACCURACY
public MullerSolver()
public MullerSolver(double absoluteAccuracy)
absoluteAccuracy
- Absolute accuracy.public MullerSolver(double relativeAccuracy, double absoluteAccuracy)
relativeAccuracy
- Relative accuracy.absoluteAccuracy
- Absolute accuracy.protected double doSolve() throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException
doSolve
in class BaseAbstractUnivariateSolver<UnivariateFunction>
TooManyEvaluationsException
- if the maximal number of evaluations
is exceeded.NoBracketingException
- if the initial search interval does not bracket
a root and the solver requires it.NumberIsTooLargeException
private double solve(double min, double max, double fMin, double fMax) throws TooManyEvaluationsException
min
- Lower bound for the interval.max
- Upper bound for the interval.fMin
- function value at the lower bound.fMax
- function value at the upper bound.TooManyEvaluationsException
- if the allowed number of calls to
the function to be solved has been exhausted.Copyright (c) 2003-2016 Apache Software Foundation