Class CubicRootFinder
- java.lang.Object
-
- com.opengamma.strata.math.impl.rootfinding.CubicRootFinder
-
- All Implemented Interfaces:
Polynomial1DRootFinder<com.opengamma.strata.math.impl.ComplexNumber>
public class CubicRootFinder extends Object implements Polynomial1DRootFinder<com.opengamma.strata.math.impl.ComplexNumber>
Class that calculates the roots of a cubic equation.As the polynomial has real coefficients, the roots of the cubic can be found using the method described here.
-
-
Constructor Summary
Constructors Constructor Description CubicRootFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.opengamma.strata.math.impl.ComplexNumber[]
getRoots(RealPolynomialFunction1D function)
-
-
-
Method Detail
-
getRoots
public com.opengamma.strata.math.impl.ComplexNumber[] getRoots(RealPolynomialFunction1D function)
- Specified by:
getRoots
in interfacePolynomial1DRootFinder<com.opengamma.strata.math.impl.ComplexNumber>
- Parameters:
function
- The function, not null- Returns:
- The roots of the function
- Throws:
IllegalArgumentException
- If the function is not cubic
-
-