Interface NewtonVectorRootFinder
-
- All Known Implementing Classes:
BaseNewtonVectorRootFinder
,BroydenVectorRootFinder
,NewtonDefaultVectorRootFinder
,ShermanMorrisonVectorRootFinder
public interface NewtonVectorRootFinder
Performs Newton-Raphson style multi-dimensional root finding.This uses the Jacobian matrix as a basis for some parts of the iterative process.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static NewtonVectorRootFinder
broyden()
Obtains an instance of the Broyden root finder.static NewtonVectorRootFinder
broyden(double absoluteTol, double relativeTol, int maxSteps)
Obtains an instance of the Broyden root finder specifying the tolerances.static NewtonVectorRootFinder
broyden(double absoluteTol, double relativeTol, int maxSteps, Decomposition<?> decomposition)
Obtains an instance of the Broyden root finder specifying the tolerances.DoubleArray
findRoot(Function<DoubleArray,DoubleArray> function, DoubleArray startPosition)
Finds the root from the specified start position.DoubleArray
findRoot(Function<DoubleArray,DoubleArray> function, Function<DoubleArray,DoubleMatrix> jacobianFunction, DoubleArray startPosition)
Finds the root from the specified start position.
-
-
-
Method Detail
-
broyden
static NewtonVectorRootFinder broyden()
Obtains an instance of the Broyden root finder.This uses SV decomposition and standard tolerances.
- Returns:
- the root finder
-
broyden
static NewtonVectorRootFinder broyden(double absoluteTol, double relativeTol, int maxSteps)
Obtains an instance of the Broyden root finder specifying the tolerances.This uses SV decomposition.
- Parameters:
absoluteTol
- the absolute tolerancerelativeTol
- the relative tolerancemaxSteps
- the maximum steps- Returns:
- the root finder
-
broyden
static NewtonVectorRootFinder broyden(double absoluteTol, double relativeTol, int maxSteps, Decomposition<?> decomposition)
Obtains an instance of the Broyden root finder specifying the tolerances.- Parameters:
absoluteTol
- the absolute tolerancerelativeTol
- the relative tolerancemaxSteps
- the maximum stepsdecomposition
- the decomposition function- Returns:
- the root finder
-
findRoot
DoubleArray findRoot(Function<DoubleArray,DoubleArray> function, DoubleArray startPosition)
Finds the root from the specified start position.This applies the specified function to find the root. Note if multiple roots exist which one is found will depend on the start position.
- Parameters:
function
- the vector functionstartPosition
- the start position of the root finder for- Returns:
- the vector root of the collection of functions
- Throws:
MathException
- if unable to find the root, such as if unable to converge
-
findRoot
DoubleArray findRoot(Function<DoubleArray,DoubleArray> function, Function<DoubleArray,DoubleMatrix> jacobianFunction, DoubleArray startPosition)
Finds the root from the specified start position.This applies the specified function and Jacobian function to find the root. Note if multiple roots exist which one is found will depend on the start position.
- Parameters:
function
- the vector functionjacobianFunction
- the function to calculate the JacobianstartPosition
- the start position of the root finder for- Returns:
- the vector root of the collection of functions
- Throws:
MathException
- if unable to find the root, such as if unable to converge
-
-