umontreal.iro.lecuyer.util
Class RootFinder
- java.lang.Object
-
- umontreal.iro.lecuyer.util.RootFinder
-
public class RootFinder extends java.lang.ObjectThis class provides methods to solve non-linear equations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublebisection(double a, double b, MathFunction f, double tol)Computes a root x of the function in f using the bisection method.static doublebrentDekker(double a, double b, MathFunction f, double tol)Computes a root x of the function in f using the Brent-Dekker method.
-
-
-
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 intervalb- right endpoint of initial intervalf- the function which is evaluatedtol- 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 intervalb- right endpoint of initial intervalf- the function which is evaluatedtol- accuracy goal- Returns:
- the root x
-
-
DMelt 3.0 © DataMelt by jWork.ORG