class
Crystallabs::Helpers::RunningAverage
- Crystallabs::Helpers::RunningAverage
- Reference
- Object
Overview
An O(1) running average over the last capacity values pushed into it.
Wraps a deque rather than subclassing Deque(Int32): subclassing a stdlib
generic is deprecated and promotes every Deque(Int32) in the program
(including unrelated shards) to the virtual type Deque(Int32)+, causing
confusing compile errors elsewhere.
Defined in:
crystallabs-helpers.crConstructors
Instance Method Summary
-
#avg(value : Int32) : Int64
Pushes value and returns the average over the retained window.