public abstract class AbstractUnivariateRealOptimizer extends ConvergingAlgorithmImpl implements UnivariateRealOptimizer
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.
|
GoalType |
getGoalType() |
double |
getMax() |
int |
getMaxEvaluations()
Get the maximal number of functions evaluations.
|
double |
getMin() |
double |
getResult()
Get the result of the last run of the optimizer.
|
double |
getStartValue() |
double |
optimize(UnivariateRealFunction f,
GoalType goal,
double min,
double max)
Find an optimum in the given interval.
|
double |
optimize(UnivariateRealFunction f,
GoalType goal,
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
public double getResult()
getResult
in interface UnivariateRealOptimizer
public double getFunctionValue() throws FunctionEvaluationException
getFunctionValue
in interface UnivariateRealOptimizer
FunctionEvaluationException
- if an error occurs evaluating the function.public void setMaxEvaluations(int maxEvaluations)
setMaxEvaluations
in interface UnivariateRealOptimizer
maxEvaluations
- maximal number of function evaluationspublic int getMaxEvaluations()
getMaxEvaluations
in interface UnivariateRealOptimizer
public 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.
getEvaluations
in interface UnivariateRealOptimizer
public GoalType getGoalType()
public double getMin()
public double getMax()
public double getStartValue()
public double optimize(UnivariateRealFunction f, GoalType goal, double min, double max, double startValue) throws MaxIterationsExceededException, FunctionEvaluationException
An optimizer may require that the interval brackets a single optimum.
optimize
in interface UnivariateRealOptimizer
f
- the function to optimize.goal
- 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.FunctionEvaluationException
- if an error occurs evaluating the function.MaxIterationsExceededException
public double optimize(UnivariateRealFunction f, GoalType goal, double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException
An optimizer may require that the interval brackets a single optimum.
optimize
in interface UnivariateRealOptimizer
f
- the function to optimize.goal
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
.min
- the lower bound for the interval.max
- the upper bound for the interval.FunctionEvaluationException
- if an error occurs evaluating the function.MaxIterationsExceededException
Copyright © 2010 - 2020 Adobe. All Rights Reserved