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

Language.Copilot.Libs.Vote

Description

Voting algorithms over streams of data.

Synopsis

Documentation

majority :: (Streamable a, EqE a) => [Spec a] -> Spec aSource

Boyer-Moore linear majority algorithm. Warning! Returns an arbitary element if no majority is returned. See aMajority below.

aMajority :: (Streamable a, EqE a) => [Spec a] -> Spec a -> Spec BoolSource

ftAvg :: (Streamable a, IntegralE a, Bounded a) => [Spec a] -> Int -> Spec aSource

Fault-tolerant average. Throw away the bottom and top n elements and take the average of the rest. Return an error if there are less than 2 * n + 1 elements in the list.