Class VectorRootFinder
- java.lang.Object
-
- com.opengamma.strata.math.impl.rootfinding.VectorRootFinder
-
- All Implemented Interfaces:
SingleRootFinder<DoubleArray,DoubleArray>
- Direct Known Subclasses:
BaseNewtonVectorRootFinder
public abstract class VectorRootFinder extends Object implements SingleRootFinder<DoubleArray,DoubleArray>
Parent class for root-finders that calculate a root for a vector function (i.e. $\mathbf{y} = f(\mathbf{x})$, where $\mathbf{x}$ and $\mathbf{y}$ are vectors).
-
-
Constructor Summary
Constructors Constructor Description VectorRootFinder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected DoubleArray
checkInputsAndApplyFunction(Function<DoubleArray,DoubleArray> function, DoubleArray x0)
abstract DoubleArray
getRoot(Function<DoubleArray,DoubleArray> function, DoubleArray x0)
DoubleArray
getRoot(Function<DoubleArray,DoubleArray> function, DoubleArray... startingPoint)
Finds the root.
-
-
-
Method Detail
-
getRoot
public DoubleArray getRoot(Function<DoubleArray,DoubleArray> function, DoubleArray... startingPoint)
Finds the root. Vector root finders only need a single starting point; if more than one is provided, the first is used and any other points ignored.- Specified by:
getRoot
in interfaceSingleRootFinder<DoubleArray,DoubleArray>
- Parameters:
function
- the function, not nullstartingPoint
- the roots, not null- Returns:
- a root lying between x1 and x2
-
getRoot
public abstract DoubleArray getRoot(Function<DoubleArray,DoubleArray> function, DoubleArray x0)
- Parameters:
function
- The (vector) function, not nullx0
- The starting point, not null- Returns:
- The vector root of this function
-
checkInputsAndApplyFunction
protected DoubleArray checkInputsAndApplyFunction(Function<DoubleArray,DoubleArray> function, DoubleArray x0)
- Parameters:
function
- The function, not nullx0
- The starting point, not null- Returns:
- the result of applying the function to x0
-
-