mayya-sharipova commented on code in PR #13615: URL: https://github.com/apache/lucene/pull/13615#discussion_r1701954640
########## lucene/core/src/java/org/apache/lucene/util/VectorUtil.java: ########## @@ -128,6 +128,11 @@ public static float[] l2normalize(float[] v) { return v; } + public static boolean isUnitVector(float[] v) { + double l1norm = IMPL.dotProduct(v, v); + return Math.abs(l1norm - 1.0d) <= 1e-4; Review Comment: Looks like it is better to make it `1e-3`, for [reference](https://github.com/elastic/elasticsearch/pull/110240) -- 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