jsat.math.rootfinding
Interface RootFinder
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- Bisection, RiddersMethod, Secant, Zeroin
public interface RootFinder extends java.io.SerializableThis interface defines a general contract for the numerical computation of a root of a given function. A root of a functionfis a pointxfor whichf(x) = 0. A function may have any number of roots (including no roots).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description intguessesNeeded()Different root finding methods require different numbers of initial guesses.doubleroot(double eps, int maxIterations, double[] initialGuesses, Function1D f)Attempts to numerical compute the root of a given function, such that f(args) = 0.
-
-
-
Method Detail
-
root
double root(double eps, int maxIterations, double[] initialGuesses, Function1D f)Attempts to numerical compute the root of a given function, such that f(args) = 0. Only one variable may be altered at a time- 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 ofpos- the index of the argument that will be allowed to alter in order to find the root. Starts from 0args- the values to be passed to the function as arguments- Returns:
- the value of the variable at the index pos that makes the function return 0
-
guessesNeeded
int guessesNeeded()
Different 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.- Returns:
- the number of initial guesses this root finding method needs
-
-
DataMelt 3.0 © DataMelt by jWork.ORG