Class SingleOptimizer
java.lang.Object
com.irurueta.numerical.optimization.Optimizer
com.irurueta.numerical.optimization.SingleOptimizer
- Direct Known Subclasses:
BracketedSingleOptimizer
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 Summary
FieldsModifier and TypeFieldDescriptionprotected double
Function evaluation at minimum that has been found.protected SingleDimensionFunctionEvaluatorListener
Listener to evaluate single dimension functions.protected boolean
Boolean indicating whether a minimum has been found and is available for retrieval.protected double
Value where minimum has been found.Fields inherited from class com.irurueta.numerical.optimization.Optimizer
iterationCompletedListener, locked
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Empty constructor.protected
Constructor with listener. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns function evaluation at minimum that has been found.Returns listener to evaluate a single dimension function.double
Returns value of the minimum that has been found.boolean
Returns boolean indicating whether a listener has been provided and is available for retrieval.boolean
isReady()
Returns true if this instance is ready to start the minimum estimation, false otherwise.boolean
Returns boolean indicating whether the estimated minimum is available for retrieval.void
Sets listener.Methods inherited from class com.irurueta.numerical.optimization.Optimizer
getOnIterationCompletedListener, isLocked, minimize, setOnIterationCompletedListener
-
Field Details
-
listener
Listener to evaluate single dimension functions. -
xmin
protected double xminValue where minimum has been found. -
fmin
protected double fminFunction evaluation at minimum that has been found. -
resultAvailable
protected boolean resultAvailableBoolean indicating whether a minimum has been found and is available for retrieval.
-
-
Constructor Details
-
SingleOptimizer
protected SingleOptimizer()Empty constructor. -
SingleOptimizer
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
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. -
isResultAvailable
public boolean isResultAvailable()Returns boolean indicating whether the estimated minimum is available for retrieval.- Returns:
- True if result is available, false otherwise.
-
getResult
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
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.
-