Class InMemoryLSHIndex.Instance

  • All Implemented Interfaces:
    elki.index.Index, elki.index.KNNIndex<V>, elki.index.RangeIndex<V>
    Enclosing class:
    InMemoryLSHIndex<V>

    public class InMemoryLSHIndex.Instance
    extends elki.index.AbstractRefiningIndex<V>
    implements elki.index.KNNIndex<V>, elki.index.RangeIndex<V>
    Instance of a LSH index for a single relation.
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  InMemoryLSHIndex.Instance.LSHKNNQuery
      Class for handling kNN queries against the LSH index.
      protected class  InMemoryLSHIndex.Instance.LSHRangeQuery
      Class for handling kNN queries against the LSH index.
      • Nested classes/interfaces inherited from class elki.index.AbstractRefiningIndex

        elki.index.AbstractRefiningIndex.AbstractRefiningQuery
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions
      Hash functions to use.
      (package private) java.util.ArrayList<it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<elki.database.ids.DBIDs>> hashtables
      The actual table
      private int numberOfBuckets
      Number of buckets to use.
      • Fields inherited from class elki.index.AbstractRefiningIndex

        relation
    • Constructor Summary

      Constructors 
      Constructor Description
      Instance​(elki.database.relation.Relation<V> relation, java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions, int numberOfBuckets)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected elki.database.ids.DBIDs getCandidates​(V obj)
      Get the candidates: points which have at least one hash bucket in common.
      elki.logging.Logging getLogger()  
      void initialize()  
      elki.database.query.knn.KNNSearcher<V> kNNByObject​(elki.database.query.distance.DistanceQuery<V> distanceQuery, int maxk, int flags)  
      elki.database.query.range.RangeSearcher<V> rangeByObject​(elki.database.query.distance.DistanceQuery<V> distanceQuery, double maxradius, int flags)  
      • Methods inherited from class elki.index.AbstractRefiningIndex

        countRefinements, logStatistics, refine
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface elki.index.Index

        logStatistics
      • Methods inherited from interface elki.index.KNNIndex

        kNNByDBID
      • Methods inherited from interface elki.index.RangeIndex

        rangeByDBID
    • Field Detail

      • hashtables

        java.util.ArrayList<it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<elki.database.ids.DBIDs>> hashtables
        The actual table
      • numberOfBuckets

        private int numberOfBuckets
        Number of buckets to use.
    • Constructor Detail

      • Instance

        public Instance​(elki.database.relation.Relation<V> relation,
                        java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions,
                        int numberOfBuckets)
        Constructor.
        Parameters:
        relation - Relation to index.
        hashfunctions - Hash functions.
    • Method Detail

      • initialize

        public void initialize()
        Specified by:
        initialize in interface elki.index.Index
      • getLogger

        public elki.logging.Logging getLogger()
        Specified by:
        getLogger in class elki.index.AbstractRefiningIndex<V>
      • kNNByObject

        public elki.database.query.knn.KNNSearcher<V> kNNByObject​(elki.database.query.distance.DistanceQuery<V> distanceQuery,
                                                                  int maxk,
                                                                  int flags)
        Specified by:
        kNNByObject in interface elki.index.KNNIndex<V>
      • rangeByObject

        public elki.database.query.range.RangeSearcher<V> rangeByObject​(elki.database.query.distance.DistanceQuery<V> distanceQuery,
                                                                        double maxradius,
                                                                        int flags)
        Specified by:
        rangeByObject in interface elki.index.RangeIndex<V>
      • getCandidates

        protected elki.database.ids.DBIDs getCandidates​(V obj)
        Get the candidates: points which have at least one hash bucket in common.
        Parameters:
        obj - Query object
        Returns:
        Candidates