Interface PrioritySearcher<O>

    • Method Detail

      • search

        default PrioritySearcher<O> search​(O query,
                                           double threshold)
        Priority search function.
        Parameters:
        query - Query object
        threshold - Initial distance threshold
        Returns:
        this, for chaining
      • search

        PrioritySearcher<O> search​(O query)
        Start search with a new object.
        Parameters:
        query - Query object
        Returns:
        this, for chaining
      • getKNN

        default KNNList getKNN​(O obj,
                               int k)
        Description copied from interface: KNNSearcher
        Get the k nearest neighbors for a particular object.
        Specified by:
        getKNN in interface KNNSearcher<O>
        Parameters:
        obj - query object
        k - Number of neighbors requested
        Returns:
        neighbors
      • decreaseCutoff

        PrioritySearcher<O> decreaseCutoff​(double threshold)
        Decrease the cutoff threshold.

        The cutoff must not be increased, as the search may have pruned some results automatically.

        Parameters:
        threshold - Threshold parameter
        Returns:
        this, for chaining
      • computeExactDistance

        double computeExactDistance()
        Compute the exact distance to the current candidate.

        The searcher may or may not have this value already.

        Returns:
        Distance
      • getApproximateDistance

        default double getApproximateDistance()
        Get approximate distance (if available).

        Quality guarantees may vary a lot!

        Returns:
        Double.NaN if not valid
      • getApproximateAccuracy

        default double getApproximateAccuracy()
        Get approximate distance accuracy (if available).

        Quality guarantees may vary a lot!

        Returns:
        Double.NaN if not valid
      • getLowerBound

        default double getLowerBound()
        Get the lower bound (if available).

        Note: the lower bound is already checked by the cutoff of the priority search, so this is primarily useful for analyzing the search behavior.

        Returns:
        Double.NaN if not valid
      • getUpperBound

        default double getUpperBound()
        Get the upper bound (if available).
        Returns:
        Double.NaN if not valid
      • allLowerBound

        double allLowerBound()
        Lower bound for all subsequent instances (that have been completely explored). The searcher guarantees that no further results will be returned with a distance less than this.
        Returns:
        lower bound; 0 if no guarantees (e.g., linear scan)
      • advance

        PrioritySearcher<O> advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface DBIDIter
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.