Class WrappedPrioritySearchDBIDByLookup<O>

    • Constructor Detail

      • WrappedPrioritySearchDBIDByLookup

        private WrappedPrioritySearchDBIDByLookup​(Relation<? extends O> relation,
                                                  PrioritySearcher<O> inner)
        Constructor.
        Parameters:
        relation - data relation
        inner - inner kNN searcher
    • Method Detail

      • getKNN

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

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • decreaseCutoff

        public PrioritySearcher<DBIDRef> decreaseCutoff​(double threshold)
        Description copied from interface: PrioritySearcher
        Decrease the cutoff threshold.

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

        Specified by:
        decreaseCutoff in interface PrioritySearcher<O>
        Parameters:
        threshold - Threshold parameter
        Returns:
        this, for chaining
      • internalGetIndex

        public int internalGetIndex()
        Description copied from interface: DBIDRef
        Internal only: Get the internal index.

        NOT FOR PUBLIC USE - ELKI Optimization engine only.

        Specified by:
        internalGetIndex in interface DBIDRef
        Returns:
        Internal index
      • getApproximateDistance

        public double getApproximateDistance()
        Description copied from interface: PrioritySearcher
        Get approximate distance (if available).

        Quality guarantees may vary a lot!

        Specified by:
        getApproximateDistance in interface PrioritySearcher<O>
        Returns:
        Double.NaN if not valid
      • getApproximateAccuracy

        public double getApproximateAccuracy()
        Description copied from interface: PrioritySearcher
        Get approximate distance accuracy (if available).

        Quality guarantees may vary a lot!

        Specified by:
        getApproximateAccuracy in interface PrioritySearcher<O>
        Returns:
        Double.NaN if not valid
      • getLowerBound

        public double getLowerBound()
        Description copied from interface: PrioritySearcher
        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.

        Specified by:
        getLowerBound in interface PrioritySearcher<O>
        Returns:
        Double.NaN if not valid
      • getUpperBound

        public double getUpperBound()
        Description copied from interface: PrioritySearcher
        Get the upper bound (if available).
        Specified by:
        getUpperBound in interface PrioritySearcher<O>
        Returns:
        Double.NaN if not valid
      • computeExactDistance

        public double computeExactDistance()
        Description copied from interface: PrioritySearcher
        Compute the exact distance to the current candidate.

        The searcher may or may not have this value already.

        Specified by:
        computeExactDistance in interface PrioritySearcher<O>
        Returns:
        Distance
      • allLowerBound

        public double allLowerBound()
        Description copied from interface: PrioritySearcher
        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.
        Specified by:
        allLowerBound in interface PrioritySearcher<O>
        Returns:
        lower bound; 0 if no guarantees (e.g., linear scan)
      • wrap

        public static <O> PrioritySearcher<DBIDRef> wrap​(Relation<? extends O> relation,
                                                         PrioritySearcher<O> inner)
        Wrap a query, if not null.
        Type Parameters:
        O - inner data type
        Parameters:
        relation - Relation to get object from
        inner - inner query
        Returns:
        wrapped query, or null if inner was null