Package org.apache.lucene.index

## Enum VectorEncoding

- java.lang.Object
- - java.lang.Enum<VectorEncoding>
  - - org.apache.lucene.index.VectorEncoding

- All Implemented Interfaces:
    `Serializable`, `Comparable<VectorEncoding>`

      public enum VectorEncoding
      extends Enum<VectorEncoding>

  The numeric datatype of the vector values.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---
    `BYTE` | Encodes vector using 8 bits of precision per sample.
    `FLOAT32` | Encodes vector using 32 bits of precision per sample in IEEE floating point format.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `byteSize` | The number of bytes required to encode a scalar in this format.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static VectorEncoding` | `valueOf​(String name)` | Returns the enum constant of this type with the specified name.
    `static VectorEncoding[]` | `values()` | Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### BYTE

          public static final VectorEncoding BYTE

      Encodes vector using 8 bits of precision per sample. Values provided with higher precision (eg: queries provided as float) *must* be in the range [-128, 127]. NOTE: this can enable significant storage savings and faster searches, at the cost of some possible loss of precision.

    - #### FLOAT32

          public static final VectorEncoding FLOAT32

      Encodes vector using 32 bits of precision per sample in IEEE floating point format.

  - ### Field Detail

    - #### byteSize

          public final int byteSize

      The number of bytes required to encode a scalar in this format. A vector will nominally require dimension * byteSize bytes of storage.

  - ### Method Detail

    - #### values

          public static VectorEncoding[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (VectorEncoding c : VectorEncoding.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static VectorEncoding valueOf​(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        `NullPointerException` - if the argument is null