Top Description Fields Constructors Methods
org.apache.commons.math3.optimization.direct

public abstract Class BaseAbstractMultivariateOptimizer<FUNC extends MultivariateFunction>

extends Object
implements BaseMultivariateOptimizer<FUNC extends MultivariateFunction>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optimization.BaseMultivariateOptimizer, org.apache.commons.math3.optimization.BaseOptimizer
Known Direct Subclasses
org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateSimpleBoundsOptimizer, org.apache.commons.math3.optimization.direct.PowellOptimizer, org.apache.commons.math3.optimization.direct.SimplexOptimizer, org.apache.commons.math3.optimization.general.AbstractDifferentiableOptimizer, org.apache.commons.math3.optimization.general.AbstractScalarDifferentiableOptimizer
Annotations
@Deprecated
Type Parameters
<FUNC>
Type of the objective function to be optimized.
Imports
org.apache.commons.math3.util.Incrementor, org.apache.commons.math3.exception.MaxCountExceededException, .TooManyEvaluationsException, .DimensionMismatchException, .NumberIsTooSmallException, .NumberIsTooLargeException, org.apache.commons.math3.analysis.MultivariateFunction, org.apache.commons.math3.optimization.BaseMultivariateOptimizer, .OptimizationData, .GoalType, .InitialGuess, .SimpleBounds, .ConvergenceChecker, .PointValuePair, .SimpleValueChecker

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

Modifier and TypeField and Description
private ConvergenceChecker<PointValuePair>
checker

Deprecated as a consequence of ConvergenceChecker being deprecated.
Convergence checker.
protected final Incrementor
evaluations

Deprecated as a consequence of Incrementor being deprecated.
Evaluations counter.
private MultivariateFunction
function

Objective function.

private GoalType
goal

Deprecated as a consequence of GoalType being deprecated.
Type of optimization.
private double[]
lowerBound

Lower bounds.

private double[]
start

Initial guess.

private double[]
upperBound

Upper bounds.

Constructor Summary

AccessConstructor and Description
protected
BaseAbstractMultivariateOptimizer()

Simple constructor with default settings.

protected
BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair>
Convergence checker.
checker
)
Deprecated as a consequence of ConvergenceChecker being deprecated.

Method Summary

Modifier and TypeMethod and Description
private void
checkParameters()

Check parameters consistency.

protected double

Returns:

the objective function value at the specified point.
computeObjectiveValue
(double[]
Point at which the objective function must be evaluated.
point
)

Compute the objective function value.

protected abstract PointValuePair

Returns:

the point/value pair giving the optimal value of the objective function.
doOptimize
()
Deprecated as a consequence of PointValuePair being deprecated.

Perform the bulk of the optimization algorithm.

public ConvergenceChecker<PointValuePair>
getConvergenceChecker()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getConvergenceChecker.

Deprecated as a consequence of ConvergenceChecker being deprecated.

Get the convergence checker.

public int
getEvaluations()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getEvaluations.

Get the number of evaluations of the objective function.

public GoalType

Returns:

the optimization type.
getGoalType
()
Deprecated as a consequence of GoalType being deprecated.

public double[]

Returns:

the lower bounds.
getLowerBound
()

public int
getMaxEvaluations()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getMaxEvaluations.

Get the maximal number of function evaluations.

public double[]

Returns:

the initial guess.
getStartPoint
()

public double[]

Returns:

the upper bounds.
getUpperBound
()

public PointValuePair
optimize(int
Maximum number of function evaluations.
maxEval
,
FUNC
Objective function.
f
,
GoalType
Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.
goalType
,
double[]
Start point for optimization.
startPoint
)

Implements org.apache.commons.math3.optimization.BaseMultivariateOptimizer.optimize.

Deprecated As of 3.1.

Optimize an objective function.

public PointValuePair

Returns:

the point/value pair giving the optimal value of the objective function.
optimize
(int
Allowed number of evaluations of the objective function.
maxEval
,
FUNC
Objective function.
f
,
GoalType
Optimization type.
goalType
,
OptimizationData...
Optimization data. The following data will be looked for:
optData
)
Deprecated as a consequence of GoalType, OptimizationData and PointValuePair being deprecated.

Optimize an objective function.

protected PointValuePair

Returns:

the point/value pair giving the optimal value for objective function.
optimizeInternal
(int
Maximum number of function evaluations.
maxEval
,
FUNC
Objective function.
f
,
GoalType
Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.
goalType
,
double[]
Start point for optimization.
startPoint
)
Deprecated As of 3.1.

Optimize an objective function.

protected PointValuePair

Returns:

the point/value pair giving the optimal value of the objective function.
optimizeInternal
(int
Allowed number of evaluations of the objective function.
maxEval
,
FUNC
Objective function.
f
,
GoalType
Optimization type.
goalType
,
OptimizationData...
Optimization data. The following data will be looked for:
optData
)
Deprecated as a consequence of GoalType, OptimizationData and PointValuePair being deprecated.

Optimize an objective function.

private void
parseOptimizationData(OptimizationData...
Optimization data. The following data will be looked for:
optData
)
Deprecated as a consequence of OptimizationData being deprecated.

Scans the list of (required and optional) optimization data that characterize the problem.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkerback to summary
private ConvergenceChecker<PointValuePair> checker

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

Convergence checker.

evaluationsback to summary
protected final Incrementor evaluations

Deprecated

as a consequence of Incrementor being deprecated. See corresponding docs for further information.

Evaluations counter.

functionback to summary
private MultivariateFunction function

