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 2021/02/17 22:21:33 UTC

[datasketches-characterization] 02/03: update StreamMaker

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

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

commit 03baf87e1c205589a3b0cddab0175d57e18e38ff
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Wed Feb 17 14:12:01 2021 -0800

    update StreamMaker
---
 .../characterization/quantiles/StreamMaker.java            | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/datasketches/characterization/quantiles/StreamMaker.java b/src/test/java/org/apache/datasketches/characterization/quantiles/StreamMaker.java
index b43570b..d3f2db8 100644
--- a/src/test/java/org/apache/datasketches/characterization/quantiles/StreamMaker.java
+++ b/src/test/java/org/apache/datasketches/characterization/quantiles/StreamMaker.java
@@ -37,7 +37,7 @@ public class StreamMaker {
   static final String LS = System.getProperty("line.separator");
   static String TAB = "\t";
   public enum Pattern { Sorted, Reversed, Zoomin, Zoomout, Random, Sqrt, FlipFlop,
-    Clustered, ClusteredZoomin }
+    Clustered, ClusteredZoomin, ZoominSqrt }
   public float min = 0;
   public float max = 0;
 
@@ -94,6 +94,18 @@ public class StreamMaker {
         }
         break;
       }
+      case ZoominSqrt: {
+        int t = (int)Math.floor(Math.sqrt(n));
+        int i = 0;
+        for (int j = 0; j < t - 1; j++) {
+          arr[i] = j + offset; i++;
+          for (int k = 0; k < t; k++) {
+            arr[i] = (t - j) * t - k - 1 + offset; i++;
+          }
+        }
+        arr[i] = t - 1 + offset;
+        break;
+      }
       case FlipFlop: {
         FlipFlopStream ffs = new FlipFlopStream(n, offset);
         ffs.flipFlop(1, 1, n * 2 / 5);


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