org.apache.commons.math3.optimization.direct

## 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.
As of 3.1 (to be removed in 4.0).

    @Deprecated
    public abstract class BaseAbstractMultivariateOptimizer<FUNC extends MultivariateFunction>
    extends java.lang.Object
    implements BaseMultivariateOptimizer<FUNC>

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
Version:
  $Id: BaseAbstractMultivariateOptimizer.java 1422313 2012-12-15 18:53:41Z psteitz $

### Field Summary

Fields
`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
`protected` `BaseAbstractMultivariateOptimizer()` Deprecated. See `SimpleValueChecker.SimpleValueChecker()`
`protected` `BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)` Deprecated.

### Method Summary

Methods
`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. Please use `optimize(int,MultivariateFunction,GoalType,OptimizationData[])` instead.
`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. Please use `optimize(int,MultivariateFunction,GoalType,OptimizationData[])` instead.
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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. See `SimpleValueChecker.SimpleValueChecker()`
Simple constructor with default settings. The convergence check is set to a `SimpleValueChecker`.

#### 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 interface `BaseOptimizer<PointValuePair>`
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 the `optimize` method. It is 0 if the method has not been called yet.

Specified by:
  `getEvaluations` in interface `BaseOptimizer<PointValuePair>`
Returns:
  the number of evaluations of the objective function.

#### getConvergenceChecker

    public ConvergenceChecker<PointValuePair> getConvergenceChecker()

Deprecated.
Get the convergence checker.

Specified by:
  `getConvergenceChecker` in interface `BaseOptimizer<PointValuePair>`
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 use `optimize(int,MultivariateFunction,GoalType,OptimizationData[])` instead.
Optimize an objective function.

Specified by:
  `optimize` in interface `BaseMultivariateOptimizer<FUNC extends MultivariateFunction>`
Parameters:
  `maxEval` - Maximum number of function evaluations.
  `f` - Objective function.
  `goalType` - Type of optimization goal: either `GoalType.MAXIMIZE` or `GoalType.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:
  - `InitialGuess`
  - `SimpleBounds`
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 use `optimize(int,MultivariateFunction,GoalType,OptimizationData[])` instead.
Optimize an objective function.

Parameters:
  `f` - Objective function.
  `goalType` - Type of optimization goal: either `GoalType.MAXIMIZE` or `GoalType.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 is `null`.

#### 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:
  - `InitialGuess`
  - `SimpleBounds`
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:
  - `InitialGuess`
  - `SimpleBounds`

#### 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.