Objective function.

goalback to summary
private GoalType goal

Deprecated

as a consequence of GoalType being deprecated. See corresponding docs for further information.

Type of optimization.

lowerBoundback to summary
private double[] lowerBound

Lower bounds.

startback to summary
private double[] start

Initial guess.

upperBoundback to summary
private double[] upperBound

Upper bounds.

Constructor Detail

BaseAbstractMultivariateOptimizerback to summary
protected BaseAbstractMultivariateOptimizer()

Simple constructor with default settings. The convergence check is set to a SimpleValueChecker.

Annotations
@Deprecated
BaseAbstractMultivariateOptimizerback to summary
protected BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

Parameters
checker:ConvergenceChecker<PointValuePair>

Convergence checker.

Method Detail

checkParametersback to summary
private void checkParameters()

Check parameters consistency.

computeObjectiveValueback to summary
protected double computeObjectiveValue(double[] point)

Compute the objective function value.

Parameters
point:double[]

Point at which the objective function must be evaluated.

Returns:double

the objective function value at the specified point.

Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
doOptimizeback to summary
protected abstract PointValuePair doOptimize()

Deprecated

as a consequence of PointValuePair being deprecated. See corresponding docs for further information.

Perform the bulk of the optimization algorithm.

Returns:PointValuePair

the point/value pair giving the optimal value of the objective function.

getConvergenceCheckerback to summary
public ConvergenceChecker<PointValuePair> getConvergenceChecker()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getConvergenceChecker.

Doc from org.apache.commons.math3.optimization.BaseOptimizer.getConvergenceChecker.

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

Get the convergence checker.

Returns:ConvergenceChecker<PointValuePair>

the object used to check for convergence.

getEvaluationsback to summary
public int getEvaluations()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getEvaluations.

Doc from org.apache.commons.math3.optimization.BaseOptimizer.getEvaluations.

Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the optimize method. It is 0 if the method has not been called yet.

Returns:int

the number of evaluations of the objective function.

getGoalTypeback to summary
public GoalType getGoalType()

Deprecated

as a consequence of GoalType being deprecated. See corresponding docs for further information.

Returns:GoalType

the optimization type.

getLowerBoundback to summary
public double[] getLowerBound()
Returns:double[]

the lower bounds.

Since
3.1
getMaxEvaluationsback to summary
public int getMaxEvaluations()

Implements org.apache.commons.math3.optimization.BaseOptimizer.getMaxEvaluations.

Doc from org.apache.commons.math3.optimization.BaseOptimizer.getMaxEvaluations.

Get the maximal number of function evaluations.

Returns:int

the maximal number of function evaluations.

getStartPointback to summary
public double[] getStartPoint()
Returns:double[]

the initial guess.

getUpperBoundback to summary
public double[] getUpperBound()
Returns:double[]

the upper bounds.

Since
3.1
optimizeback to summary
public PointValuePair optimize(int maxEval, FUNC f, GoalType goalType, double[] startPoint)

Implements org.apache.commons.math3.optimization.BaseMultivariateOptimizer.optimize.

Doc from org.apache.commons.math3.optimization.BaseMultivariateOptimizer.optimize.

Optimize an objective function.

Parameters
maxEval:int

Maximum number of function evaluations.

f:FUNC

Objective function.

goalType:GoalType

Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.

startPoint:double[]

Start point for optimization.

Returns:PointValuePair

the point/value pair giving the optimal value for objective function.

Annotations
@Deprecated
optimizeback to summary
public PointValuePair optimize(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData)

Deprecated

as a consequence of GoalType, OptimizationData and PointValuePair being deprecated. See corresponding docs for further information.

Optimize an objective function.

Parameters
maxEval:int

Allowed number of evaluations of the objective function.

f:FUNC

Objective function.

goalType:GoalType

Optimization type.

optData:OptimizationData[]

Optimization data. The following data will be looked for:

Returns:PointValuePair

the point/value pair giving the optimal value of the objective function.

Since
3.1
optimizeInternalback to summary
protected PointValuePair optimizeInternal(int maxEval, FUNC f, GoalType goalType, double[] startPoint)

Optimize an objective function.

Parameters
maxEval:int

Maximum number of function evaluations.

f:FUNC

Objective function.

goalType:GoalType

Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.

startPoint:double[]

Start point for optimization.

Returns:PointValuePair

the point/value pair giving the optimal value for objective function.

Annotations
@Deprecated
Exceptions
DimensionMismatchException:
if the start point dimension is wrong.
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
NullArgumentException:
if any argument is null.
optimizeInternalback to summary
protected PointValuePair optimizeInternal(int maxEval, FUNC f, GoalType goalType, OptimizationData... optData) throws TooManyEvaluationsException

Deprecated

as a consequence of GoalType, OptimizationData and PointValuePair being deprecated. See corresponding docs for further information.

Optimize an objective function.

Parameters
maxEval:int

Allowed number of evaluations of the objective function.

f:FUNC

Objective function.

goalType:GoalType

Optimization type.

optData:OptimizationData[]

Optimization data. The following data will be looked for:

Returns:PointValuePair

the point/value pair giving the optimal value of the objective function.

Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
Since
3.1
parseOptimizationDataback to summary
private void parseOptimizationData(OptimizationData... optData)

Deprecated

as a consequence of OptimizationData being deprecated. See corresponding docs for further information.

Scans the list of (required and optional) optimization data that characterize the problem.

Parameters
optData:OptimizationData[]

Optimization data. The following data will be looked for: