Top Description Inners Fields Constructors Methods
org.apache.commons.math3.optim

public abstract Class AbstractOptimizationProblem<PAIR>

extends Object
implements OptimizationProblem<PAIR>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optim.OptimizationProblem
Known Direct Subclasses
org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.LocalLeastSquaresProblem
Type Parameters
<PAIR>
Type of the point/value pair returned by the optimization algorithm.
Imports
org.apache.commons.math3.exception.TooManyEvaluationsException, .TooManyIterationsException, org.apache.commons.math3.util.Incrementor

Base class for implementing optimization problems. 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.
Since
3.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
AbstractOptimizationProblem.MaxEvalCallback

Defines the action to perform when reaching the maximum number of evaluations.

private static class
AbstractOptimizationProblem.MaxIterCallback

Defines the action to perform when reaching the maximum number of evaluations.

Field Summary

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

Convergence checker.

private static final AbstractOptimizationProblem.MaxEvalCallback
MAX_EVAL_CALLBACK

Callback to use for the evaluation counter.

private static final AbstractOptimizationProblem.MaxIterCallback
MAX_ITER_CALLBACK

Callback to use for the iteration counter.

private final int
maxEvaluations

max evaluations

private final int
maxIterations

max iterations

Constructor Summary

AccessConstructor and Description
protected
AbstractOptimizationProblem(final int
the number of allowed model function evaluations.
maxEvaluations
,
final int
the number of allowed iterations.
maxIterations
,
final ConvergenceChecker<PAIR>
the convergence checker.
checker
)

Create an AbstractOptimizationProblem from the given data.

Method Summary

Modifier and TypeMethod and Description
public ConvergenceChecker<PAIR>
public Incrementor
getEvaluationCounter()

Implements org.apache.commons.math3.optim.OptimizationProblem.getEvaluationCounter.

Deprecated as a consequence of Incrementor being deprecated.

Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.

public Incrementor
getIterationCounter()

Implements org.apache.commons.math3.optim.OptimizationProblem.getIterationCounter.

Deprecated as a consequence of Incrementor being deprecated.

Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkerback to summary
private final ConvergenceChecker<PAIR> checker

Convergence checker.

MAX_EVAL_CALLBACKback to summary
private static final AbstractOptimizationProblem.MaxEvalCallback MAX_EVAL_CALLBACK

Callback to use for the evaluation counter.

MAX_ITER_CALLBACKback to summary
private static final AbstractOptimizationProblem.MaxIterCallback MAX_ITER_CALLBACK

Callback to use for the iteration counter.

maxEvaluationsback to summary
private final int maxEvaluations

max evaluations

maxIterationsback to summary
private final int maxIterations

max iterations

Constructor Detail

AbstractOptimizationProblemback to summary
protected AbstractOptimizationProblem(final int maxEvaluations, final int maxIterations, final ConvergenceChecker<PAIR> checker)

Create an AbstractOptimizationProblem from the given data.

Parameters
maxEvaluations:int

the number of allowed model function evaluations.

maxIterations:int

the number of allowed iterations.

checker:ConvergenceChecker<PAIR>

the convergence checker.

Method Detail

getConvergenceCheckerback to summary
public ConvergenceChecker<PAIR> getConvergenceChecker()

Implements org.apache.commons.math3.optim.OptimizationProblem.getConvergenceChecker.

Doc from org.apache.commons.math3.optim.OptimizationProblem.getConvergenceChecker.

Gets the convergence checker.

Returns:ConvergenceChecker<PAIR>

the object used to check for convergence.

getEvaluationCounterback to summary
public Incrementor getEvaluationCounter()

Implements org.apache.commons.math3.optim.OptimizationProblem.getEvaluationCounter.

Doc from org.apache.commons.math3.optim.OptimizationProblem.getEvaluationCounter.

Deprecated

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

Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.

Returns:Incrementor

a counter for the evaluations.

getIterationCounterback to summary
public Incrementor getIterationCounter()

Implements org.apache.commons.math3.optim.OptimizationProblem.getIterationCounter.

Doc from org.apache.commons.math3.optim.OptimizationProblem.getIterationCounter.

Deprecated

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

Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.

Returns:Incrementor

a counter for the evaluations.

org.apache.commons.math3.optim back to summary

private Class AbstractOptimizationProblem.MaxEvalCallback

extends Object
implements MaxCountExceededCallback
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.optim.AbstractOptimizationProblem.MaxEvalCallback
All Implemented Interfaces
org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback

Defines the action to perform when reaching the maximum number of evaluations.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
trigger(int
Maximal count.
max
)

Implements org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Function called when the maximal count has been reached.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MaxEvalCallbackback to summary
private MaxEvalCallback()

Method Detail

triggerback to summary
public void trigger(int max)

Implements org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Doc from org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Function called when the maximal count has been reached.

Parameters
max:int

Maximal count.

org.apache.commons.math3.optim back to summary

private Class AbstractOptimizationProblem.MaxIterCallback

extends Object
implements MaxCountExceededCallback
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.optim.AbstractOptimizationProblem.MaxIterCallback
All Implemented Interfaces
org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback

Defines the action to perform when reaching the maximum number of evaluations.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
trigger(int
Maximal count.
max
)

Implements org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Function called when the maximal count has been reached.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MaxIterCallbackback to summary
private MaxIterCallback()

Method Detail

triggerback to summary
public void trigger(int max)

Implements org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Doc from org.apache.commons.math3.util.Incrementor.MaxCountExceededCallback.trigger.

Function called when the maximal count has been reached.

Parameters
max:int

Maximal count.