Class LocalitySensitiveHash


  • public class LocalitySensitiveHash
    extends java.lang.Object
    This class calculate the hashcode of a vector given which set of hashing vectors it was created with.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int dimension  
      protected int numHashBit  
      protected double[][] splitVecs  
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalitySensitiveHash​(double[][] splitVecs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.lucene.util.BytesRef getHashBit​(double[] features)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • numHashBit

        protected final int numHashBit
      • dimension

        protected final int dimension
      • splitVecs

        protected final double[][] splitVecs
    • Constructor Detail

      • LocalitySensitiveHash

        public LocalitySensitiveHash​(double[][] splitVecs)
        Parameters:
        splitVecs - the set of hashing vectors.
    • Method Detail

      • getHashBit

        public org.apache.lucene.util.BytesRef getHashBit​(double[] features)
        Parameters:
        features - the vector to compute hashcode.
        Returns:
        the hashcode of the vector.