private static class NonLinearConjugateGradientOptimizer.IdentityPreconditioner extends java.lang.Object implements Preconditioner
Modifier | Constructor and Description |
---|---|
private |
NonLinearConjugateGradientOptimizer.IdentityPreconditioner() |
Modifier and Type | Method and Description |
---|---|
double[] |
precondition(double[] variables,
double[] r)
Precondition a search direction.
|
private NonLinearConjugateGradientOptimizer.IdentityPreconditioner()
public double[] precondition(double[] variables, double[] r)
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.
precondition
in interface Preconditioner
variables
- current point at which the search direction was computedr
- raw search direction (i.e. opposite of the gradient)Copyright (c) 2003-2016 Apache Software Foundation