SSJ
V. 2.6.

umontreal.iro.lecuyer.util
Class RootFinder

java.lang.Object
  extended by umontreal.iro.lecuyer.util.RootFinder

public class RootFinder
extends Object

This class provides methods to solve non-linear equations.


Method Summary
static double bisection(double a, double b, MathFunction f, double tol)
          Computes a root x of the function in f using the bisection method.
static double brentDekker(double a, double b, MathFunction f, double tol)
          Computes a root x of the function in f using the Brent-Dekker method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

brentDekker

public static double brentDekker(double a,
                                 double b,
                                 MathFunction f,
                                 double tol)
Computes a root x of the function in f using the Brent-Dekker method. The interval [a, b] must contain the root x. The calculations are done with an approximate relative precision tol. Returns x such that f (x) = 0.

Parameters:
a - left endpoint of initial interval
b - right endpoint of initial interval
f - the function which is evaluated
tol - accuracy goal
Returns:
the root x

bisection

public static double bisection(double a,
                               double b,
                               MathFunction f,
                               double tol)
Computes a root x of the function in f using the bisection method. The interval [a, b] must contain the root x. The calculations are done with an approximate relative precision tol. Returns x such that f (x) = 0.

Parameters:
a - left endpoint of initial interval
b - right endpoint of initial interval
f - the function which is evaluated
tol - accuracy goal
Returns:
the root x

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.