Class SingleOptimizer

java.lang.Object
com.irurueta.numerical.optimization.Optimizer
com.irurueta.numerical.optimization.SingleOptimizer
Direct Known Subclasses:
BracketedSingleOptimizer

public abstract class SingleOptimizer extends Optimizer
Abstract class to find minima on single dimension functions. Single dimension functions are functions having a single parameter and returning a single scalar value, such as f(x).

Subclasses of this class will implement specific methods to find function minima.

  • Field Details

    • listener

      Listener to evaluate single dimension functions.
    • xmin

      protected double xmin
      Value where minimum has been found.
    • fmin

      protected double fmin
      Function evaluation at minimum that has been found.
    • resultAvailable

      protected boolean resultAvailable
      Boolean indicating whether a minimum has been found and is available for retrieval.
  • Constructor Details

    • SingleOptimizer

      protected SingleOptimizer()
      Empty constructor.
    • SingleOptimizer

      protected SingleOptimizer(SingleDimensionFunctionEvaluatorListener listener)
      Constructor with listener.
      Parameters:
      listener - Listener to evaluate a single dimension function where minima is meant to be found.
  • Method Details

    • getListener

      Returns listener to evaluate a single dimension function.
      Returns:
      Listener to evaluate a single dimension function.
      Throws:
      NotAvailableException - Raised if a listener has not yet been provided.
    • setListener

      public void setListener(SingleDimensionFunctionEvaluatorListener listener) throws LockedException
      Sets listener.
      Parameters:
      listener - Listener to evaluate a single dimension function.
      Throws:
      LockedException - Raised if this instance is locked.
    • isListenerAvailable

      public boolean isListenerAvailable()
      Returns boolean indicating whether a listener has been provided and is available for retrieval.
      Returns:
      True if listener is available, false otherwise.
    • isReady

      public boolean isReady()
      Returns true if this instance is ready to start the minimum estimation, false otherwise.
      Overrides:
      isReady in class Optimizer
      Returns:
      Boolean indicating whether this instance is ready to start the minimum estimation.
    • isResultAvailable

      public boolean isResultAvailable()
      Returns boolean indicating whether the estimated minimum is available for retrieval.
      Returns:
      True if result is available, false otherwise.
    • getResult

      public double getResult() throws NotAvailableException
      Returns value of the minimum that has been found.
      Returns:
      Value of the minimum that has been found.
      Throws:
      NotAvailableException - Raised if minimum is not yet available for retrieval.
    • getEvaluationAtResult

      public double getEvaluationAtResult() throws NotAvailableException
      Returns function evaluation at minimum that has been found.
      Returns:
      Function evaluation at minimum that has been found.
      Throws:
      NotAvailableException - raised if result is not yet available for retrieval.