histogram-fill-0.1.0: Library for histograms creation.

Stabilityexperimental
MaintainerAlexey Khudyakov <alexey.skladnoy@gmail.com>

Data.Histogram

Contents

Description

Immutable histograms.

Synopsis

Immutable histogram

data Histogram bin a whereSource

Immutable histogram. Histogram consists of binning algorithm, optional number of under and overflows, and data.

Constructors

Histogram :: (Bin bin, UA a) => bin -> Maybe (a, a) -> UArr a -> Histogram bin a 

Instances

(Show a, Show (BinValue bin), Show bin) => Show (Histogram bin a) 

mapHist :: UA b => (a -> b) -> Histogram bin a -> Histogram bin bSource

fmap lookalike. It's not possible to create Functor instance because of UA restriction.

histBin :: Histogram bin a -> binSource

Histogram bins

histData :: Histogram bin a -> UArr aSource

Histogram data as vector

underflows :: Histogram bin a -> Maybe aSource

Number of underflows

overflows :: Histogram bin a -> Maybe aSource

Number of overflows

outOfRange :: Histogram bin a -> Maybe (a, a)Source

Underflows and overflows

readHistogram :: (Read bin, Read a, Bin bin, UA a) => String -> Histogram bin aSource

Convert String to histogram. Histogram do not have Read instance because of slowness of ReadP

Conversion

asList :: Histogram bin a -> [(BinValue bin, a)]Source

Convert histogram to list.

asPairVector :: UA (BinValue bin) => Histogram bin a -> (UArr (BinValue bin), UArr a)Source

Convert to pair of vectors

asVectorPairs :: UA (BinValue bin) => Histogram bin a -> UArr (BinValue bin :*: a)Source

Convert to vector of pairs

Slicing

sliceY :: (Bin bX, Bin bY) => Histogram (Bin2D bX bY) a -> [(BinValue bY, Histogram bX a)]Source

Slice 2D histogram along Y axis. This function is fast because it does not require reallocations.

sliceX :: (Bin bX, Bin bY) => Histogram (Bin2D bX bY) a -> [(BinValue bX, Histogram bY a)]Source

Slice 2D histogram along X axis.