## org.apache.commons.math.analysis.solvers
Class BisectionSolver

    java.lang.Object
      org.apache.commons.math.ConvergingAlgorithmImpl
          org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl
              org.apache.commons.math.analysis.solvers.BisectionSolver

All Implemented Interfaces:
  UnivariateRealSolver, ConvergingAlgorithm

    public class BisectionSolver

extends UnivariateRealSolverImpl

Implements the bisection algorithm for finding zeros of univariate real functions.

The function should be continuous but not necessarily smooth.

Version:
  $Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $

Field Summary

Fields inherited from class org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl
`defaultFunctionValueAccuracy, f, functionValue, functionValueAccuracy, result, resultComputed`

Fields inherited from class org.apache.commons.math.ConvergingAlgorithmImpl
`absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy`

Constructor Summary
`BisectionSolver()` Construct a solver.
`BisectionSolver(UnivariateRealFunction f)` Deprecated. as of 2.0 the function to solve is passed as an argument to the `solve(UnivariateRealFunction, double, double)` or `UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)` method.

Method Summary
`double` `solve(double min, double max)` Deprecated.
`double` `solve(double min, double max, double initial)` Deprecated.
`double` `solve(UnivariateRealFunction f, double min, double max)` Solve for a zero root in the given interval.
`double` `solve(UnivariateRealFunction f, double min, double max, double initial)` Solve for a zero in the given interval, start at startValue.

Methods inherited from class org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl
`checkResultComputed, clearResult, getFunctionValue, getFunctionValueAccuracy, getResult, isBracketing, isSequence, resetFunctionValueAccuracy, setFunctionValueAccuracy, setResult, setResult, verifyBracketing, verifyInterval, verifySequence`

Methods inherited from class org.apache.commons.math.ConvergingAlgorithmImpl
`getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy`

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.math.ConvergingAlgorithm
`getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy`

Constructor Detail

### BisectionSolver

    @Deprecated
    public BisectionSolver(UnivariateRealFunction f)

  Deprecated. as of 2.0 the function to solve is passed as an argument to the `solve(UnivariateRealFunction, double, double)` or `UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)` method.

  Construct a solver for the given function.

  Parameters:
    `f` - function to solve.

### BisectionSolver

    public BisectionSolver()

  Construct a solver.

Method Detail

### solve

    @Deprecated
    public double solve(double min,
                                   double max,
                                   double initial)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException

  Deprecated.

  Solve for a zero in the given interval, start at startValue.

  A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

  Parameters:
    `min` - the lower bound for the interval.
    `max` - the upper bound for the interval.
    `initial` - the start value to use
  Returns:
    a value where the function is zero
  Throws:
    `FunctionEvaluationException` - if an error occurs evaluating the function
    `MaxIterationsExceededException`

### solve

    @Deprecated
    public double solve(double min,
                                   double max)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException

  Deprecated.

  Solve for a zero root in the given interval.

  A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

  Parameters:
    `min` - the lower bound for the interval.
    `max` - the upper bound for the interval.
  Returns:
    a value where the function is zero
  Throws:
    `FunctionEvaluationException` - if an error occurs evaluating the function
    `MaxIterationsExceededException`

### solve

    public double solve(UnivariateRealFunction f,
                        double min,
                        double max,
                        double initial)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException

  Solve for a zero in the given interval, start at startValue.

  A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

  Parameters:
    `f` - the function to solve.
    `min` - the lower bound for the interval.
    `max` - the upper bound for the interval.
    `initial` - the start value to use
  Returns:
    a value where the function is zero
  Throws:
    `FunctionEvaluationException` - if an error occurs evaluating the function
    `MaxIterationsExceededException`

### solve

    public double solve(UnivariateRealFunction f,
                        double min,
                        double max)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException

  Solve for a zero root in the given interval.

  A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

  Parameters:
    `f` - the function to solve.
    `min` - the lower bound for the interval.
    `max` - the upper bound for the interval.
  Returns:
    a value where the function is zero
  Throws:
    `FunctionEvaluationException` - if an error occurs evaluating the function
    `MaxIterationsExceededException`

Copyright (c) 2003-2010 Apache Software Foundation