Class InMemoryLSHIndex.Instance

    • Field Detail

      • hashtables

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

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

      • Instance

        public Instance​(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()
        Description copied from interface: Index
        Initialize the index. For static indexes, this is the moment the index is bulk loaded.
        Specified by:
        initialize in interface Index
      • kNNByObject

        public KNNSearcher<V> kNNByObject​(DistanceQuery<V> distanceQuery,
                                          int maxk,
                                          int flags)
        Description copied from interface: KNNIndex
        Get a KNN query object for the given distance query and k.

        This function MAY return null, when the given distance is not supported!

        Specified by:
        kNNByObject in interface KNNIndex<V>
        Parameters:
        distanceQuery - Distance query
        maxk - Maximum value of k
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null
      • rangeByObject

        public RangeSearcher<V> rangeByObject​(DistanceQuery<V> distanceQuery,
                                              double maxradius,
                                              int flags)
        Description copied from interface: RangeIndex
        Get a range query object for the given distance query and k.

        This function MAY return null, when the given distance is not supported!

        Specified by:
        rangeByObject in interface RangeIndex<V>
        Parameters:
        distanceQuery - Distance query
        maxradius - Maximum range
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null
      • getCandidates

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