jsat.math.rootfinding
Class Zeroin
- java.lang.Object
-
- jsat.math.rootfinding.Zeroin
-
- All Implemented Interfaces:
- java.io.Serializable, RootFinder
public class Zeroin extends java.lang.Object implements RootFinder
This class provides an implementation of the popular ZeroIn root finder.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Zeroin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description intguessesNeeded()Different root finding methods require different numbers of initial guesses.static doubleroot(double eps, double a, double b, Function1D f)Performs root finding on the functionf.static doubleroot(double a, double b, Function1D f)Performs root finding on the functionf.doubleroot(double eps, int maxIterations, double[] initialGuesses, Function1D f)Attempts to numerical compute the root of a given function, such that f(args) = 0.static doubleroot(double eps, int maxIterations, double a, double b, Function1D f)Performs root finding on the functionf.
-
-
-
Method Detail
-
root
public static double root(double a, double b, Function1D f)Performs root finding on the functionf.- Parameters:
a- the left bound on the root (i.e., f(a) < 0)b- the right bound on the root (i.e., f(b) > 0)f- the function to find the root of- Returns:
- the value of variable
posthat produces a zero value output
-
root
public static double root(double eps, double a, double b, Function1D f)Performs root finding on the functionf.- Parameters:
eps- the desired accuracy of the resulta- the left bound on the root (i.e., f(a) < 0)b- the right bound on the root (i.e., f(b) > 0)f- the function to find the root of- Returns:
- the value of variable
posthat produces a zero value output
-
root
public static double root(double eps, int maxIterations, double a, double b, Function1D f)Performs root finding on the functionf.- Parameters:
eps- the desired accuracy of the resultmaxIterations- the maximum number of iterations to performa- the left bound on the root (i.e., f(a) < 0)b- the right bound on the root (i.e., f(b) > 0)f- the function to find the root of- Returns:
- the value of variable
posthat produces a zero value output
-
root
public double root(double eps, int maxIterations, double[] initialGuesses, Function1D f)Description copied from interface:RootFinderAttempts to numerical compute the root of a given function, such that f(args) = 0. Only one variable may be altered at a time- Specified by:
rootin interfaceRootFinder- Parameters:
eps- the accuracy desired for the solutionmaxIterations- the maximum number of steps allowed before forcing a return of the current solution.initialGuesses- an array containing the initial guess valuesf- the function to find the root of- Returns:
- the value of the variable at the index pos that makes the function return 0
-
guessesNeeded
public int guessesNeeded()
Description copied from interface:RootFinderDifferent root finding methods require different numbers of initial guesses. Some root finding methods require 2 guesses, each with values of opposite sign so that they bracket the root. Others just need any 2 initial guesses sufficiently close to the root. This method simply returns the number of guesses that are needed.- Specified by:
guessesNeededin interfaceRootFinder- Returns:
- the number of initial guesses this root finding method needs
-
-
DataMelt 3.0 © DataMelt by jWork.ORG