|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.optimization.general.AbstractScalarDifferentiableOptimizer
public abstract class AbstractScalarDifferentiableOptimizer
Base class for implementing optimizers for multivariate scalar functions.
This base class handles the boilerplate methods associated to thresholds settings, iterations and evaluations counting.
Field Summary | |
---|---|
static int |
DEFAULT_MAX_ITERATIONS
Default maximal number of iterations allowed. |
Method Summary | |
---|---|
RealConvergenceChecker |
getConvergenceChecker()
Get the convergence checker. |
int |
getEvaluations()
Get the number of evaluations of the objective function. |
int |
getGradientEvaluations()
Get the number of evaluations of the objective function gradient. |
int |
getIterations()
Get the number of iterations realized by the algorithm. |
int |
getMaxEvaluations()
Get the maximal number of functions evaluations. |
int |
getMaxIterations()
Get the maximal number of iterations of the algorithm. |
RealPointValuePair |
optimize(DifferentiableMultivariateRealFunction f,
GoalType goalType,
double[] startPoint)
Optimizes an objective function. |
void |
setConvergenceChecker(RealConvergenceChecker convergenceChecker)
Set the convergence checker. |
void |
setMaxEvaluations(int maxEvaluations)
Set the maximal number of functions evaluations. |
void |
setMaxIterations(int maxIterations)
Set the maximal number of iterations of the algorithm. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_ITERATIONS
Method Detail |
---|
public void setMaxIterations(int maxIterations)
setMaxIterations
in interface DifferentiableMultivariateRealOptimizer
maxIterations
- maximal number of function callspublic int getMaxIterations()
getMaxIterations
in interface DifferentiableMultivariateRealOptimizer
public int getIterations()
The number of evaluations corresponds to the last call to the
optimize
method. It is 0 if the method has not been called yet.
getIterations
in interface DifferentiableMultivariateRealOptimizer
public void setMaxEvaluations(int maxEvaluations)
setMaxEvaluations
in interface DifferentiableMultivariateRealOptimizer
maxEvaluations
- maximal number of function evaluationspublic int getMaxEvaluations()
getMaxEvaluations
in interface DifferentiableMultivariateRealOptimizer
public int getEvaluations()
The number of evaluations corresponds to the last call to the
optimize
method. It is 0 if the method has not been called yet.
getEvaluations
in interface DifferentiableMultivariateRealOptimizer
public int getGradientEvaluations()
The number of evaluations corresponds to the last call to the
optimize
method. It is 0 if the method has not been called yet.
getGradientEvaluations
in interface DifferentiableMultivariateRealOptimizer
public void setConvergenceChecker(RealConvergenceChecker convergenceChecker)
setConvergenceChecker
in interface DifferentiableMultivariateRealOptimizer
convergenceChecker
- object to use to check for convergencepublic RealConvergenceChecker getConvergenceChecker()
getConvergenceChecker
in interface DifferentiableMultivariateRealOptimizer
public RealPointValuePair optimize(DifferentiableMultivariateRealFunction f, GoalType goalType, double[] startPoint) throws FunctionEvaluationException, OptimizationException, IllegalArgumentException
optimize
in interface DifferentiableMultivariateRealOptimizer
f
- objective functiongoalType
- type of optimization goal: either GoalType.MAXIMIZE
or GoalType.MINIMIZE
startPoint
- the start point for optimization
FunctionEvaluationException
- if the objective function throws one during
the search
OptimizationException
- if the algorithm failed to converge
IllegalArgumentException
- if the start point dimension is wrong
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |