Class SingleRootEstimator

java.lang.Object
com.irurueta.numerical.roots.RootEstimator
com.irurueta.numerical.roots.SingleRootEstimator
Direct Known Subclasses:
BracketedSingleRootEstimator

public abstract class SingleRootEstimator extends RootEstimator
Abstract class to find roots of single dimension functions. A root is the locus of points (set of points) where the value of a given function equals to zero. A single dimension function is one containing a single parameter and returning a single value (i.e. f(x)). Usually root estimators will only find a single root around an initial coarsely estimated solution.
  • Field Details

    • listener

      Listener that evaluates a single dimension function in order to find its root.
    • rootAvailable

      protected boolean rootAvailable
      Boolean indicating that a root has been computed and is available to be retrieved.
    • root

      protected double root
      Root that has been found.
  • Constructor Details

    • SingleRootEstimator

      protected SingleRootEstimator()
      Empty constructor.
    • SingleRootEstimator

      protected SingleRootEstimator(SingleDimensionFunctionEvaluatorListener listener)
      Constructor.
      Parameters:
      listener - Listener that evaluates a single dimension function in order to find its root.
  • Method Details

    • getListener

      Returns listener that evaluates a single dimension function in order to find its root.
      Returns:
      Listener that evaluates a single dimension function.
      Throws:
      NotAvailableException - Raised if listener has not yet been provided.
    • setListener

      public void setListener(SingleDimensionFunctionEvaluatorListener listener) throws LockedException
      Sets listener that evaluates a single dimension function in order to find its root.
      Parameters:
      listener - Listener that evaluates a single dimension function.
      Throws:
      LockedException - Raised if this instance is already locked.
    • isListenerAvailable

      public boolean isListenerAvailable()
      Returns boolean indicating whether a listener has been provided.
      Returns:
      True if 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.
      Overrides:
      isReady in class RootEstimator
      Returns:
      True if this instance is ready to start the root estimation, false otherwise.
    • isRootAvailable

      public boolean isRootAvailable()
      Returns boolean indicating whether a root has been estimated and is available for retrieval.
      Returns:
      True if root is available, false otherwise.
    • getRoot

      public double getRoot() throws NotAvailableException
      Returns estimated root for a single dimension function inside a given bracket of values.
      Returns:
      Estimated root.
      Throws:
      NotAvailableException - Raised if root has not yet been estimated.