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

public abstract Class BaseAbstractMultivariateVectorOptimizer<FUNC extends MultivariateVectorFunction>

extends Object
implements BaseMultivariateVectorOptimizer<FUNC extends MultivariateVectorFunction>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optimization.BaseMultivariateVectorOptimizer, org.apache.commons.math3.optimization.BaseOptimizer
Known Direct Subclasses
org.apache.commons.math3.optimization.general.AbstractLeastSquaresOptimizer
Annotations
@Deprecated
Type Parameters
<FUNC>
the type of the objective function to be optimized
Imports
org.apache.commons.math3.util.Incrementor, org.apache.commons.math3.exception.MaxCountExceededException, .TooManyEvaluationsException, .DimensionMismatchException, .NullArgumentException, org.apache.commons.math3.analysis.MultivariateVectorFunction, org.apache.commons.math3.optimization.OptimizationData, .InitialGuess, .Target, .Weight, .BaseMultivariateVectorOptimizer, .ConvergenceChecker, .PointVectorValuePair, .SimpleVectorValueChecker, org.apache.commons.math3.linear.RealMatrix

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 settings, iterations and evaluations counting.
Since
3.0

Field Summary

Modifier and TypeField and Description
private ConvergenceChecker<PointVectorValuePair>
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 FUNC
function

Objective function.

private double[]
start

Initial guess.

private double[]
target

Target value for the objective functions at optimum.

private double[]
weight

Deprecated
Weight for the least squares cost computation.
private RealMatrix
weightMatrix

Weight matrix.

Constructor Summary

AccessConstructor and Description
protected
BaseAbstractMultivariateVectorOptimizer()

Simple constructor with default settings.

protected
BaseAbstractMultivariateVectorOptimizer(ConvergenceChecker<PointVectorValuePair>
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 PointVectorValuePair

Returns:

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

Perform the bulk of the optimization algorithm.

public ConvergenceChecker<PointVectorValuePair>
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 int
getMaxEvaluations()

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

Get the maximal number of function evaluations.

protected FUNC

Returns:

the objective vector function.
getObjectiveFunction
()

Gets the objective vector function.

public double[]

Returns:

the initial guess.
getStartPoint
()

Gets the initial values of the optimized parameters.

public double[]

Returns:

the target values.
getTarget
()

Gets the observed values to be matched by the objective vector function.

protected double[]

Returns:

a reference to the array.
getTargetRef
()
Deprecated As of 3.1.

public RealMatrix

Returns:

the weight matrix.
getWeight
()

Gets the weight matrix of the observations.

protected double[]

Returns:

a reference to the array.
getWeightRef
()
Deprecated As of 3.1.

public PointVectorValuePair
optimize(int
Maximum number of function evaluations.
maxEval
,
FUNC
Objective function.
f
,
double[]
Target value for the objective functions at optimum.
t
,
double[]
Weights for the least squares cost computation.
w
,
double[]
Start point for optimization.
startPoint
)

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

Deprecated As of 3.1.

Optimize an objective function.

protected PointVectorValuePair

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
,
OptimizationData...
Optimization data. The following data will be looked for:
optData
)
Deprecated as a consequence of OptimizationData and PointVectorValuePair being deprecated.

Optimize an objective function.

protected PointVectorValuePair

Returns:

the point/value pair giving the optimal value for objective function.
optimizeInternal
(final int
Maximum number of function evaluations.
maxEval
,
final FUNC
Objective function.
f
,
final double[]
Target value for the objective functions at optimum.
t
,
final double[]
Weights for the least squares cost computation.
w
,
final double[]
Start point for optimization.
startPoint
)
Deprecated As of 3.1.

Optimize an objective function.

protected PointVectorValuePair

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
,
OptimizationData...
Optimization data. The following data will be looked for:
optData
)
Deprecated as a consequence of OptimizationData and PointVectorValuePair 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.

protected void
setUp()

Method which a subclass must override whenever its internal state depend on the input parsed by this base class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkerback to summary
private ConvergenceChecker<PointVectorValuePair> 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 FUNC function

Objective function.

startback to summary
private double[] start

Initial guess.

targetback to summary
private double[] target

Target value for the objective functions at optimum.

weightback to summary
private double[] weight

Deprecated

Weight for the least squares cost computation.

Annotations
@Deprecated
weightMatrixback to summary
private RealMatrix weightMatrix

