Top Description Fields Constructors Methods
org.apache.commons.math3.optim.univariate

public abstract Class UnivariateOptimizer

extends BaseOptimizer<UnivariatePointValuePair>
Class Inheritance
Known Direct Subclasses
org.apache.commons.math3.optim.univariate.BrentOptimizer, org.apache.commons.math3.optim.univariate.MultiStartUnivariateOptimizer
Imports
org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.optim.BaseOptimizer, .OptimizationData, .ConvergenceChecker, org.apache.commons.math3.optim.nonlinear.scalar.GoalType, org.apache.commons.math3.exception.TooManyEvaluationsException

Base class for a univariate scalar function optimizer.
Since
3.1

Field Summary

Modifier and TypeField and Description
private UnivariateFunction
function

Objective function.

private GoalType
goal

Type of optimization.

private double
max

Upper bound.

private double
min

Lower bound.

private double
start

Initial guess.

Inherited from org.apache.commons.math3.optim.BaseOptimizer:
evaluationsiterations

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected double

Returns:

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

Computes the objective function value.

public GoalType

Returns:

the optimization type.
getGoalType
()

public double

Returns:

the upper bounds.
getMax
()

public double

Returns:

the lower bounds.
getMin
()

public double

Returns:

the initial guess.
getStartValue
()

public UnivariatePointValuePair

Returns:

a point/value pair that satisfies the convergence criteria.
optimize
(OptimizationData...
Optimization data. In addition to those documented in BaseOptimizer, this method will register the following data:
optData
)

Overrides org.apache.commons.math3.optim.BaseOptimizer.optimize.

Stores data and performs the optimization.

protected void
parseOptimizationData(OptimizationData...
Optimization data. The following data will be looked for:
optData
)

Overrides org.apache.commons.math3.optim.BaseOptimizer.parseOptimizationData.

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

Inherited from org.apache.commons.math3.optim.BaseOptimizer:
doOptimizegetConvergenceCheckergetEvaluationsgetIterationsgetMaxEvaluationsgetMaxIterationsincrementEvaluationCountincrementIterationCountoptimize

Field Detail

functionback to summary
private UnivariateFunction function

Objective function.

goalback to summary
private GoalType goal

Type of optimization.

maxback to summary
private double max

Upper bound.

minback to summary
private double min

Lower bound.

startback to summary
private double start

Initial guess.

Constructor Detail

UnivariateOptimizerback to summary
protected UnivariateOptimizer(ConvergenceChecker<UnivariatePointValuePair> checker)
Parameters
checker:ConvergenceChecker<UnivariatePointValuePair>

Convergence checker.

Method Detail

computeObjectiveValueback to summary
protected double computeObjectiveValue(double x)

Computes the objective function value. This method must be called by subclasses to enforce the evaluation counter limit.

Parameters
x: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.
getGoalTypeback to summary
public GoalType getGoalType()
Returns:GoalType

the optimization type.

getMaxback to summary
public double getMax()
Returns:double

the upper bounds.

getMinback to summary
public double getMin()
Returns:double

the lower bounds.

getStartValueback to summary
public double getStartValue()
Returns:double

the initial guess.

optimizeback to summary
public UnivariatePointValuePair optimize(OptimizationData... optData) throws TooManyEvaluationsException

Overrides org.apache.commons.math3.optim.BaseOptimizer.optimize.

Doc from org.apache.commons.math3.optim.BaseOptimizer.optimize.

Stores data and performs the optimization.

The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete implementations.

When the method is called multiple times, instance data is overwritten only when actually present in the list of arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls).

Important Note

Subclasses must override parseOptimizationData(OptimizationData[]) if they need to register their own options; but then, they must also call super.parseOptimizationData(optData) within that method.

Parameters
optData:OptimizationData[]

Optimization data. In addition to those documented in BaseOptimizer, this method will register the following data:

Returns:UnivariatePointValuePair

a point/value pair that satisfies the convergence criteria.

Annotations
@Override
Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
parseOptimizationDataback to summary
protected void parseOptimizationData(OptimizationData... optData)

Overrides org.apache.commons.math3.optim.BaseOptimizer.parseOptimizationData.

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:

Annotations
@Override