Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.solvers

public Class MullerSolver2

extends AbstractUnivariateSolver
Class Inheritance
Imports
org.apache.commons.math3.exception.NoBracketingException, .NumberIsTooLargeException, .TooManyEvaluationsException, org.apache.commons.math3.util.FastMath

This class implements the Muller's Method for root finding of real univariate functions. For reference, see Elementary Numerical Analysis, ISBN 0070124477, chapter 3.

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.

Except for the initial [min, max], it does not require bracketing condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If a complex number arises in the computation, we simply use its modulus as a real approximation.

Because the interval may not be bracketing, the bisection alternative is not applicable here. However in practice our treatment usually works well, especially near real zeroes where the imaginary part of the complex approximation is often negligible.

The formulas here do not use divided differences directly.

Since
1.2
See Also
MullerSolver

Field Summary

Modifier and TypeField and Description
private static final double
DEFAULT_ABSOLUTE_ACCURACY

Default absolute accuracy.

Constructor Summary

AccessConstructor and Description
public
MullerSolver2()

Construct a solver with default accuracy (1e-6).

public
MullerSolver2(double
Absolute accuracy.
absoluteAccuracy
)

Construct a solver.

public
MullerSolver2(double
Relative accuracy.
relativeAccuracy
,
double
Absolute accuracy.
absoluteAccuracy
)

Construct a solver.

Method Summary

Modifier and TypeMethod and Description
protected double
doSolve()

Implements abstract org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Method for implementing actual optimization algorithms in derived classes.

Field Detail

DEFAULT_ABSOLUTE_ACCURACYback to summary
private static final double DEFAULT_ABSOLUTE_ACCURACY

Default absolute accuracy.

Constructor Detail

MullerSolver2back to summary
public MullerSolver2()

Construct a solver with default accuracy (1e-6).

MullerSolver2back to summary
public MullerSolver2(double absoluteAccuracy)

Construct a solver.

Parameters
absoluteAccuracy:double

Absolute accuracy.

MullerSolver2back to summary
public MullerSolver2(double relativeAccuracy, double absoluteAccuracy)

Construct a solver.

Parameters
relativeAccuracy:double

Relative accuracy.

absoluteAccuracy:double

Absolute accuracy.

Method Detail

doSolveback to summary
protected double doSolve() throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException

Implements abstract org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Doc from org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.doSolve.

Method for implementing actual optimization algorithms in derived classes.

Returns:double

the root.

Annotations
@Override
Exceptions
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.