java.lang.Object
org.elasticsearch.index.codec.vectors.BQSpaceUtils

public class BQSpaceUtils extends Object
Utility class for quantization calculations
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    transposeHalfByte(byte[] q, byte[] quantQueryByte)
    Copied from Lucene, replace with Lucene's implementation sometime after Lucene 10 Transpose the query vector into a byte array allowing for efficient bitwise operations with the index bit vectors.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • BQSpaceUtils

      public BQSpaceUtils()
  • Method Details

    • transposeHalfByte

      public static void transposeHalfByte(byte[] q, byte[] quantQueryByte)
      Copied from Lucene, replace with Lucene's implementation sometime after Lucene 10 Transpose the query vector into a byte array allowing for efficient bitwise operations with the index bit vectors. The idea here is to organize the query vector bits such that the first bit of every dimension is in the first set dimensions bits, or (dimensions/8) bytes. The second, third, and fourth bits are in the second, third, and fourth set of dimensions bits, respectively. This allows for direct bitwise comparisons with the stored index vectors through summing the bitwise results with the relative required bit shifts.
      Parameters:
      q - the query vector, assumed to be half-byte quantized with values between 0 and 15
      quantQueryByte - the byte array to store the transposed query vector