|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.optim.BaseOptimizer<PAIR>
org.apache.commons.math3.optim.BaseMultivariateOptimizer<PointValuePair>
org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer
org.apache.commons.math3.optim.nonlinear.scalar.GradientMultivariateOptimizer
org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizer
public class NonLinearConjugateGradientOptimizer
Non-linear conjugate gradient optimizer.
This class supports both the Fletcher-Reeves and the Polak-Ribière
update formulas for the conjugate search directions.
It also supports optional preconditioning.
Constraints are not supported: the call to
optimize
will throw
MathUnsupportedOperationException
if bounds are passed to it.
Nested Class Summary | |
---|---|
static class |
NonLinearConjugateGradientOptimizer.BracketingStep
The initial step is a factor with respect to the search direction (which itself is roughly related to the gradient of the function). |
static class |
NonLinearConjugateGradientOptimizer.Formula
Available choices of update formulas for the updating the parameter that is used to compute the successive conjugate search directions. |
static class |
NonLinearConjugateGradientOptimizer.IdentityPreconditioner
Default identity preconditioner. |
private class |
NonLinearConjugateGradientOptimizer.LineSearchFunction
Internal class for line search. |
Field Summary | |
---|---|
private double |
initialStep
Initial step used to bracket the optimum in line search. |
private Preconditioner |
preconditioner
Preconditioner (may be null). |
private UnivariateSolver |
solver
solver to use in the line search (may be null). |
private NonLinearConjugateGradientOptimizer.Formula |
updateFormula
Update formula for the beta parameter. |
Fields inherited from class org.apache.commons.math3.optim.BaseOptimizer |
---|
evaluations, iterations |
Constructor Summary | |
---|---|
NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula,
ConvergenceChecker<PointValuePair> checker)
Constructor with default line search solver and
preconditioner . |
|
NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula,
ConvergenceChecker<PointValuePair> checker,
UnivariateSolver lineSearchSolver)
Constructor with default preconditioner . |
|
NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula,
ConvergenceChecker<PointValuePair> checker,
UnivariateSolver lineSearchSolver,
Preconditioner preconditioner)
|
Method Summary | |
---|---|
private void |
checkParameters()
|
protected PointValuePair |
doOptimize()
Performs the bulk of the optimization algorithm. |
private double |
findUpperBound(UnivariateFunction f,
double a,
double h)
Finds the upper bound b ensuring bracketing of a root between a and b. |
PointValuePair |
optimize(OptimizationData... optData)
Stores data and performs the optimization. |
protected void |
parseOptimizationData(OptimizationData... optData)
Scans the list of (required and optional) optimization data that characterize the problem. |
Methods inherited from class org.apache.commons.math3.optim.nonlinear.scalar.GradientMultivariateOptimizer |
---|
computeObjectiveGradient |
Methods inherited from class org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer |
---|
computeObjectiveValue, getGoalType |
Methods inherited from class org.apache.commons.math3.optim.BaseMultivariateOptimizer |
---|
getLowerBound, getStartPoint, getUpperBound |
Methods inherited from class org.apache.commons.math3.optim.BaseOptimizer |
---|
getConvergenceChecker, getEvaluations, getIterations, getMaxEvaluations, getMaxIterations, incrementEvaluationCount, incrementIterationCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final NonLinearConjugateGradientOptimizer.Formula updateFormula
private final Preconditioner preconditioner
private final UnivariateSolver solver
private double initialStep
Constructor Detail |
---|
public NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula, ConvergenceChecker<PointValuePair> checker)
line search solver
and
preconditioner
.
updateFormula
- formula to use for updating the β parameter,
must be one of NonLinearConjugateGradientOptimizer.Formula.FLETCHER_REEVES
or
NonLinearConjugateGradientOptimizer.Formula.POLAK_RIBIERE
.checker
- Convergence checker.public NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver)
preconditioner
.
updateFormula
- formula to use for updating the β parameter,
must be one of NonLinearConjugateGradientOptimizer.Formula.FLETCHER_REEVES
or
NonLinearConjugateGradientOptimizer.Formula.POLAK_RIBIERE
.checker
- Convergence checker.lineSearchSolver
- Solver to use during line search.public NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver, Preconditioner preconditioner)
updateFormula
- formula to use for updating the β parameter,
must be one of NonLinearConjugateGradientOptimizer.Formula.FLETCHER_REEVES
or
NonLinearConjugateGradientOptimizer.Formula.POLAK_RIBIERE
.checker
- Convergence checker.lineSearchSolver
- Solver to use during line search.preconditioner
- Preconditioner.Method Detail |
---|
public PointValuePair optimize(OptimizationData... optData) throws TooManyEvaluationsException
BaseOptimizer.parseOptimizationData(OptimizationData[])
if they need to register
their own options; but then, they must also call
super.parseOptimizationData(optData)
within that method.
optimize
in class GradientMultivariateOptimizer
optData
- Optimization data. In addition to those documented in
GradientMultivariateOptimizer
, this method will register the following data:
TooManyEvaluationsException
- if the maximal number of
evaluations (of the objective function) is exceeded.protected PointValuePair doOptimize()
doOptimize
in class BaseOptimizer<PointValuePair>
protected void parseOptimizationData(OptimizationData... optData)
parseOptimizationData
in class GradientMultivariateOptimizer
optData
- Optimization data.
The following data will be looked for:
private double findUpperBound(UnivariateFunction f, double a, double h)
f
- function whose root must be bracketed.a
- lower bound of the interval.h
- initial step to try.
MathIllegalStateException
- if no bracket can be found.private void checkParameters()
MathUnsupportedOperationException
- if bounds were passed to the
optimize
method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |