Class DerivativeSingleRootEstimator

Direct Known Subclasses:
NewtonRaphsonSingleRootEstimator, SafeNewtonRaphsonSingleRootEstimator

public abstract class DerivativeSingleRootEstimator extends BracketedSingleRootEstimator
Abstract class to find function roots of a single dimension function using also its derivative information. This class is meant to be extended by final implementations.
  • Field Details

    • derivativeListener

      protected SingleDimensionFunctionEvaluatorListener derivativeListener
      Listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.
  • Constructor Details

    • DerivativeSingleRootEstimator

      protected DerivativeSingleRootEstimator()
      Empty constructor.
    • DerivativeSingleRootEstimator

      protected DerivativeSingleRootEstimator(SingleDimensionFunctionEvaluatorListener listener, double minEvalPoint, double maxEvalPoint) throws InvalidBracketRangeException
      Constructor.
      Parameters:
      listener - Listener to evaluate a single dimension function f(x) to find its roots.
      minEvalPoint - Smallest value inside the bracket of values where the root will be searched.
      maxEvalPoint - Largest value inside the bracket of values where the root will be searched.
      Throws:
      InvalidBracketRangeException - Raised if minEvalPoint < maxEvalPoint.
    • DerivativeSingleRootEstimator

      protected DerivativeSingleRootEstimator(SingleDimensionFunctionEvaluatorListener listener, SingleDimensionFunctionEvaluatorListener derivativeListener, double minEvalPoint, double maxEvalPoint) throws InvalidBracketRangeException
      Constructor
      Parameters:
      listener - Listener to evaluate a single dimension function f(x) to find its roots.
      derivativeListener - Listener to evaluate the function's derivative
      minEvalPoint - Smallest value inside the bracket of values where the root will be searched.
      maxEvalPoint - Largest value inside the bracket of values where the root will be searched.
      Throws:
      InvalidBracketRangeException - Raised if minEvalPoint < maxEvalPoint.
  • Method Details

    • getDerivativeListener

      public SingleDimensionFunctionEvaluatorListener getDerivativeListener() throws NotAvailableException
      Returns derivative listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.
      Returns:
      Derivative listener.
      Throws:
      NotAvailableException - if listener is not available for retrieval.
    • setDerivativeListener

      public void setDerivativeListener(SingleDimensionFunctionEvaluatorListener derivativeListener) throws LockedException
      Sets derivative listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.
      Parameters:
      derivativeListener - Derivative listener to be set.
      Throws:
      LockedException - Raised if this instance is locked.
    • isDerivativeListenerAvailable

      public boolean isDerivativeListenerAvailable()
      Returns boolean indicating whether the derivative listener has been provided and is available for retrieval.
      Returns:
      true if derivative listener is available, false otherwise
    • isReady

      public boolean isReady()
      Returns boolean indicating whether enough parameters have been provided in order to start the estimation of the roots of a function. An instance of this class is assumed to be ready when a listener, a derivative listener and a bracket have been provided or computed.
      Overrides:
      isReady in class SingleRootEstimator
      Returns:
      True if this instance is ready to start the root estimation, false otherwise.