copilot-1.0.2: A stream DSL for writing embedded C monitors.

Language.Copilot.Libs.Statistics

Description

Basic bounded statistics. In the following, a bound n is given stating the number of periods over which to compute the statistic (n == 1 computes it only over the current period).

Synopsis

Documentation

max :: (Streamable a, NumE a) => Int -> Spec a -> Spec aSource

Maximum value.

min :: (Streamable a, NumE a) => Int -> Spec a -> Spec aSource

Minimum value.

sum :: (Streamable a, NumE a) => Int -> Spec a -> Spec aSource

Summation.

mean :: (Streamable a, Fractional a, NumE a) => Int -> Spec a -> Spec aSource

Mean value. n must not overflow for word size a for streams over which computation is peformed.

meanNow :: (Streamable a, IntegralE a) => [Spec a] -> Spec aSource

Mean value over the current set of specs passed in.