Class SecantMethod
java.lang.Object
net.finmath.rootfinder.NewtonsMethod
net.finmath.rootfinder.SecantMethod
- All Implemented Interfaces:
RootFinder, RootFinderWithDerivative
This class implements a root finder as question-and-answer algorithm using
the secant method.
- Version:
- 1.3
- Author:
- Christian Fries
- Date:
- 2008-04-06
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublevoidsetValue(double value) voidsetValueAndDerivative(double value, double derivative) Methods inherited from class NewtonsMethod
getAccuracy, getBestPoint, getNumberOfIterations, isDoneMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RootFinder
getAccuracy, getBestPoint, getNumberOfIterations, isDone
-
Constructor Details
-
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 Details
-
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.
-