FUNC
- Type of the objective function to be optimized.public abstract class BaseAbstractMultivariateOptimizer<FUNC extends MultivariateFunction> extends Object implements BaseMultivariateOptimizer<FUNC>
Modifier and Type | Field and Description |
---|---|
protected Incrementor |
evaluations
Evaluations counter.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseAbstractMultivariateOptimizer()
Simple constructor with default settings.
|
protected |
BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker) |
Modifier and Type | Method and Description |
---|---|
protected double |
computeObjectiveValue(double[] point)
Compute the objective function value.
|
protected abstract PointValuePair |
doOptimize()
Perform the bulk of the optimization algorithm.
|
ConvergenceChecker<PointValuePair> |
getConvergenceChecker()
Get the convergence checker.
|
int |
getEvaluations()
Get the number of evaluations of the objective function.
|
GoalType |
getGoalType() |
int |
getMaxEvaluations()
Get the maximal number of function evaluations.
|
double[] |
getStartPoint() |
PointValuePair |
optimize(int maxEval,
FUNC f,
GoalType goalType,
double[] startPoint)
Optimize an objective function.
|
protected final Incrementor evaluations
protected BaseAbstractMultivariateOptimizer()
SimpleValueChecker
and
the allowed number of evaluations is set to Integer.MAX_VALUE
.protected BaseAbstractMultivariateOptimizer(ConvergenceChecker<PointValuePair> checker)
checker
- Convergence checker.public int getMaxEvaluations()
getMaxEvaluations
in interface BaseOptimizer<PointValuePair>
public int getEvaluations()
optimize
method. It is 0 if the method has not been
called yet.getEvaluations
in interface BaseOptimizer<PointValuePair>
public ConvergenceChecker<PointValuePair> getConvergenceChecker()
getConvergenceChecker
in interface BaseOptimizer<PointValuePair>
protected double computeObjectiveValue(double[] point)
point
- Point at which the objective function must be evaluated.TooManyEvaluationsException
- if the maximal number of
evaluations is exceeded.public PointValuePair optimize(int maxEval, FUNC f, GoalType goalType, double[] startPoint)
optimize
in interface BaseMultivariateOptimizer<FUNC extends MultivariateFunction>
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.public GoalType getGoalType()
public double[] getStartPoint()
protected abstract PointValuePair doOptimize()
Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.