Class SimpleRatioAmbiguityAcceptance

    • Constructor Detail

      • SimpleRatioAmbiguityAcceptance

        public SimpleRatioAmbiguityAcceptance​(double ratio)
        Simple constructor.
        Parameters:
        ratio - acceptance ratio for candidate[0]/candidate[1], typically 1.0/2.0 or 1.0/3.0
    • Method Detail

      • numberOfCandidates

        public int numberOfCandidates()
        Get the number of candidate solutions to search for.
        Specified by:
        numberOfCandidates in interface AmbiguityAcceptance
        Returns:
        number of candidate solutions to search for
      • accept

        public IntegerLeastSquareSolution accept​(IntegerLeastSquareSolution[] candidates)
        Check if one of the candidate solutions can be accepted.

        If the ratio candidate[0]/candidate[1] is smaller or equal to the ratio given at construction, then candidate[0] will be accepted

        Specified by:
        accept in interface AmbiguityAcceptance
        Parameters:
        candidates - candidate solutions of the Integer Least Squares problem, in increasing squared distance order (the array contains at least AmbiguityAcceptance.numberOfCandidates() candidates)
        Returns:
        the candidate solution to accept (normally the one at index 0), or null if we should still use the float solution