Class MTreeKNNByDBID<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    KNNSearcher<DBIDRef>

    public class MTreeKNNByDBID<O>
    extends java.lang.Object
    implements KNNSearcher<DBIDRef>
    Instance of a KNN query for a particular spatial index.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • index

        protected final AbstractMTree<O,​?,​?,​?> index
        The index to use
      • distanceQuery

        protected final DistanceQuery<O> distanceQuery
        Hold the distance function to be used.
    • Constructor Detail

      • MTreeKNNByDBID

        public MTreeKNNByDBID​(AbstractMTree<O,​?,​?,​?> index,
                              DistanceQuery<O> distanceQuery)
        Constructor.
        Parameters:
        index - Index to use
        distanceQuery - Distance query used
    • Method Detail

      • getKNN

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