Class NewtonsMethod

java.lang.Object
net.finmath.rootfinder.NewtonsMethod
All Implemented Interfaces:
RootFinderWithDerivative
Direct Known Subclasses:
SecantMethod

public class NewtonsMethod extends Object implements RootFinderWithDerivative
This class implements a root finder as question-and-answer algorithm using Newton's method.
Version:
1.3
Author:
Christian Fries
Date:
2008-04-06
  • Constructor Details

    • NewtonsMethod

      public NewtonsMethod(double guess)
      Parameters:
      guess - initial guess where the solver will start
  • Method Details

    • getBestPoint

      public double getBestPoint()
      Specified by:
      getBestPoint in interface RootFinderWithDerivative
      Returns:
      Returns the best point optained so far
    • getNextPoint

      public double getNextPoint()
      Specified by:
      getNextPoint in interface RootFinderWithDerivative
      Returns:
      Next point for which a value should be set using setValue.
    • setValueAndDerivative

      public void setValueAndDerivative(double value, double derivative)
      Specified by:
      setValueAndDerivative in interface RootFinderWithDerivative
      Parameters:
      value - The value corresponding to the point returned by previous getNextPoint call.
      derivative - The derivative corresponding to the point returned by previous getNextPoint call.
    • getNumberOfIterations

      public int getNumberOfIterations()
      Specified by:
      getNumberOfIterations in interface RootFinderWithDerivative
      Returns:
      Returns the number of iterations.
    • getAccuracy

      public double getAccuracy()
      Specified by:
      getAccuracy in interface RootFinderWithDerivative
      Returns:
      Returns the accuracy.
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface RootFinderWithDerivative
      Returns:
      Returns true if the solver is done (accuracy achieved or unable to improve)