Package org.apache.lucene.index
Enum Class VectorEncoding
- All Implemented Interfaces:
Serializable
,Comparable<VectorEncoding>
,Constable
The numeric datatype of the vector values.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
The number of bytes required to encode a scalar in this format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorEncoding
Returns the enum constant of this class with the specified name.static VectorEncoding[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Encodes vector using 32 bits of precision per sample in IEEE floating point format.
-
-
Field Details
-
byteSize
public final int byteSizeThe number of bytes required to encode a scalar in this format. A vector will nominally require dimension * byteSize bytes of storage.
-
-
Constructor Details
-
VectorEncoding
private VectorEncoding(int byteSize)
-
-
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 nameNullPointerException
- if the argument is null
-