Class RidderSingleRootFinder
- java.lang.Object
-
- com.opengamma.strata.math.impl.rootfinding.RealSingleRootFinder
-
- com.opengamma.strata.math.impl.rootfinding.RidderSingleRootFinder
-
- All Implemented Interfaces:
SingleRootFinder<Double,Double>
public class RidderSingleRootFinder extends RealSingleRootFinder
Finds a single root of a function using Ridder's method. This class is a wrapper for the Commons Math library implementation of Ridder's method.
-
-
Constructor Summary
Constructors Constructor Description RidderSingleRootFinder()
Sets the accuracy to 10-15.RidderSingleRootFinder(double functionValueAccuracy)
RidderSingleRootFinder(double functionValueAccuracy, double absoluteAccurary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getRoot(Function<Double,Double> function, Double xLow, Double xHigh)
-
Methods inherited from class com.opengamma.strata.math.impl.rootfinding.RealSingleRootFinder
checkInputs, checkInputs, getRoot
-
-
-
-
Constructor Detail
-
RidderSingleRootFinder
public RidderSingleRootFinder()
Sets the accuracy to 10-15.
-
RidderSingleRootFinder
public RidderSingleRootFinder(double functionValueAccuracy)
- Parameters:
functionValueAccuracy
- The accuracy of the function evaluations.
-
RidderSingleRootFinder
public RidderSingleRootFinder(double functionValueAccuracy, double absoluteAccurary)
- Parameters:
functionValueAccuracy
- The accuracy of the function evaluations.absoluteAccurary
- The maximum absolute error of the variable.
-
-
Method Detail
-
getRoot
public Double getRoot(Function<Double,Double> function, Double xLow, Double xHigh)
- Specified by:
getRoot
in classRealSingleRootFinder
- Throws:
MathException
- If the Commons method could not evaluate the function; if the Commons method could not converge.
-
-