histogram-fill 0.7.0.0 → 0.7.1.0
raw patch · 3 files changed
+52/−16 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Histogram: breduceX :: (Unbox a, Unbox b, Bin bX, Bin bY) => (BinValue bY -> Histogram bX a -> b) -> Histogram (Bin2D bX bY) a -> Histogram bY b
+ Data.Histogram: breduceY :: (Unbox a, Unbox b, Bin bX, Bin bY) => (BinValue bX -> Histogram bY a -> b) -> Histogram (Bin2D bX bY) a -> Histogram bX b
+ Data.Histogram.Generic: breduceX :: (Vector v a, Vector v b, Bin bX, Bin bY) => (BinValue bY -> Histogram v bX a -> b) -> Histogram v (Bin2D bX bY) a -> Histogram v bY b
+ Data.Histogram.Generic: breduceY :: (Vector v a, Vector v b, Bin bX, Bin bY) => (BinValue bX -> Histogram v bY a -> b) -> Histogram v (Bin2D bX bY) a -> Histogram v bX b
Files
- Data/Histogram.hs +28/−15
- Data/Histogram/Generic.hs +19/−0
- histogram-fill.cabal +5/−1
Data/Histogram.hs view
@@ -61,7 +61,9 @@ , listSlicesAlongY -- ** Reducing along axis , reduceX+ , breduceX , reduceY+ , breduceY -- * Lift histogram transform to 2D , liftX , liftY@@ -183,27 +185,26 @@ ---------------------------------------------------------------- slice :: (SliceableBin bin, Unbox a)- => HistIndex bin -- ^ Lower inclusive bound- -> HistIndex bin -- ^ Upper inclusive bound- -> Histogram bin a -- ^ Histogram to slice+ => HistIndex bin+ -> HistIndex bin -> Histogram bin a+ -> Histogram bin a slice = H.slice rebin :: (MergeableBin bin, Unbox a) => CutDirection -> Int - -> (a -> a -> a) -- ^ Accumulation function+ -> (a -> a -> a) -> Histogram bin a -> Histogram bin a rebin = H.rebin -- {-# INLINE rebin #-} --- | Rebin histogram rebinFold :: (MergeableBin bin, Unbox a, Unbox b) => CutDirection -> Int - -> (b -> a -> b) -- ^ Accumulation function- -> b -- ^ Initial value+ -> (b -> a -> b)+ -> b -> Histogram bin a -> Histogram bin b rebinFold = H.rebinFold@@ -216,14 +217,14 @@ ---------------------------------------------------------------- sliceAlongX :: (Unbox a, Bin bX, Bin bY)- => Histogram (Bin2D bX bY) a -- ^ 2D histogram- -> HistIndex bY -- ^ Position along Y axis+ => Histogram (Bin2D bX bY) a+ -> HistIndex bY -> Histogram bX a sliceAlongX = H.sliceAlongX sliceAlongY :: (Unbox a, Bin bX, Bin bY)- => Histogram (Bin2D bX bY) a -- ^ 2D histogram- -> HistIndex bX -- ^ Position along X axis+ => Histogram (Bin2D bX bY) a+ -> HistIndex bX -> Histogram bY a sliceAlongY = H.sliceAlongY @@ -238,16 +239,28 @@ listSlicesAlongY = H.listSlicesAlongY reduceX :: (Unbox a, Unbox b, Bin bX, Bin bY)- => (Histogram bX a -> b) -- ^ Function to reduce single slice along X axis- -> Histogram (Bin2D bX bY) a -- ^ 2D histogram+ => (Histogram bX a -> b)+ -> Histogram (Bin2D bX bY) a -> Histogram bY b reduceX = H.reduceX +breduceX :: (Unbox a, Unbox b, Bin bX, Bin bY)+ => (BinValue bY -> Histogram bX a -> b)+ -> Histogram (Bin2D bX bY) a+ -> Histogram bY b+breduceX = H.breduceX+ reduceY :: (Unbox a, Unbox b, Bin bX, Bin bY)- => (Histogram bY a -> b) -- ^ Function to reduce histogram along Y axis- -> Histogram (Bin2D bX bY) a -- ^ 2D histogram+ => (Histogram bY a -> b)+ -> Histogram (Bin2D bX bY) a -> Histogram bX b reduceY = H.reduceY++breduceY :: (Unbox a, Unbox b, Bin bX, Bin bY)+ => (BinValue bX -> Histogram bY a -> b)+ -> Histogram (Bin2D bX bY) a+ -> Histogram bX b+breduceY = H.breduceY liftX :: (Bin bX, Bin bY, Bin bX', BinEq bX', Unbox a, Unbox b) => (Histogram bX a -> Histogram bX' b)
Data/Histogram/Generic.hs view
@@ -61,7 +61,9 @@ , listSlicesAlongY -- ** Reducing along axis , reduceX+ , breduceX , reduceY+ , breduceY -- * Lift histogram transform to 2D , liftX , liftY@@ -483,7 +485,15 @@ reduceX f h@(Histogram (Bin2D _ bY) _ _) = Histogram bY Nothing $ G.generate (nBins bY) (f . sliceAlongX h . Index) +-- | Reduce along X axis. Information about under/overlows is lost.+breduceX :: (Vector v a, Vector v b, Bin bX, Bin bY)+ => (BinValue bY -> Histogram v bX a -> b) -- ^ Function to reduce single slice along X axis+ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram+ -> Histogram v bY b+breduceX f h@(Histogram (Bin2D _ bY) _ _) =+ Histogram bY Nothing $ G.generate (nBins bY) $ \i -> f (fromIndex bY i) $ sliceAlongX h (Index i) + -- | Reduce along Y axis. Information about under/overflows is lost. reduceY :: (Vector v a, Vector v b, Bin bX, Bin bY) => (Histogram v bY a -> b) -- ^ Function to reduce histogram along Y axis@@ -491,6 +501,15 @@ -> Histogram v bX b reduceY f h@(Histogram (Bin2D bX _) _ _) = Histogram bX Nothing $ G.generate (nBins bX) (f . sliceAlongY h . Index)++-- | Reduce along Y axis. Information about under/overflows is lost.+breduceY :: (Vector v a, Vector v b, Bin bX, Bin bY)+ => (BinValue bX -> Histogram v bY a -> b) -- ^ Function to reduce histogram along Y axis+ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram+ -> Histogram v bX b+breduceY f h@(Histogram (Bin2D bX _) _ _) =+ Histogram bX Nothing $ G.generate (nBins bX) $ \i -> f (fromIndex bX i) $ sliceAlongY h (Index i)+ -- | Transform X slices of histogram. liftX :: (Bin bX, Bin bY, Bin bX', BinEq bX', Vector v a, Vector v b)
histogram-fill.cabal view
@@ -1,9 +1,13 @@ Name: histogram-fill-Version: 0.7.0.0+Version: 0.7.1.0 Synopsis: Library for histograms creation. Description: This is library for histograms filling. Its aim to provide convenient way to create and fill histograms. + .+ Changes in 0.7.1.0+ .+ * breduceX and breduceY are added. . Changes in 0.7.0.0 .