thecoop commented on code in PR #14304:
URL: https://github.com/apache/lucene/pull/14304#discussion_r2012314179


##########
lucene/core/src/java/org/apache/lucene/internal/vectorization/DefaultVectorUtilSupport.java:
##########
@@ -234,4 +234,79 @@ public static long int4BitDotProductImpl(byte[] q, byte[] 
d) {
     }
     return ret;
   }
+
+  @Override
+  public float minMaxScalarQuantize(
+      float[] vector, byte[] dest, float scale, float alpha, float 
minQuantile, float maxQuantile) {
+    return new ScalarQuantizer(alpha, scale, minQuantile, 
maxQuantile).quantize(vector, dest, 0);
+  }
+
+  @Override
+  public float recalculateScalarQuantizationOffset(
+      byte[] vector,
+      float oldAlpha,
+      float oldMinQuantile,
+      float scale,
+      float alpha,
+      float minQuantile,
+      float maxQuantile) {
+    return new ScalarQuantizer(alpha, scale, minQuantile, maxQuantile)
+        .recalculateOffset(vector, 0, oldAlpha, oldMinQuantile);
+  }
+
+  static class ScalarQuantizer {

Review Comment:
   It's referenced by `PanamaVectorUtilSupport` to do the tail



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to