|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.optim.BaseOptimizer<PAIR>
PAIR
- Type of the point/value pair returned by the optimization
algorithm.public abstract class BaseOptimizer<PAIR>
Base class for implementing optimizers. It contains the boiler-plate code for counting the number of evaluations of the objective function and the number of iterations of the algorithm, and storing the convergence checker. It is not a "user" class.
Field Summary | |
---|---|
protected Incrementor |
evaluations
Evaluations counter. |
protected Incrementor |
iterations
Iterations counter. |
Constructor Summary | |
---|---|
protected |
BaseOptimizer(ConvergenceChecker<PAIR> checker)
|
Method Summary | |
---|---|
protected abstract PAIR |
doOptimize()
Performs the bulk of the optimization algorithm. |
ConvergenceChecker<PAIR> |
getConvergenceChecker()
Gets the convergence checker. |
int |
getEvaluations()
Gets the number of evaluations of the objective function. |
int |
getIterations()
Gets the number of iterations performed by the algorithm. |
int |
getMaxEvaluations()
Gets the maximal number of function evaluations. |
int |
getMaxIterations()
Gets the maximal number of iterations. |
protected void |
incrementEvaluationCount()
Increment the evaluation count. |
protected void |
incrementIterationCount()
Increment the iteration count. |
PAIR |
optimize(OptimizationData... optData)
Stores data and performs the optimization. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Incrementor evaluations
protected final Incrementor iterations
Constructor Detail |
---|
protected BaseOptimizer(ConvergenceChecker<PAIR> checker)
checker
- Convergence checker.Method Detail |
---|
public int getMaxEvaluations()
public int getEvaluations()
optimize
method. It is 0 if the method has not been
called yet.
public int getMaxIterations()
public int getIterations()
optimize
method. It is 0 if the method has not been
called yet.
public ConvergenceChecker<PAIR> getConvergenceChecker()
public PAIR optimize(OptimizationData... optData) throws TooManyEvaluationsException, TooManyIterationsException
optData
- Optimization data. The following data will be looked for:
TooManyEvaluationsException
- if the maximal number of
evaluations is exceeded.
TooManyIterationsException
- if the maximal number of
iterations is exceeded.protected abstract PAIR doOptimize()
protected void incrementEvaluationCount() throws TooManyEvaluationsException
TooManyEvaluationsException
- if the allowed evaluations
have been exhausted.protected void incrementIterationCount() throws TooManyIterationsException
TooManyIterationsException
- if the allowed iterations
have been exhausted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |