|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer<FUNC>
FUNC - the type of the objective function to be optimizedpublic abstract class BaseAbstractVectorialOptimizer<FUNC extends MultivariateVectorialFunction>
Base class for implementing optimizers for multivariate scalar functions. This base class handles the boiler-plate methods associated to thresholds settings, iterations and evaluations counting.
| Field Summary | |
|---|---|
protected Incrementor |
evaluations
Evaluations counter. |
| Constructor Summary | |
|---|---|
protected |
BaseAbstractVectorialOptimizer()
Simple constructor with default settings. |
protected |
BaseAbstractVectorialOptimizer(ConvergenceChecker<VectorialPointValuePair> checker)
|
| Method Summary | |
|---|---|
protected double[] |
computeObjectiveValue(double[] point)
Compute the objective function value. |
protected abstract VectorialPointValuePair |
doOptimize()
Perform the bulk of the optimization algorithm. |
ConvergenceChecker<VectorialPointValuePair> |
getConvergenceChecker()
Get the convergence checker. |
int |
getEvaluations()
Get the number of evaluations of the objective function. |
int |
getMaxEvaluations()
Get the maximal number of function evaluations. |
double[] |
getStartPoint()
|
protected double[] |
getTargetRef()
|
protected double[] |
getWeightRef()
|
VectorialPointValuePair |
optimize(int maxEval,
FUNC f,
double[] t,
double[] w,
double[] startPoint)
Optimize an objective function. |
void |
setConvergenceChecker(ConvergenceChecker<VectorialPointValuePair> convergenceChecker)
Set the convergence checker. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Incrementor evaluations
| Constructor Detail |
|---|
protected BaseAbstractVectorialOptimizer()
SimpleVectorialValueChecker and
the allowed number of evaluations is set to Integer.MAX_VALUE.
protected BaseAbstractVectorialOptimizer(ConvergenceChecker<VectorialPointValuePair> checker)
checker - Convergence checker.| Method Detail |
|---|
public int getMaxEvaluations()
getMaxEvaluations in interface BaseOptimizer<VectorialPointValuePair>public int getEvaluations()
optimize method. It is 0 if the method has not been
called yet.
getEvaluations in interface BaseOptimizer<VectorialPointValuePair>public void setConvergenceChecker(ConvergenceChecker<VectorialPointValuePair> convergenceChecker)
setConvergenceChecker in interface BaseOptimizer<VectorialPointValuePair>convergenceChecker - Object to use to check for convergence.public ConvergenceChecker<VectorialPointValuePair> getConvergenceChecker()
getConvergenceChecker in interface BaseOptimizer<VectorialPointValuePair>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 VectorialPointValuePair optimize(int maxEval,
FUNC f,
double[] t,
double[] w,
double[] startPoint)
∑weighti(objectivei - targeti)2
optimize in interface BaseMultivariateVectorialOptimizer<FUNC extends MultivariateVectorialFunction>maxEval - Maximum number of function evaluations.f - Objective function.t - Target value for the objective functions at optimum.w - Weights for the least squares cost computation.startPoint - Start point for optimization.
public double[] getStartPoint()
protected abstract VectorialPointValuePair doOptimize()
protected double[] getTargetRef()
array.protected double[] getWeightRef()
array.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||