net.finmath.rootfinder
Class SecantMethod
- java.lang.Object
-
- net.finmath.rootfinder.NewtonsMethod
-
- net.finmath.rootfinder.SecantMethod
-
- All Implemented Interfaces:
- RootFinder, RootFinderWithDerivative
public class SecantMethod extends NewtonsMethod implements RootFinder
This class implements a root finder as question-and-answer algorithm using the secant method.
-
-
Constructor Summary
Constructors Constructor and Description SecantMethod(double firstGuess, double secondGuess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetNextPoint()voidsetValue(double value)voidsetValueAndDerivative(double value, double derivative)-
Methods inherited from class net.finmath.rootfinder.NewtonsMethod
getAccuracy, getBestPoint, getNumberOfIterations, isDone
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.finmath.rootfinder.RootFinder
getAccuracy, getBestPoint, getNumberOfIterations, isDone
-
-
-
-
Constructor Detail
-
SecantMethod
public SecantMethod(double firstGuess, double secondGuess)- Parameters:
firstGuess- The first guess for the solver to use.secondGuess- A second guess for the solver to use (different from first guess).
-
-
Method Detail
-
getNextPoint
public double getNextPoint()
- Specified by:
getNextPointin interfaceRootFinder- Specified by:
getNextPointin interfaceRootFinderWithDerivative- Overrides:
getNextPointin classNewtonsMethod- Returns:
- Next point for which a value should be set using
setValue.
-
setValue
public void setValue(double value)
- Specified by:
setValuein interfaceRootFinder- Parameters:
value- The value corresponding to the point returned by previousgetNextPointcall.
-
setValueAndDerivative
public void setValueAndDerivative(double value, double derivative)- Specified by:
setValueAndDerivativein interfaceRootFinderWithDerivative- Overrides:
setValueAndDerivativein classNewtonsMethod- Parameters:
value- The value corresponding to the point returned by previousgetNextPointcall.derivative- The derivative corresponding to the point returned by previousgetNextPointcall.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG