jtibshirani commented on a change in pull request #219: URL: https://github.com/apache/lucene/pull/219#discussion_r673356722
########## File path: lucene/core/src/java/org/apache/lucene/index/VectorSimilarityFunction.java ########## @@ -62,15 +64,5 @@ * @param v2 another vector, of the same dimension * @return the value of the similarity function applied to the two vectors */ - public float compare(float[] v1, float[] v2) { - switch (this) { - case EUCLIDEAN: - return squareDistance(v1, v2); - case DOT_PRODUCT: - return dotProduct(v1, v2); - case NONE: - default: - throw new IllegalStateException("Incomparable similarity function: " + this); - } - } + public abstract float compare(float[] v1, float[] v2); Review comment: nice refactor :) -- 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