Weight matrix.

Constructor Detail

BaseAbstractMultivariateVectorOptimizerback to summary
protected BaseAbstractMultivariateVectorOptimizer()

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

Annotations
@Deprecated
BaseAbstractMultivariateVectorOptimizerback to summary
protected BaseAbstractMultivariateVectorOptimizer(ConvergenceChecker<PointVectorValuePair> checker)

Deprecated

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

Parameters
checker:ConvergenceChecker<PointVectorValuePair>

Convergence checker.

Method Detail

checkParametersback to summary
private void checkParameters()

Check parameters consistency.

Exceptions
DimensionMismatchException:
if target and weightMatrix have inconsistent dimensions.
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 PointVectorValuePair doOptimize()

Deprecated

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

Perform the bulk of the optimization algorithm.

Returns:PointVectorValuePair

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

getConvergenceCheckerback to summary
public ConvergenceChecker<PointVectorValuePair> 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<PointVectorValuePair>

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.

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.

getObjectiveFunctionback to summary
protected FUNC getObjectiveFunction()

Gets the objective vector function. Note that this access bypasses the evaluation counter.

Returns:FUNC

the objective vector function.

Since
3.1
getStartPointback to summary
public double[] getStartPoint()

Gets the initial values of the optimized parameters.

Returns:double[]

the initial guess.

getTargetback to summary
public double[] getTarget()

Gets the observed values to be matched by the objective vector function.

Returns:double[]

the target values.

Since
3.1
getTargetRefback to summary
protected double[] getTargetRef()

Deprecated

As of 3.1.

Returns:double[]

a reference to the array.

Annotations
@Deprecated
getWeightback to summary
public RealMatrix getWeight()

Gets the weight matrix of the observations.

Returns:RealMatrix

the weight matrix.

Since
3.1
getWeightRefback to summary
protected double[] getWeightRef()

Deprecated

As of 3.1.

Returns:double[]

a reference to the array.

Annotations
@Deprecated
optimizeback to summary
public PointVectorValuePair optimize(int maxEval, FUNC f, double[] t, double[] w, double[] startPoint)

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

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

Deprecated

As of 3.1. Please use optimize(int, MultivariateVectorFunction, OptimizationData[]) instead.

Optimize an objective function. Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is ∑weighti(objectivei - targeti)2

Parameters
maxEval:int

Maximum number of function evaluations.

f:FUNC

Objective function.

t:double[]

Target value for the objective functions at optimum.

w:double[]

Weights for the least squares cost computation.

startPoint:double[]

Start point for optimization.

Returns:PointVectorValuePair

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

Annotations
@Deprecated
optimizeback to summary
protected PointVectorValuePair optimize(int maxEval, FUNC f, OptimizationData... optData) throws TooManyEvaluationsException, DimensionMismatchException

Deprecated

as a consequence of OptimizationData and PointVectorValuePair 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.

optData:OptimizationData[]

Optimization data. The following data will be looked for:

Returns:PointVectorValuePair

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

Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
DimensionMismatchException:
if the initial guess, target, and weight arguments have inconsistent dimensions.
Since
3.1
optimizeInternalback to summary
protected PointVectorValuePair optimizeInternal(final int maxEval, final FUNC f, final double[] t, final double[] w, final double[] startPoint)

Optimize an objective function. Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is ∑weighti(objectivei - targeti)2

Parameters
maxEval:int

Maximum number of function evaluations.

f:FUNC

Objective function.

t:double[]

Target value for the objective functions at optimum.

w:double[]

Weights for the least squares cost computation.

startPoint:double[]

Start point for optimization.

Returns:PointVectorValuePair

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 PointVectorValuePair optimizeInternal(int maxEval, FUNC f, OptimizationData... optData) throws TooManyEvaluationsException, DimensionMismatchException

Deprecated

as a consequence of OptimizationData and PointVectorValuePair 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.

optData:OptimizationData[]

Optimization data. The following data will be looked for:

Returns:PointVectorValuePair

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

Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
DimensionMismatchException:
if the initial guess, target, and weight arguments have inconsistent dimensions.
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:

setUpback to summary
protected void setUp()

Method which a subclass must override whenever its internal state depend on the input parsed by this base class. It will be called after the parsing step performed in the optimize method and just before doOptimize().

Since
3.1