public interface UnivariateRealOptimizer extends ConvergingAlgorithm
Modifier and Type | Method and Description |
---|---|
int |
getEvaluations()
Get the number of evaluations of the objective function.
|
double |
getFunctionValue()
Get the result of the last run of the optimizer.
|
int |
getMaxEvaluations()
Get the maximal number of functions evaluations.
|
double |
getResult()
Get the result of the last run of the optimizer.
|
double |
optimize(UnivariateRealFunction f,
GoalType goalType,
double min,
double max)
Find an optimum in the given interval.
|
double |
optimize(UnivariateRealFunction f,
GoalType goalType,
double min,
double max,
double startValue)
Find an optimum in the given interval, start at startValue.
|
void |
setMaxEvaluations(int maxEvaluations)
Set the maximal number of functions evaluations.
|
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
void setMaxEvaluations(int maxEvaluations)
maxEvaluations
- maximal number of function evaluationsint getMaxEvaluations()
int getEvaluations()
The number of evaluations corresponds to the last call to the
optimize
method. It is 0 if the method has not been called yet.
double optimize(UnivariateRealFunction f, GoalType goalType, double min, double max) throws ConvergenceException, FunctionEvaluationException
An optimizer may require that the interval brackets a single optimum.
f
- the function to optimize.goalType
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
.min
- the lower bound for the interval.max
- the upper bound for the interval.ConvergenceException
- if the maximum iteration count is exceeded
or the optimizer detects convergence problems otherwise.FunctionEvaluationException
- if an error occurs evaluating the function.java.lang.IllegalArgumentException
- if min > max or the endpoints do not
satisfy the requirements specified by the optimizer.double optimize(UnivariateRealFunction f, GoalType goalType, double min, double max, double startValue) throws ConvergenceException, FunctionEvaluationException
An optimizer may require that the interval brackets a single optimum.
f
- the function to optimize.goalType
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
.min
- the lower bound for the interval.max
- the upper bound for the interval.startValue
- the start value to use.ConvergenceException
- if the maximum iteration count is exceeded
or the optimizer detects convergence problems otherwise.FunctionEvaluationException
- if an error occurs evaluating the function.java.lang.IllegalArgumentException
- if min > max or the arguments do not
satisfy the requirements specified by the optimizer.java.lang.IllegalStateException
- if there are no data.double getResult()
java.lang.IllegalStateException
- if there is no result available, either
because no result was yet computed or the last attempt failed.double getFunctionValue() throws FunctionEvaluationException
FunctionEvaluationException
- if an error occurs evaluating the function.java.lang.IllegalStateException
- if there is no result available, either
because no result was yet computed or the last attempt failed.Copyright © 2010 - 2020 Adobe. All Rights Reserved