Class AbstractMkTree<O,​N extends AbstractMTreeNode<O,​N,​E>,​E extends MTreeEntry,​S extends MTreeSettings<O,​N,​E>>

  • Type Parameters:
    O - the type of DatabaseObject to be stored in the metrical index
    N - the type of MetricalNode used in the metrical index
    E - the type of MetricalEntry used in the metrical index
    S - the type of Settings kept.
    All Implemented Interfaces:
    Index
    Direct Known Subclasses:
    AbstractMkTreeUnified, MkAppTree, MkCoPTree

    public abstract class AbstractMkTree<O,​N extends AbstractMTreeNode<O,​N,​E>,​E extends MTreeEntry,​S extends MTreeSettings<O,​N,​E>>
    extends AbstractMTree<O,​N,​E,​S>
    Abstract class for all M-Tree variants supporting processing of reverse k-nearest neighbor queries by using the k-nn distances of the entries, where k is less than or equal to the given parameter.
    Since:
    0.2
    Author:
    Elke Achtert
    • Field Detail

      • distanceQuery

        private DistanceQuery<O> distanceQuery
        Distance query to use.
    • Constructor Detail

      • AbstractMkTree

        public AbstractMkTree​(Relation<O> relation,
                              PageFile<N> pagefile,
                              S settings)
        Constructor.
        Parameters:
        relation - Relation to index
        pagefile - Page file
        settings - Settings class
    • Method Detail

      • reverseKNNQuery

        public abstract DoubleDBIDList reverseKNNQuery​(DBIDRef id,
                                                       int k)
        Performs a reverse k-nearest neighbor query for the given object ID. The query result is in ascending order to the distance to the query object.
        Parameters:
        id - the query object id
        k - the number of nearest neighbors to be returned
        Returns:
        a List of the query results
      • batchNN

        @Deprecated
        protected final java.util.Map<DBID,​KNNList> batchNN​(N node,
                                                                  DBIDs ids,
                                                                  int kmax)
        Deprecated.
        Change to use by-object NN lookups instead.
        Performs a batch k-nearest neighbor query for a list of query objects.
        Parameters:
        node - the node representing the subtree on which the query should be performed
        ids - the ids of the query objects
        kmax - Maximum k value