de.jstacs.algorithms.optimization.termination
Class SmallDifferenceOfFunctionEvaluationsCondition

java.lang.Object
  extended by de.jstacs.algorithms.optimization.termination.SmallDifferenceOfFunctionEvaluationsCondition
All Implemented Interfaces:
TerminationCondition

public class SmallDifferenceOfFunctionEvaluationsCondition
extends Object
implements TerminationCondition

This class implements a TerminationCondition that stops an optimization if the difference of the current and the last function evaluations will be small, i.e., $f(\underline{x}_{i-1}) - f(\underline{x}_i) < \epsilon$.

Author:
Jens Keilwagen

Constructor Summary
SmallDifferenceOfFunctionEvaluationsCondition(double epsilon)
          This constructor creates an instance that stops the optimization if the difference of the current and the last function evaluations is smaller than epsilon.
 
Method Summary
 boolean doNextIteration(int iteration, double f_last, double f_current, double[] gradient, double[] direction, double alpha, Time t)
          This method allows to decide whether to do another iteration in an optimization or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmallDifferenceOfFunctionEvaluationsCondition

public SmallDifferenceOfFunctionEvaluationsCondition(double epsilon)
This constructor creates an instance that stops the optimization if the difference of the current and the last function evaluations is smaller than epsilon.

Parameters:
epsilon - the threshold for stopping, has to be non.negative
Method Detail

doNextIteration

public boolean doNextIteration(int iteration,
                               double f_last,
                               double f_current,
                               double[] gradient,
                               double[] direction,
                               double alpha,
                               Time t)
Description copied from interface: TerminationCondition
This method allows to decide whether to do another iteration in an optimization or not.

Specified by:
doNextIteration in interface TerminationCondition
Parameters:
iteration - the number of performed iterations
f_last - last value of the function
f_current - current value of the function
gradient - the gradient of the function
direction - the last direction of the optimization
alpha - the last step size
t - a time object measuring the time that has been elapsed in the optimization
Returns:
true if another iteration should be done