Class BaseAbstractMultivariateOptimizer<FUNC extends MultivariateFunction>
- java.lang.Object
-
- org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer<FUNC>
-
- Type Parameters:
FUNC
- Type of the objective function to be optimized.
- All Implemented Interfaces:
BaseMultivariateOptimizer<FUNC>
,BaseOptimizer<PointValuePair>
- Direct Known Subclasses:
AbstractDifferentiableOptimizer
,AbstractScalarDifferentiableOptimizer
,BaseAbstractMultivariateSimpleBoundsOptimizer
,PowellOptimizer
,SimplexOptimizer
@Deprecated public abstract class BaseAbstractMultivariateOptimizer<FUNC extends MultivariateFunction> extends java.lang.Object implements BaseMultivariateOptimizer<FUNC>
Deprecated.As of 3.1 (to be removed in 4.0).Base class for implementing optimizers for multivariate scalar functions. This base class handles the boiler-plate methods associated to thresholds, evaluations counting, initial guess and simple bounds settings.- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description private ConvergenceChecker<PointValuePair>
checker
Deprecated.Convergence checker.protected Incrementor
evaluations
Deprecated.Evaluations counter.private MultivariateFunction
function
Deprecated.Objective function.private GoalType
goal
Deprecated.Type of optimization.private double[]
lowerBound
Deprecated.Lower bounds.private double[]
start
Deprecated.Initial guess.private double[]
upperBound
Deprecated.Upper bounds.
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseAbstractMultivariateOptimizer()
Deprecated.protected
BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
checkParameters()
Deprecated.Check parameters consistency.protected double
computeObjectiveValue(double[] point)
Deprecated.Compute the objective function value.protected abstract PointValuePair
doOptimize()
Deprecated.Perform the bulk of the optimization algorithm.ConvergenceChecker<PointValuePair>
getConvergenceChecker()
Deprecated.Get the convergence checker.int
getEvaluations()
Deprecated.Get the number of evaluations of the objective function.GoalType
getGoalType()
Deprecated.double[]
getLowerBound()
Deprecated.int
getMaxEvaluations()
Deprecated.Get the maximal number of function evaluations.double[]
getStartPoint()
Deprecated.double[]
getUpperBound()
Deprecated.PointValuePair
optimize(int maxEval, FUNC f, GoalType goalType, double[] startPoint)
Deprecated.As of 3.1.PointValuePair
optimize(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)
Deprecated.Optimize an objective function.protected PointValuePair
optimizeInternal(int maxEval, FUNC f, GoalType goalType, double[] startPoint)
Deprecated.As of 3.1.protected PointValuePair
optimizeInternal(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)
Deprecated.Optimize an objective function.private void
parseOptimizationData(OptimizationData... optData)
Deprecated.Scans the list of (required and optional) optimization data that characterize the problem.
-
-
-
Field Detail
-
evaluations
protected final Incrementor evaluations
Deprecated.Evaluations counter.
-
checker
private ConvergenceChecker<PointValuePair> checker
Deprecated.Convergence checker.
-
goal
private GoalType goal
Deprecated.Type of optimization.
-
start
private double[] start
Deprecated.Initial guess.
-
lowerBound
private double[] lowerBound
Deprecated.Lower bounds.
-
upperBound
private double[] upperBound
Deprecated.Upper bounds.
-
function
private MultivariateFunction function
Deprecated.Objective function.
-
-
Constructor Detail
-
BaseAbstractMultivariateOptimizer
@Deprecated protected BaseAbstractMultivariateOptimizer()
Deprecated.Simple constructor with default settings. The convergence check is set to aSimpleValueChecker
.
-
BaseAbstractMultivariateOptimizer
protected BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)
Deprecated.- Parameters:
checker
- Convergence checker.
-
-
Method Detail
-
getMaxEvaluations
public int getMaxEvaluations()
Deprecated.Get the maximal number of function evaluations.- Specified by:
getMaxEvaluations
in interfaceBaseOptimizer<FUNC extends MultivariateFunction>
- 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<FUNC extends MultivariateFunction>
- Returns:
- the number of evaluations of the objective function.
-
getConvergenceChecker
public ConvergenceChecker<PointValuePair> getConvergenceChecker()
Deprecated.Get the convergence checker.- Specified by:
getConvergenceChecker
in interfaceBaseOptimizer<FUNC extends MultivariateFunction>
- Returns:
- the object used to check for convergence.
-
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 the specified point.
- Throws:
TooManyEvaluationsException
- if the maximal number of evaluations is exceeded.
-
optimize
@Deprecated public PointValuePair optimize(int maxEval, FUNC f, GoalType goalType, double[] startPoint)
Deprecated.As of 3.1. Please useoptimize(int,MultivariateFunction,GoalType,OptimizationData[])
instead.Optimize an objective function.- Specified by:
optimize
in interfaceBaseMultivariateOptimizer<FUNC extends MultivariateFunction>
- Parameters:
maxEval
- Maximum number of function evaluations.f
- Objective function.goalType
- Type of optimization goal: eitherGoalType.MAXIMIZE
orGoalType.MINIMIZE
.startPoint
- Start point for optimization.- Returns:
- the point/value pair giving the optimal value for objective function.
-
optimize
public PointValuePair optimize(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)
Deprecated.Optimize an objective function.- Parameters:
maxEval
- Allowed number of evaluations of the objective function.f
- Objective function.goalType
- Optimization type.optData
- Optimization data. The following data will be looked for:- Returns:
- the point/value pair giving the optimal value of the objective function.
- Since:
- 3.1
-
optimizeInternal
@Deprecated protected PointValuePair optimizeInternal(int maxEval, FUNC f, GoalType goalType, double[] startPoint)
Deprecated.As of 3.1. Please useoptimize(int,MultivariateFunction,GoalType,OptimizationData[])
instead.Optimize an objective function.- Parameters:
f
- Objective function.goalType
- Type of optimization goal: eitherGoalType.MAXIMIZE
orGoalType.MINIMIZE
.startPoint
- Start point for optimization.maxEval
- Maximum number of function evaluations.- Returns:
- the point/value pair giving the optimal value for objective function.
- Throws:
DimensionMismatchException
- if the start point dimension is wrong.TooManyEvaluationsException
- if the maximal number of evaluations is exceeded.NullArgumentException
- if any argument isnull
.
-
optimizeInternal
protected PointValuePair optimizeInternal(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData) throws TooManyEvaluationsException
Deprecated.Optimize an objective function.- Parameters:
maxEval
- Allowed number of evaluations of the objective function.f
- Objective function.goalType
- Optimization type.optData
- Optimization data. The following data will be looked for:- Returns:
- the point/value pair giving the optimal value of the objective function.
- Throws:
TooManyEvaluationsException
- if the maximal number of evaluations is exceeded.- Since:
- 3.1
-
parseOptimizationData
private void parseOptimizationData(OptimizationData... optData)
Deprecated.Scans the list of (required and optional) optimization data that characterize the problem.- Parameters:
optData
- Optimization data. The following data will be looked for:
-
getGoalType
public GoalType getGoalType()
Deprecated.- Returns:
- the optimization type.
-
getStartPoint
public double[] getStartPoint()
Deprecated.- Returns:
- the initial guess.
-
getLowerBound
public double[] getLowerBound()
Deprecated.- Returns:
- the lower bounds.
- Since:
- 3.1
-
getUpperBound
public double[] getUpperBound()
Deprecated.- Returns:
- the upper bounds.
- Since:
- 3.1
-
doOptimize
protected abstract PointValuePair doOptimize()
Deprecated.Perform the bulk of the optimization algorithm.- Returns:
- the point/value pair giving the optimal value of the objective function.
-
checkParameters
private void checkParameters()
Deprecated.Check parameters consistency.
-
-