!include once #1025078 // RollingMaximum svoid test_RollingMaximum() { int windowSize = 10, n = 100000; RollingMaximum rm = new(windowSize); L<Double> buf = linkedList(); for i to n: { double val = random(); addToListWithMaxSize(buf, val, rm.windowSize); double max = rm.addAndGet(val); try { assertEquals/*Verbose*/(doubleMax(buf), max); } on fail { print(buf); } } }
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025080 |
Snippet name: | test_RollingMaximum (OK) |
Eternal ID of this version: | #1025080/5 |
Text MD5: | d39db2d40da8928684d83d5e1544aa40 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-05 13:18:49 |
Source code size: | 431 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 215 / 269 |
Version history: | 4 change(s) |
Referenced in: | [show references] |