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>checkerDeprecated.Convergence checker.protected IncrementorevaluationsDeprecated.Evaluations counter.private MultivariateFunctionfunctionDeprecated.Objective function.private GoalTypegoalDeprecated.Type of optimization.private double[]lowerBoundDeprecated.Lower bounds.private double[]startDeprecated.Initial guess.private double[]upperBoundDeprecated.Upper bounds.
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseAbstractMultivariateOptimizer()Deprecated.protectedBaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcheckParameters()Deprecated.Check parameters consistency.protected doublecomputeObjectiveValue(double[] point)Deprecated.Compute the objective function value.protected abstract PointValuePairdoOptimize()Deprecated.Perform the bulk of the optimization algorithm.ConvergenceChecker<PointValuePair>getConvergenceChecker()Deprecated.Get the convergence checker.intgetEvaluations()Deprecated.Get the number of evaluations of the objective function.GoalTypegetGoalType()Deprecated.double[]getLowerBound()Deprecated.intgetMaxEvaluations()Deprecated.Get the maximal number of function evaluations.double[]getStartPoint()Deprecated.double[]getUpperBound()Deprecated.PointValuePairoptimize(int maxEval, FUNC f, GoalType goalType, double[] startPoint)Deprecated.As of 3.1.PointValuePairoptimize(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)Deprecated.Optimize an objective function.protected PointValuePairoptimizeInternal(int maxEval, FUNC f, GoalType goalType, double[] startPoint)Deprecated.As of 3.1.protected PointValuePairoptimizeInternal(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)Deprecated.Optimize an objective function.private voidparseOptimizationData(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:
getMaxEvaluationsin 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 theoptimizemethod. It is 0 if the method has not been called yet.- Specified by:
getEvaluationsin 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:
getConvergenceCheckerin 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:
optimizein interfaceBaseMultivariateOptimizer<FUNC extends MultivariateFunction>- Parameters:
maxEval- Maximum number of function evaluations.f- Objective function.goalType- Type of optimization goal: eitherGoalType.MAXIMIZEorGoalType.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.MAXIMIZEorGoalType.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.
-
-