dgim-0.0.3: Implementation of DGIM algorithm

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Stream.Algorithms.DGIM.Internal

Contents

Synopsis

Type (with constructors)

data DGIM a Source

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

Constructors

DGIM 

Instances

Show (DGIM a) 

Creation

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

Insertion

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

Querying

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.