You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by pa...@apache.org on 2021/01/08 16:24:55 UTC

[datasketches-characterization] branch fixAccuracyTestForLongStreams created (now 39e02ba)

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

pavelvesely pushed a change to branch fixAccuracyTestForLongStreams
in repository https://gitbox.apache.org/repos/asf/datasketches-characterization.git.


      at 39e02ba  fixing a bug accuracy test for long streams

This branch includes the following new commits:

     new 39e02ba  fixing a bug accuracy test for long streams

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[datasketches-characterization] 01/01: fixing a bug accuracy test for long streams

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 39e02ba7fc66c6a20d15393f0285dbe744027789
Author: Pavel Vesely <ve...@iuuk.mff.cuni.cz>
AuthorDate: Fri Jan 8 17:20:24 2021 +0100

    fixing a bug accuracy test for long streams
    
    For large stream lengths, an exception occurs because points are not generated with enough precision
---
 .../quantiles/ReqSketchAccuracyProfile.java                | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/test/java/org/apache/datasketches/characterization/quantiles/ReqSketchAccuracyProfile.java b/src/test/java/org/apache/datasketches/characterization/quantiles/ReqSketchAccuracyProfile.java
index bbdfd14..68460a2 100644
--- a/src/test/java/org/apache/datasketches/characterization/quantiles/ReqSketchAccuracyProfile.java
+++ b/src/test/java/org/apache/datasketches/characterization/quantiles/ReqSketchAccuracyProfile.java
@@ -20,9 +20,9 @@
 package org.apache.datasketches.characterization.quantiles;
 
 import static java.lang.Math.round;
-import static org.apache.datasketches.ExponentiallySpacedPoints.expSpacedFloats;
+import static org.apache.datasketches.ExponentiallySpacedPoints.expSpaced;
 import static org.apache.datasketches.GaussianRanks.GAUSSIANS_3SD;
-import static org.apache.datasketches.Util.evenlySpacedFloats;
+import static org.apache.datasketches.Util.evenlySpaced;
 import static org.apache.datasketches.Util.pwr2LawNext;
 
 import org.apache.datasketches.Job;
@@ -237,17 +237,17 @@ public class ReqSketchAccuracyProfile implements JobProfile {
       endIdx = hra ? streamLength - 1 : subStreamLen - 1;
     }
 
-    //generates PP indices in [startIdx, endIdx] inclusive, inclusive
-    final float[] temp = evenlySpaced
-        ? evenlySpacedFloats(startIdx, endIdx, numPlotPoints)
-        : expSpacedFloats(startIdx, endIdx, numPlotPoints, exponent, hra);
+    //generates PP indices in [startIdx, endIdx] inclusive, inclusive // PV 2020-01-07: using double so that there's enough precision even for large stream lengths
+    final double[] temp = evenlySpaced 
+        ? evenlySpaced(startIdx, endIdx, numPlotPoints)
+        : expSpaced(startIdx, endIdx, numPlotPoints, exponent, hra);
 
     sortedPPIndices = new int[numPlotPoints];
     sortedPPAbsRanks = new int[numPlotPoints];
     sortedPPValues = new float[numPlotPoints];
 
     for (int pp = 0; pp < numPlotPoints; pp++) {
-      final int idx = Math.round(temp[pp]);
+      final int idx = (int)Math.round(temp[pp]);
       sortedPPIndices[pp] = idx;
       sortedPPAbsRanks[pp] = sortedAbsRanks[idx];
       sortedPPValues[pp] = sortedStream[idx];


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