opale.mathtools
Class Bisection

java.lang.Object
  |
  +--opale.mathtools.RootFinder1D
        |
        +--opale.mathtools.Bisection

public class Bisection
extends RootFinder1D

Implements the bisection method for find the root of a function. The algorithm is conformed with the book numerical recipes in C. If the precision is not reached, then the number of iterations is MAXITERATION and the variable NITER is set to -1.

Since:
Opale-Mathtools 0.12

Fields inherited from class opale.mathtools.RootFinder1D
MAXITERATION, NITER, PRECISION
 
Constructor Summary
Bisection()
           
 
Method Summary
 double find(IyFx f, double x0, double x1)
          Solves equation f(x) = 0 by bisection's method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bisection

public Bisection()
Method Detail

find

public double find(IyFx f,
                   double x0,
                   double x1)
Solves equation f(x) = 0 by bisection's method. The root must be bracketed between x0 and x1.
Overrides:
find in class RootFinder1D
Following copied from class: opale.mathtools.RootFinder1D
Parameters:
IyFx - f, a function.
double - x0, x1, values that bracket the root.
Returns:
double, the root.
Throws:
RootSolverException. -