org.apache.commons.math3.analysis.solvers

## Class MullerSolver2

- java.lang.Object
- - org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateFunction>
  - - org.apache.commons.math3.analysis.solvers.AbstractUnivariateSolver
    - - org.apache.commons.math3.analysis.solvers.MullerSolver2

- All Implemented Interfaces:
    BaseUnivariateSolver<UnivariateFunction>, UnivariateSolver

      public class MullerSolver2
      extends AbstractUnivariateSolver

  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 complex number arises in the computation, we simply use its modulus as real approximation.

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

  The formulas here do not use divided differences directly.

  Since:
    1.2
  Version:
    $Id: MullerSolver2.java 1379560 2012-08-31 19:40:30Z erans $
  See Also:
    `MullerSolver`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static double` | `DEFAULT_ABSOLUTE_ACCURACY` Default absolute accuracy.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MullerSolver2()` Construct a solver with default accuracy (1e-6).
    `MullerSolver2(double absoluteAccuracy)` Construct a solver.
    `MullerSolver2(double relativeAccuracy, double absoluteAccuracy)` Construct a solver.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected double` | `doSolve()` Method for implementing actual optimization algorithms in derived classes.

    - ### Methods inherited from class org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver

      `computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.commons.math3.analysis.solvers.BaseUnivariateSolver

      `getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solve`

- - ### Field Detail

    - #### DEFAULT_ABSOLUTE_ACCURACY

          private static final double DEFAULT_ABSOLUTE_ACCURACY

      Default absolute accuracy.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MullerSolver2

          public MullerSolver2()

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

    - #### MullerSolver2

          public MullerSolver2(double absoluteAccuracy)

      Construct a solver.
      Parameters:
        `absoluteAccuracy` - Absolute accuracy.

    - #### MullerSolver2

          public MullerSolver2(double relativeAccuracy,
                       double absoluteAccuracy)

      Construct a solver.
      Parameters:
        `relativeAccuracy` - Relative accuracy.
        `absoluteAccuracy` - Absolute accuracy.

  - ### Method Detail

    - #### doSolve

          protected double doSolve()
                            throws TooManyEvaluationsException,
                                   NumberIsTooLargeException,
                                   NoBracketingException

      Method for implementing actual optimization algorithms in derived classes.
      Specified by:
        `doSolve` in class `BaseAbstractUnivariateSolver<UnivariateFunction>`
      Returns:
        the root.
      Throws:
        `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`

Copyright (c) 2003-2013 Apache Software Foundation