Deprecated
As of 3.1 (to be removed in 4.0).
This class supports both the Fletcher-Reeves and the Polak-Ribière update formulas for the conjugate search directions. It also supports optional preconditioning.
| Modifier and Type | Class and Description |
|---|---|
| public static class | NonLinearConjugateGradientOptimizer.
Deprecated
as a consequence of Default identity preconditioner.
Preconditioner being deprecated.
|
| private class | NonLinearConjugateGradientOptimizer.
Internal class for line search. |
| Modifier and Type | Field and Description |
|---|---|
| private double | initialStep
Initial step used to bracket the optimum in line search. |
| private double[] | point
Current point. |
| private final Preconditioner | preconditioner
Deprecated
as a consequence of Preconditioner (may be null).
Preconditioner being deprecated.
|
| private final UnivariateSolver | solver
solver to use in the line search (may be null). |
| private final ConjugateGradientFormula | updateFormula
Deprecated
as a consequence of Update formula for the beta parameter.
ConjugateGradientFormula being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| protected PointValuePair | doOptimize()
Implements abstract org.
Deprecated
as a consequence of
PointValuePair being deprecated.
Perform the bulk of the optimization algorithm. |
| private double | Returns: b such that f(a) and f(b) have opposite signs.function whose root must be bracketed. f, final double lower bound of the interval. a, final double initial step to try. h)Find the upper bound b ensuring bracketing of a root between a and b. |
| public void | setInitialStep(final double
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 initialStep)Set the initial step used to bracket the optimum in line search. |
| initialStep | back to summary |
|---|---|
| private double initialStep Initial step used to bracket the optimum in line search. | |
| point | back to summary |
|---|---|
| private double[] point Current point. | |
| preconditioner | back to summary |
|---|---|
| private final Preconditioner preconditioner
Deprecated as a consequence of Preconditioner (may be null). | |
| solver | back to summary |
|---|---|
| private final UnivariateSolver solver solver to use in the line search (may be null). | |
| updateFormula | back to summary |
|---|---|
| private final ConjugateGradientFormula updateFormula
Deprecated as a consequence of Update formula for the beta parameter. | |
| NonLinearConjugateGradientOptimizer | back to summary |
|---|---|
| public NonLinearConjugateGradientOptimizer(final ConjugateGradientFormula updateFormula)
Deprecated Constructor with default
| |
| NonLinearConjugateGradientOptimizer | back to summary |
|---|---|
| public NonLinearConjugateGradientOptimizer(final ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker)
Deprecated as a consequence of Constructor with default
| |
| NonLinearConjugateGradientOptimizer | back to summary |
|---|---|
| public NonLinearConjugateGradientOptimizer(final ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, final UnivariateSolver lineSearchSolver)
Deprecated as a consequence of Constructor with default
| |
| NonLinearConjugateGradientOptimizer | back to summary |
|---|---|
| public NonLinearConjugateGradientOptimizer(final ConjugateGradientFormula updateFormula, ConvergenceChecker<PointValuePair> checker, final UnivariateSolver lineSearchSolver, final Preconditioner preconditioner)
Deprecated as a consequence of
| |
| doOptimize | back to summary |
|---|---|
| protected PointValuePair doOptimize() Implements abstract org. Doc from org. Deprecated as a consequence of Perform the bulk of the optimization algorithm.
| |
| findUpperBound | back to summary |
|---|---|
| private double findUpperBound(final UnivariateFunction f, final double a, final double h) Find the upper bound b ensuring bracketing of a root between a and b.
| |
| setInitialStep | back to summary |
|---|---|
| public void setInitialStep(final double initialStep) 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
| |
Deprecated
as a consequence of Preconditioner being deprecated. See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public double[] | precondition(double[]
current point at which the search direction was computed variables, double[] raw search direction (i.e. opposite of the gradient) r)Implements org. Precondition a search direction. |
| IdentityPreconditioner | back to summary |
|---|---|
| public IdentityPreconditioner() | |
| precondition | back to summary |
|---|---|
| public double[] precondition(double[] variables, double[] r) Implements org. Doc from org. Precondition a search direction. The returned preconditioned search direction must be computed fast or the algorithm performances will drop drastically. A classical approach is to compute only the diagonal elements of the hessian and to divide the raw search direction by these elements if they are all positive. If at least one of them is negative, it is safer to return a clone of the raw search direction as if the hessian was the identity matrix. The rationale for this simplified choice is that a negative diagonal element means the current point is far from the optimum and preconditioning will not be efficient anyway in this case.
| |
The function represented by this class is the dot product of the objective function gradient and the search direction. Its value is zero when the gradient is orthogonal to the search direction, i.e. when the objective function value is a local extremum along the search direction.
| Modifier and Type | Field and Description |
|---|---|
| private final double[] | searchDirection
Search direction. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public double | value(double
Point at which the function value should be computed. x)Implements org. Compute the value of the function. |
| searchDirection | back to summary |
|---|---|
| private final double[] searchDirection Search direction. | |
| LineSearchFunction | back to summary |
|---|---|
| pack-priv LineSearchFunction(final double[] searchDirection) Simple constructor.
| |
| value | back to summary |
|---|---|
| public double value(double x) Implements org. Doc from org. Compute the value of the function.
| |