Package org.apache.lucene.util.quantization

## Interface ScalarQuantizedVectorSimilarity

- All Known Implementing Classes:
    `ScalarQuantizedVectorSimilarity.DotProduct`, `ScalarQuantizedVectorSimilarity.Euclidean`, `ScalarQuantizedVectorSimilarity.MaximumInnerProduct`

      public interface ScalarQuantizedVectorSimilarity

  Calculates and adjust the scores correctly for quantized vectors given the scalar quantization parameters

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `ScalarQuantizedVectorSimilarity.DotProduct` | Calculates dot product on quantized vectors, applying the appropriate corrections
    `static class` | `ScalarQuantizedVectorSimilarity.Euclidean` | Calculates euclidean distance on quantized vectors, applying the appropriate corrections
    `static class` | `ScalarQuantizedVectorSimilarity.MaximumInnerProduct` | Calculates max inner product on quantized vectors, applying the appropriate corrections

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static ScalarQuantizedVectorSimilarity` | `fromVectorSimilarity​(VectorSimilarityFunction sim, float constMultiplier)` | Creates a `ScalarQuantizedVectorSimilarity` from a `VectorSimilarityFunction` and the constant multiplier used for quantization.
    `float` | `score​(byte[] queryVector, float queryVectorOffset, byte[] storedVector, float vectorOffset)` |

- - ### Method Detail

    - #### fromVectorSimilarity

          static ScalarQuantizedVectorSimilarity fromVectorSimilarity​(VectorSimilarityFunction sim,
                                                                      float constMultiplier)

      Creates a `ScalarQuantizedVectorSimilarity` from a `VectorSimilarityFunction` and the constant multiplier used for quantization.
      Parameters:
        `sim` - similarity function
        `constMultiplier` - constant multiplier used for quantization
      Returns:
        a `ScalarQuantizedVectorSimilarity` that applies the appropriate corrections

    - #### score

          float score​(byte[] queryVector,
                      float queryVectorOffset,
                      byte[] storedVector,
                      float vectorOffset)