Class NonLinearConjugateGradientOptimizer
java.lang.Object
org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer<DifferentiableMultivariateFunction>
org.apache.commons.math3.optimization.general.AbstractScalarDifferentiableOptimizer
org.apache.commons.math3.optimization.general.NonLinearConjugateGradientOptimizer
- All Implemented Interfaces:
BaseMultivariateOptimizer<DifferentiableMultivariateFunction>
,BaseOptimizer<PointValuePair>
,DifferentiableMultivariateOptimizer
@Deprecated
public class NonLinearConjugateGradientOptimizer
extends AbstractScalarDifferentiableOptimizer
Deprecated.
As of 3.1 (to be removed in 4.0).
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.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated.Default identity preconditioner.private class
Deprecated.Internal class for line search. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
Deprecated.Initial step used to bracket the optimum in line search.private double[]
Deprecated.Current point.private final Preconditioner
Deprecated.Preconditioner (may be null).private final UnivariateSolver
Deprecated.solver to use in the line search (may be null).private final ConjugateGradientFormula
Deprecated.Update formula for the beta parameter.Fields inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer
evaluations
-
Constructor Summary
ConstructorsConstructorDescriptionNonLinearConjugateGradientOptimizer
(ConjugateGradientFormula updateFormula) Deprecated.NonLinearConjugateGradientOptimizer
(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker) Deprecated.Constructor with defaultline search solver
andpreconditioner
.NonLinearConjugateGradientOptimizer
(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver) Deprecated.Constructor with defaultpreconditioner
.NonLinearConjugateGradientOptimizer
(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver, Preconditioner preconditioner) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected PointValuePair
Deprecated.Perform the bulk of the optimization algorithm.private double
findUpperBound
(UnivariateFunction f, double a, double h) Deprecated.Find the upper bound b ensuring bracketing of a root between a and b.void
setInitialStep
(double initialStep) Deprecated.Set the initial step used to bracket the optimum in line search.Methods inherited from class org.apache.commons.math3.optimization.general.AbstractScalarDifferentiableOptimizer
computeObjectiveGradient, optimize, optimizeInternal
Methods inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer
computeObjectiveValue, getConvergenceChecker, getEvaluations, getGoalType, getLowerBound, getMaxEvaluations, getStartPoint, getUpperBound, optimize, optimize, optimizeInternal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.math3.optimization.BaseMultivariateOptimizer
optimize
Methods inherited from interface org.apache.commons.math3.optimization.BaseOptimizer
getConvergenceChecker, getEvaluations, getMaxEvaluations
-
Field Details
-
updateFormula
Deprecated.Update formula for the beta parameter. -
preconditioner
Deprecated.Preconditioner (may be null). -
solver
Deprecated.solver to use in the line search (may be null). -
initialStep
private double initialStepDeprecated.Initial step used to bracket the optimum in line search. -
point
private double[] pointDeprecated.Current point.
-
-
Constructor Details
-
NonLinearConjugateGradientOptimizer
Deprecated.- Parameters:
updateFormula
- formula to use for updating the β parameter, must be one ofConjugateGradientFormula.FLETCHER_REEVES
orConjugateGradientFormula.POLAK_RIBIERE
.
-
NonLinearConjugateGradientOptimizer
public NonLinearConjugateGradientOptimizer(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker) Deprecated.Constructor with defaultline search solver
andpreconditioner
.- Parameters:
updateFormula
- formula to use for updating the β parameter, must be one ofConjugateGradientFormula.FLETCHER_REEVES
orConjugateGradientFormula.POLAK_RIBIERE
.checker
- Convergence checker.
-
NonLinearConjugateGradientOptimizer
public NonLinearConjugateGradientOptimizer(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver) Deprecated.Constructor with defaultpreconditioner
.- Parameters:
updateFormula
- formula to use for updating the β parameter, must be one ofConjugateGradientFormula.FLETCHER_REEVES
orConjugateGradientFormula.POLAK_RIBIERE
.checker
- Convergence checker.lineSearchSolver
- Solver to use during line search.
-
NonLinearConjugateGradientOptimizer
public NonLinearConjugateGradientOptimizer(ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, UnivariateSolver lineSearchSolver, Preconditioner preconditioner) Deprecated.- Parameters:
updateFormula
- formula to use for updating the β parameter, must be one ofConjugateGradientFormula.FLETCHER_REEVES
orConjugateGradientFormula.POLAK_RIBIERE
.checker
- Convergence checker.lineSearchSolver
- Solver to use during line search.preconditioner
- Preconditioner.
-
-
Method Details
-
setInitialStep
public void setInitialStep(double initialStep) Deprecated.Set the initial step used to bracket the optimum in line search.The initial step is a factor with respect to the search direction, which itself is roughly related to the gradient of the function
- Parameters:
initialStep
- initial step used to bracket the optimum in line search, if a non-positive value is used, the initial step is reset to its default value of 1.0
-
doOptimize
Deprecated.Perform the bulk of the optimization algorithm.- Specified by:
doOptimize
in classBaseAbstractMultivariateOptimizer<DifferentiableMultivariateFunction>
- Returns:
- the point/value pair giving the optimal value of the objective function.
-
findUpperBound
Deprecated.Find the upper bound b ensuring bracketing of a root between a and b.- Parameters:
f
- function whose root must be bracketed.a
- lower bound of the interval.h
- initial step to try.- Returns:
- b such that f(a) and f(b) have opposite signs.
- Throws:
MathIllegalStateException
- if no bracket can be found.
-