leerho commented on code in PR #411:
URL: https://github.com/apache/datasketches-java/pull/411#discussion_r947168051


##########
src/main/java/org/apache/datasketches/req/ReqSketch.java:
##########
@@ -336,23 +323,17 @@ public double getRankLowerBound(final double rank, final 
int numStdDev) {
 
   @Override
   public double[] getRanks(final float[] values) {
-    return getRanks(values, ltEq);
+    return getRanks(values, ltEq == true ? INCLUSIVE : NON_INCLUSIVE);
   }
 
   @Override
-  public double[] getRanks(final float[] values, final boolean inclusive) {
+  public double[] getRanks(final float[] values, final QuantileSearchCriteria 
searchCrit) {
     if (isEmpty()) { return null; }
+    refreshSortedView();

Review Comment:
   Building the sorted view can be an expensive operation.  Once it has been 
built, and if the sketch has not been updated or been the target of a merge, 
all subsequent calls to the query methods (of which, getRanks is one) are quite 
fast.  However, if the user does a getRanks(); update(); getRanks(), the 
update() call invalidates the internal state of the sketch, so the sorted view 
needs to be rebuilt.
   
   Thus each of the query calls must check if the internal state of the sketch 
has changed.  If not, this refreshSortedView() does nothing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to