Code Examples
A repository of 155 code examples for BeepBeep
|
Compute the sum of every pair of successive events. More...
Static Public Member Functions | |
static void | main (String[] args) |
Compute the sum of every pair of successive events.
Here we are interested in computing the sum of events at position 0-1, 2-3, 4-5, etc. To do so, we compute first the sum of every two successive events, and then keep every other event of the resulting trace. Graphically, this chain of processors can be represented as:
On the input stream 6, 5, 3, 8, 9, 2, 1, 7, 4, 5, …, the expected output of this program is:
Event #0 is: 11 Event #1 is: 11 Event #2 is: 11 Event #3 is: 8 Event #4 is: 9 Event #5 is: 6 Event #6 is: 13 Event #7 is: 20 Event #8 is: 7
Definition at line 61 of file DecimationSum.java.