org.omegahat.Numerics.Optimizers
Class ConvergenceGradient

java.lang.Object
  |
  +--org.omegahat.Numerics.Optimizers.ConvergenceListener
        |
        +--org.omegahat.Numerics.Optimizers.ConvergenceGradient
All Implemented Interfaces:
ConvergenceListenerInt, java.util.EventListener, IterationListener

public class ConvergenceGradient
extends ConvergenceListener

This listener implements the convergence test that the norm of the gradient is less than the tolerance.

To allow for overall scaling, the smaller of the absolute value and the value relative to the parameters is used.


Fields inherited from class org.omegahat.Numerics.Optimizers.ConvergenceListener
relPrecision, tolerance, value
 
Constructor Summary
ConvergenceGradient()
          A standard object of this class, with a tolerance for convergence equal to the relative precision of computations (about 2e-16).
 
Method Summary
 double setValue(ModelPoint p, OptimizerIterator opt)
          Set and return the norm of the gradient.
 
Methods inherited from class org.omegahat.Numerics.Optimizers.ConvergenceListener
continueIteration, getTolerance, getValue, setTolerance, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvergenceGradient

public ConvergenceGradient()
A standard object of this class, with a tolerance for convergence equal to the relative precision of computations (about 2e-16).
Method Detail

setValue

public double setValue(ModelPoint p,
                       OptimizerIterator opt)
Set and return the norm of the gradient.

The value is the smaller of the absolute norm and the norm relative to the norm of the parameter vector. If the norm is undefined, returns a very large value to force computation to continue.

Overrides:
setValue in class ConvergenceListener