Class GapFunction

    • Field Detail

      • stopCriterion

        protected final StopCriterion stopCriterion
        The stopCriterion to use
      • LINK_BASED_RELATIVE_GAP

        public static final String LINK_BASED_RELATIVE_GAP
        short code for link based relative duality gap function type
      • NORM_BASED_GAP

        public static final String NORM_BASED_GAP
        short code for a norm based gap function type
    • Constructor Detail

      • GapFunction

        public GapFunction​(IdGroupingToken idToken,
                           StopCriterion stopCriterion)
        Constructor
        Parameters:
        idToken - to use for the generation of its id
        stopCriterion - the StopCriterion object to be used
      • GapFunction

        public GapFunction​(GapFunction other)
        Copy constructor
        Parameters:
        other - to copy
    • Method Detail

      • hasConverged

        public boolean hasConverged​(int iterationIndex)
        Verify if algorithm has converged
        Parameters:
        iterationIndex - the index of the current iteration
        Returns:
        true if stopping criterion has been met, false otherwise
      • getStopCriterion

        public StopCriterion getStopCriterion()
        Return the StopCriterion object
        Returns:
        StopCriterion object being used
      • computeGap

        public abstract double computeGap()
        Compute the gap and return it
        Returns:
        the gap for the current iteration
      • getGap

        public abstract double getGap()
        Returns the last computed gap
        Returns:
        latest gap