Enum Class Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding

java.lang.Object
java.lang.Enum<Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding>
org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding
All Implemented Interfaces:
Serializable, Comparable<Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding>, Constable
Enclosing class:
Lucene104ScalarQuantizedVectorsFormat

public static enum Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding extends Enum<Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding>
Allowed encodings for scalar quantization.

This specifies how many bits are used per dimension and also dictates packing of dimensions into a byte stream.

  • Enum Constant Details

  • Method Details

    • values

      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromNumBits

      public static Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding fromNumBits(int bits)
    • isAsymmetric

      public boolean isAsymmetric()
    • getBits

      public byte getBits()
      Return the number of bits used per dimension.
    • getQueryBits

      public byte getQueryBits()
    • getDiscreteDimensions

      public int getDiscreteDimensions(int dimensions)
      Return the number of dimensions rounded up to fit into whole bytes.
    • getDocBitsPerDim

      public int getDocBitsPerDim()
      Return the number of dimensions that can be packed into a single byte.
    • getQueryBitsPerDim

      public int getQueryBitsPerDim()
    • getDocPackedLength

      public int getDocPackedLength(int dimensions)
      Return the number of bytes required to store a packed vector of the given dimensions.
    • getQueryPackedLength

      public int getQueryPackedLength(int dimensions)
    • fromWireNumber

      public static Optional<Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding> fromWireNumber(int wireNumber)
      Returns the encoding for the given wire number, or empty if unknown.