Class AtThreshold

  • All Implemented Interfaces:
    StopCondition

    public class AtThreshold
    extends Object
    implements StopCondition
    Stops when the value reaches a given value with a given precision.
    • Constructor Detail

      • AtThreshold

        public AtThreshold​(double target,
                           double epsilon)
        Stops when the value reaches a given value with a given precision.
        Parameters:
        target - the target value to reach
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
    • Method Detail

      • isStopped

        public boolean isStopped​(Vector x,
                                 double... information)
        Description copied from interface: StopCondition
        This is called after each iteration to determine whether the termination conditions are met, e.g., convergence.
        Specified by:
        isStopped in interface StopCondition
        Parameters:
        x - the current state of the algorithm
        information - auxiliary information, e.g., the energy at a given state
        Returns:
        true if the iteration should stop