dgim-0.0.3: Implementation of DGIM algorithm

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Stream.Algorithms.DGIM

Contents

Synopsis

Type (no constructors)

data DGIM a Source

The core data structure which contains the current state as well as the parameters needed for operation.

Instances

Show (DGIM a) 

External interface

mkDGIM :: (RealFrac a, Eq b) => a -> Integer -> (b -> Bool) -> DGIM b Source

Create a new DGIM structure given: - Required accuracy - Size of the stream to operate on - Predicate to determine if an element should be counted

insert :: a -> DGIM a -> DGIM a Source

Insert an element into the stream

insert_ :: DGIM a -> DGIM a Source

Insert an element which does not count

querySince :: DGIM a -> Integer -> Integer Source

Query how many elements have been counted since a time-stamp

queryAll :: DGIM a -> Integer Source

Query how many elements have been counted in the remembered suffix of the stream

queryLen :: DGIM a -> Integer -> Integer Source

Query how many elements in the given number of recent entries have been counted.