Class StopCriterion


  • public class StopCriterion
    extends Object
    StopCriterion class. In its base form we only provide an epsilon value. However by deriving from this class additional citeria can be added
    Author:
    markr
    • Field Detail

      • DEFAULT_EPSILON

        public static final double DEFAULT_EPSILON
        Default Epsilon in case it is not set by user
        See Also:
        Constant Field Values
      • DEFAULT_MAX_ITERATIONS

        public static final int DEFAULT_MAX_ITERATIONS
        Default maximum number of iterations in case it is not set by user
        See Also:
        Constant Field Values
    • Constructor Detail

      • StopCriterion

        public StopCriterion()
    • Method Detail

      • hasConverged

        public boolean hasConverged​(double gap,
                                    int iterationIndex)
        Check if converged based on the gap and the internal information
        Parameters:
        gap - gap for the current iteration
        iterationIndex - index of current iteration
        Returns:
        true if gap is smaller than criterion, false otherwise
      • getMaxIterations

        public int getMaxIterations()
        Return the maximum allowable number of iterations
        Returns:
        the maximum allowable number of iterations
      • setMaxIterations

        public void setMaxIterations​(int maxIterations)
        Set the maximum allowable number of iterations
        Parameters:
        maxIterations - the maximum allowable number of iterations
      • getEpsilon

        public double getEpsilon()
        Return the epsilon of this stopping criterion
        Returns:
        the epsilon of this stopping criterion
      • setEpsilon

        public void setEpsilon​(double epsilon)
        Set the epsilon of this stopping criterion
        Parameters:
        epsilon - the epsilon of this stopping criterion