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

public abstract Class BaseAbstractUnivariateOptimizer

extends Object
implements UnivariateOptimizer
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optimization.univariate.UnivariateOptimizer, org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer, org.apache.commons.math3.optimization.BaseOptimizer
Known Direct Subclasses
org.apache.commons.math3.optimization.univariate.BrentOptimizer
Annotations
@Deprecated
Imports
org.apache.commons.math3.util.Incrementor, org.apache.commons.math3.exception.MaxCountExceededException, .TooManyEvaluationsException, .NullArgumentException, org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.optimization.GoalType, .ConvergenceChecker

Deprecated

As of 3.1 (to be removed in 4.0).

Provide a default implementation for several functions useful to generic optimizers.
Since
2.0

Field Summary

Modifier and TypeField and Description
private final ConvergenceChecker<UnivariatePointValuePair>
checker

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

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

Function to optimize.

private GoalType
goal

Deprecated as a consequence of GoalType being deprecated.
Optimization type
private double
searchMax

Higher end of search interval.

private double
searchMin

Lower end of search interval.

private double
searchStart

Initial guess .

Constructor Summary

AccessConstructor and Description
protected
BaseAbstractUnivariateOptimizer(ConvergenceChecker<UnivariatePointValuePair>
Convergence checking procedure.
checker
)
Deprecated as a consequence of ConvergenceChecker being deprecated.

Method Summary

Modifier and TypeMethod and Description
protected double

Returns:

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

Compute the objective function value.

protected abstract UnivariatePointValuePair

Returns:

the optimum and its corresponding function value.
doOptimize
()
Deprecated as a consequence of UnivariatePointValuePair being deprecated.

Method for implementing actual optimization algorithms in derived classes.

public ConvergenceChecker<UnivariatePointValuePair>
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 higher end of the search interval.
getMax
()

public int
getMaxEvaluations()

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

Get the maximal number of function evaluations.

public double

Returns:

the lower end of the search interval.
getMin
()

public double

Returns:

the initial guess.
getStartValue
()

public UnivariatePointValuePair
optimize(int
Maximum number of function evaluations.
maxEval
,
UnivariateFunction
Function to optimize.
f
,
GoalType
Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.
goalType
,
double
Lower bound for the interval.
min
,
double
Upper bound for the interval.
max
,
double
Start value to use.
startValue
)

Implements org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Deprecated as a consequence of GoalType and UnivariatePointValuePair being deprecated.

Find an optimum in the given interval, start at startValue.

public UnivariatePointValuePair
optimize(int
Maximum number of function evaluations.
maxEval
,
UnivariateFunction
Function to optimize.
f
,
GoalType
Type of optimization goal: either GoalType#MAXIMIZE or GoalType#MINIMIZE.
goalType
,
double
Lower bound for the interval.
min
,
double
Upper bound for the interval.
max
)

Implements org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Deprecated as a consequence of GoalType and UnivariatePointValuePair being deprecated.

Find an optimum in the given interval.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkerback to summary
private final ConvergenceChecker<UnivariatePointValuePair> checker

Deprecated

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

Convergence checker.

evaluationsback to summary
private final Incrementor evaluations

Deprecated

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

Evaluations counter.

functionback to summary
private UnivariateFunction function

Function to optimize.

goalback to summary
private GoalType goal

Deprecated

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

Optimization type

searchMaxback to summary
private double searchMax

Higher end of search interval.

searchMinback to summary
private double searchMin

Lower end of search interval.

searchStartback to summary
private double searchStart

Initial guess .

Constructor Detail

BaseAbstractUnivariateOptimizerback to summary
protected BaseAbstractUnivariateOptimizer(ConvergenceChecker<UnivariatePointValuePair> checker)

Deprecated

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

Parameters
checker:ConvergenceChecker<UnivariatePointValuePair>

Convergence checking procedure.

Method Detail

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 specified point.

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

Deprecated

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

Method for implementing actual optimization algorithms in derived classes.

Returns:UnivariatePointValuePair

the optimum and its corresponding function value.

Exceptions
TooManyEvaluationsException:
if the maximal number of evaluations is exceeded.
getConvergenceCheckerback to summary
public ConvergenceChecker<UnivariatePointValuePair> 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<UnivariatePointValuePair>

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.

getMaxback to summary
public double getMax()
Returns:double

the higher end of the search interval.

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.

getMinback to summary
public double getMin()
Returns:double

the lower end of the search interval.

getStartValueback to summary
public double getStartValue()
Returns:double

the initial guess.

optimizeback to summary
public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue)

Implements org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Doc from org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Deprecated

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

Find an optimum in the given interval, start at startValue. An optimizer may require that the interval brackets a single optimum.

Parameters
maxEval:int

Maximum number of function evaluations.

f:UnivariateFunction

Function to optimize.

goalType:GoalType

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

min:double

Lower bound for the interval.

max:double

Upper bound for the interval.

startValue:double

Start value to use.

Returns:UnivariatePointValuePair

a (point, value) pair where the function is optimum.

optimizeback to summary
public UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max)

Implements org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Doc from org.apache.commons.math3.optimization.univariate.BaseUnivariateOptimizer.optimize.

Deprecated

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

Find an optimum in the given interval. An optimizer may require that the interval brackets a single optimum.

Parameters
maxEval:int

Maximum number of function evaluations.

f:UnivariateFunction

Function to optimize.

goalType:GoalType

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

min:double

Lower bound for the interval.

max:double

Upper bound for the interval.

Returns:UnivariatePointValuePair

a (point, value) pair where the function is optimum.