Class WrappedRKNNDBIDByLookup<O>

  • Type Parameters:
    O - relation object type
    All Implemented Interfaces:
    RKNNSearcher<DBIDRef>
    Direct Known Subclasses:
    WrappedRKNNDBIDByLookup.Linear

    public class WrappedRKNNDBIDByLookup<O>
    extends java.lang.Object
    implements RKNNSearcher<DBIDRef>
    Find nearest neighbors by querying with the original object.
    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Detail

      • relation

        private Relation<? extends O> relation
        Data relation.
    • Constructor Detail

      • WrappedRKNNDBIDByLookup

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

      • getRKNN

        public DoubleDBIDList getRKNN​(DBIDRef id,
                                      int k)
        Description copied from interface: RKNNSearcher
        Get the reverse k nearest neighbors for a particular object.
        Specified by:
        getRKNN in interface RKNNSearcher<O>
        Parameters:
        id - query object
        k - number of neighbors requested
        Returns:
        reverse k nearest neighbors
      • wrap

        public static <O> RKNNSearcher<DBIDRef> wrap​(Relation<? extends O> relation,
                                                     RKNNSearcher<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