org.apache.commons.math3.optimization.univariate
Class BaseAbstractUnivariateOptimizer

java.lang.Object
  extended by org.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer
All Implemented Interfaces:
BaseOptimizer<UnivariatePointValuePair>, BaseUnivariateOptimizer<UnivariateFunction>, UnivariateOptimizer
Direct Known Subclasses:
BrentOptimizer

Deprecated. As of 3.1 (to be removed in 4.0).

@Deprecated
public abstract class BaseAbstractUnivariateOptimizer
extends Object
implements UnivariateOptimizer

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

Since:
2.0
Version:
$Id: BaseAbstractUnivariateOptimizer.java 1422230 2012-12-15 12:11:13Z erans $

Field Summary
private  ConvergenceChecker<UnivariatePointValuePair> checker
          Deprecated. Convergence checker.
private  Incrementor evaluations
          Deprecated. Evaluations counter.
private  UnivariateFunction function
          Deprecated. Function to optimize.
private  GoalType goal
          Deprecated. Optimization type
private  double searchMax
          Deprecated. Higher end of search interval.
private  double searchMin
          Deprecated. Lower end of search interval.
private  double searchStart
          Deprecated. Initial guess .
 
Constructor Summary
protected BaseAbstractUnivariateOptimizer(ConvergenceChecker<UnivariatePointValuePair> checker)
          Deprecated.  
 
Method Summary
protected  double computeObjectiveValue(double point)
          Deprecated. Compute the objective function value.
protected abstract  UnivariatePointValuePair doOptimize()
          Deprecated. Method for implementing actual optimization algorithms in derived classes.
 ConvergenceChecker<UnivariatePointValuePair> getConvergenceChecker()
          Deprecated. Get the convergence checker.
 int getEvaluations()
          Deprecated. Get the number of evaluations of the objective function.
 GoalType getGoalType()
          Deprecated.  
 double getMax()
          Deprecated.  
 int getMaxEvaluations()
          Deprecated. Get the maximal number of function evaluations.
 double getMin()
          Deprecated.  
 double getStartValue()
          Deprecated.  
 UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max)
          Deprecated. Find an optimum in the given interval.
 UnivariatePointValuePair optimize(int maxEval, UnivariateFunction f, GoalType goalType, double min, double max, double startValue)
          Deprecated. Find an optimum in the given interval, start at startValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checker

private final ConvergenceChecker<UnivariatePointValuePair> checker
Deprecated. 
Convergence checker.


evaluations

private final Incrementor evaluations
Deprecated. 
Evaluations counter.


goal

private GoalType goal
Deprecated. 
Optimization type


searchMin

private double searchMin
Deprecated. 
Lower end of search interval.


searchMax

private double searchMax
Deprecated. 
Higher end of search interval.


searchStart

private double searchStart
Deprecated. 
Initial guess .


function

private UnivariateFunction function
Deprecated. 
Function to optimize.

Constructor Detail

BaseAbstractUnivariateOptimizer

protected BaseAbstractUnivariateOptimizer(ConvergenceChecker<UnivariatePointValuePair> checker)
Deprecated. 
Parameters:
checker - Convergence checking procedure.
Method Detail

getMaxEvaluations

public int getMaxEvaluations()
Deprecated. 
Get the maximal number of function evaluations.

Specified by:
getMaxEvaluations in interface BaseOptimizer<UnivariatePointValuePair>
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<UnivariatePointValuePair>
Returns:
the number of evaluations of the objective function.

getGoalType

public GoalType getGoalType()
Deprecated. 
Returns:
the optimization type.

getMin

public double getMin()
Deprecated. 
Returns:
the lower end of the search interval.

getMax

public double getMax()
Deprecated. 
Returns:
the higher end of the search interval.

getStartValue

public double getStartValue()
Deprecated. 
Returns:
the initial guess.

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 specified point.
Throws:
TooManyEvaluationsException - if the maximal number of evaluations is exceeded.

optimize

public UnivariatePointValuePair optimize(int maxEval,
                                         UnivariateFunction f,
                                         GoalType goalType,
                                         double min,
                                         double max,
                                         double startValue)
Deprecated. 
Find an optimum in the given interval, start at startValue. An optimizer may require that the interval brackets a single optimum.

Specified by:
optimize in interface BaseUnivariateOptimizer<UnivariateFunction>
Parameters:
maxEval - Maximum number of function evaluations.
f - Function to optimize.
goalType - Type of optimization goal: either GoalType.MAXIMIZE or GoalType.MINIMIZE.
min - Lower bound for the interval.
max - Upper bound for the interval.
startValue - Start value to use.
Returns:
a (point, value) pair where the function is optimum.

optimize

public UnivariatePointValuePair optimize(int maxEval,
                                         UnivariateFunction f,
                                         GoalType goalType,
                                         double min,
                                         double max)
Deprecated. 
Find an optimum in the given interval. An optimizer may require that the interval brackets a single optimum.

Specified by:
optimize in interface BaseUnivariateOptimizer<UnivariateFunction>
Parameters:
maxEval - Maximum number of function evaluations.
f - Function to optimize.
goalType - Type of optimization goal: either GoalType.MAXIMIZE or GoalType.MINIMIZE.
min - Lower bound for the interval.
max - Upper bound for the interval.
Returns:
a (point, value) pair where the function is optimum.

getConvergenceChecker

public ConvergenceChecker<UnivariatePointValuePair> getConvergenceChecker()
Deprecated. 
Get the convergence checker.

Specified by:
getConvergenceChecker in interface BaseOptimizer<UnivariatePointValuePair>
Returns:
the object used to check for convergence.

doOptimize

protected abstract UnivariatePointValuePair doOptimize()
Deprecated. 
Method for implementing actual optimization algorithms in derived classes.

Returns:
the optimum and its corresponding function value.
Throws:
TooManyEvaluationsException - if the maximal number of evaluations is exceeded.


Copyright (c) 2003-2013 Apache Software Foundation