packages feed

data-sketches 0.2.0.0 → 0.2.0.1

raw patch · 2 files changed

+12/−12 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- DataSketches.Quantiles.RelativeErrorQuantile: relativeStandardError :: ReqSketch s k -> Int -> Double -> RankAccuracy -> Int -> Double
+ DataSketches.Quantiles.RelativeErrorQuantile: relativeStandardError :: Int -> Double -> RankAccuracy -> Word64 -> Double

Files

data-sketches.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           data-sketches-version:        0.2.0.0+version:        0.2.0.1 description:    Please see the README on GitHub at <https://github.com/iand675/datasketches-haskell#readme> homepage:       https://github.com/iand675/datasketches-haskell#readme bug-reports:    https://github.com/iand675/datasketches-haskell/issues
src/DataSketches/Quantiles/RelativeErrorQuantile.hs view
@@ -24,9 +24,9 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE DeriveGeneric #-}-module DataSketches.Quantiles.RelativeErrorQuantile ( +module DataSketches.Quantiles.RelativeErrorQuantile (   -- * Construction-    ReqSketch (criterion) +    ReqSketch (criterion)   , ValidK   , mkReqSketch   -- ** Configuration settings@@ -285,17 +285,20 @@  -- | Returns an a priori estimate of relative standard error (RSE, expressed as a number in [0,1]). Derived from Lemma 12 in https://arxiv.org/abs/2004.01668v2, but the constant factors were modified based on empirical measurements. relativeStandardError-  :: ReqSketch s k-  -> Int+  :: Int   -- ^ k - the given value of k   -> Double   -- ^ rank - the given normalized rank, a number in [0,1].   -> RankAccuracy-  -> Int+  -> Word64   -- ^ totalN - an estimate of the total number of items submitted to the sketch.   -> Double   -- ^ an a priori estimate of relative standard error (RSE, expressed as a number in [0,1]).-relativeStandardError = undefined+relativeStandardError k rank_ hra = getRankUB k 2 rank_ 1 isHra+  where+    isHra = case hra of+      HighRanksAreAccurate -> True+      _ -> False  -- | Gets the smallest value seen by this sketch minimum :: PrimMonad m => ReqSketch k (PrimState m) -> m Double@@ -517,7 +520,7 @@           DoubleBuffer.mergeSortIn buff $ Compactor.crDoubleBuffer cReturn           modifyURef (retainedItems this) (+ Compactor.crDeltaRetItems cReturn)           modifyURef (maxNominalCapacitiesSize this) (+ Compactor.crDeltaNominalSize cReturn)-  imapM_ compressionStep compactors +  imapM_ compressionStep compactors   writeMutVar (aux this) Nothing  -- | Merge other sketch into this one.@@ -562,7 +565,7 @@       compress this     maxNominalCapacity' <- readURef $ maxNominalCapacitiesSize this     totalRetainedItems' <- readURef $ retainedItems this-    assert (totalRetainedItems' < maxNominalCapacity') $ +    assert (totalRetainedItems' < maxNominalCapacity') $       writeMutVar (aux this) Nothing   pure this   where@@ -626,6 +629,3 @@     baseCap = k * initNumberOfSections     exactRankThresh :: Double     exactRankThresh = fromIntegral baseCap / fromIntegral totalN--getRSE :: Int -> Double -> Bool -> Word64 -> Double-getRSE k rank hra totalN = getRankUB k 2 rank 1 hra totalN