de.jstacs.algorithms.optimization.termination
Class SmallStepCondition
java.lang.Object
de.jstacs.algorithms.optimization.termination.SmallStepCondition
- All Implemented Interfaces:
- TerminationCondition
public class SmallStepCondition
- extends Object
- implements TerminationCondition
This class implements a TerminationCondition
that allows no further iteration in an optimization if the
scalar product of the current and the last values of x
will be small, i.e.,
.
- Author:
- Jens Keilwagen
Constructor Summary |
SmallStepCondition(double epsilon)
This constructor creates an instance that allows no further iteration in an optimization if the
scalar product of the current and the last values of x 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 |
SmallStepCondition
public SmallStepCondition(double epsilon)
- This constructor creates an instance that allows no further iteration in an optimization if the
scalar product of the current and the last values of
x
is smaller than epsilon
.
- Parameters:
epsilon
- the threshold for stopping, has to be non-negative
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 iterationsf_last
- last value of the functionf_current
- current value of the functiongradient
- the gradient of the functiondirection
- the last direction of the optimizationalpha
- the last step sizet
- a time object measuring the time that has been elapsed in the optimization
- Returns:
true
if another iteration should be done