Numcry::Accumulate
Tools for producing cumulative values across collections.
Instance methods
Accumulate the results of applying the passed block to each element in collection and the previous cumulative value, starting with initial.
accumulate((1..3), 10) { |a, b| a + b } # => [11, 13, 16]
Return an Array containing the cumulative product of elements from
collection.
cumprod((1..3)) # => [1, 2, 6]
Return an Array containing the cumulative sum of elements from
collection.
cumsum((1..3)) # => [1, 3, 6]