You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2024/03/20 23:44:10 UTC

(datasketches-java) 03/03: Remove unused import from TDigestDouble

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch remove_duplicate_doubles_sorted_views
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git

commit 89735210fd77be42791f0864aed481f8f3d122a5
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Wed Mar 20 16:43:28 2024 -0700

    Remove unused import from TDigestDouble
---
 src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java b/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
index 9a93b1c1..7cff3733 100644
--- a/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
+++ b/src/main/java/org/apache/datasketches/tdigest/TDigestDouble.java
@@ -20,7 +20,6 @@
 package org.apache.datasketches.tdigest;
 
 import java.nio.ByteOrder;
-import java.util.function.Function;
 
 import org.apache.datasketches.common.Family;
 import org.apache.datasketches.common.SketchesArgumentException;
@@ -242,8 +241,8 @@ public final class TDigestDouble {
   public double getQuantile(final double rank) {
     if (isEmpty()) { throw new SketchesStateException(QuantilesAPI.EMPTY_MSG); }
     if (Double.isNaN(rank)) { throw new SketchesArgumentException("Operation is undefined for Nan"); }
-    if (rank < 0 || rank > 1) { throw new SketchesArgumentException("Normalized rank must be within [0, 1]"); } 
-    
+    if (rank < 0 || rank > 1) { throw new SketchesArgumentException("Normalized rank must be within [0, 1]"); }
+
     mergeBuffered(); // side effect
 
     if (numCentroids_ == 1) { return centroidMeans_[0]; }
@@ -497,7 +496,7 @@ public final class TDigestDouble {
 
   private TDigestDouble(final boolean reverseMerge, final short k, final double min, final double max,
       final double[] means, final long[] weights, final long weight) {
-    reverseMerge_ = reverseMerge; 
+    reverseMerge_ = reverseMerge;
     k_ = k;
     minValue_ = min;
     maxValue_ = max;
@@ -604,7 +603,7 @@ public final class TDigestDouble {
       return 4 * Math.log(n / compression) + 24;
     }
   }
-  
+
   private static double weightedAverage(final double x1, final double w1, final double x2, final double w2) {
     return (x1 * w1 + x2 * w2) / (w1 + w2);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org