Class BaseAbstractUnivariateOptimizer
java.lang.Object
org.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer
- All Implemented Interfaces:
BaseOptimizer<UnivariatePointValuePair>
,BaseUnivariateOptimizer<UnivariateFunction>
,UnivariateOptimizer
- Direct Known Subclasses:
BrentOptimizer
@Deprecated
public abstract class BaseAbstractUnivariateOptimizer
extends Object
implements UnivariateOptimizer
Deprecated.
As of 3.1 (to be removed in 4.0).
Provide a default implementation for several functions useful to generic
optimizers.
- Since:
- 2.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected double
computeObjectiveValue
(double point) Deprecated.Compute the objective function value.protected abstract UnivariatePointValuePair
Deprecated.Method for implementing actual optimization algorithms in derived classes.Deprecated.Get the convergence checker.int
Deprecated.Get the number of evaluations of the objective function.Deprecated.double
getMax()
Deprecated.int
Deprecated.Get the maximal number of function evaluations.double
getMin()
Deprecated.double
Deprecated.optimize
(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max) Deprecated.Find an optimum in the given interval.optimize
(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue) Deprecated.Find an optimum in the given interval, start at startValue.
-
Constructor Details
-
BaseAbstractUnivariateOptimizer
Deprecated.- Parameters:
checker
- Convergence checking procedure.
-
-
Method Details
-
getMaxEvaluations
public int getMaxEvaluations()Deprecated.Get the maximal number of function evaluations.- Specified by:
getMaxEvaluations
in interfaceBaseOptimizer<UnivariatePointValuePair>
- Returns:
- the maximal number of function evaluations.
-
getEvaluations
public int getEvaluations()Deprecated.Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to theoptimize
method. It is 0 if the method has not been called yet.- Specified by:
getEvaluations
in interfaceBaseOptimizer<UnivariatePointValuePair>
- Returns:
- the number of evaluations of the objective function.
-
getGoalType
Deprecated.- Returns:
- the optimization type.
-
getMin
public double getMin()Deprecated.- Returns:
- the lower end of the search interval.
-
getMax
public double getMax()Deprecated.- Returns:
- the higher end of the search interval.
-
getStartValue
public double getStartValue()Deprecated.- Returns:
- the initial guess.
-
computeObjectiveValue
protected double computeObjectiveValue(double point) Deprecated.Compute the objective function value.- Parameters:
point
- Point at which the objective function must be evaluated.- Returns:
- the objective function value at specified point.
- Throws:
TooManyEvaluationsException
- if the maximal number of evaluations is exceeded.
-
optimize
public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue) Deprecated.Find an optimum in the given interval, start at startValue. An optimizer may require that the interval brackets a single optimum.- Specified by:
optimize
in interfaceBaseUnivariateOptimizer<UnivariateFunction>
- Parameters:
maxEval
- Maximum number of function evaluations.f
- Function to optimize.goalType
- Type of optimization goal: eitherGoalType.MAXIMIZE
orGoalType.MINIMIZE
.min
- Lower bound for the interval.max
- Upper bound for the interval.startValue
- Start value to use.- Returns:
- a (point, value) pair where the function is optimum.
-
optimize
public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max) Deprecated.Find an optimum in the given interval. An optimizer may require that the interval brackets a single optimum.- Specified by:
optimize
in interfaceBaseUnivariateOptimizer<UnivariateFunction>
- Parameters:
maxEval
- Maximum number of function evaluations.f
- Function to optimize.goalType
- Type of optimization goal: eitherGoalType.MAXIMIZE
orGoalType.MINIMIZE
.min
- Lower bound for the interval.max
- Upper bound for the interval.- Returns:
- a (point, value) pair where the function is optimum.
-
getConvergenceChecker
Deprecated.Get the convergence checker.- Specified by:
getConvergenceChecker
in interfaceBaseOptimizer<UnivariatePointValuePair>
- Returns:
- the object used to check for convergence.
-
doOptimize
Deprecated.Method for implementing actual optimization algorithms in derived classes.- Returns:
- the optimum and its corresponding function value.
- Throws:
TooManyEvaluationsException
- if the maximal number of evaluations is exceeded.
-