Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1028468 // test_AllOnAll_probabilistic

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3517L/22K).

1  
svoid test_AllOnAll_probabilistic() {
2  
  new AllOnAll_probabilistic<Int, Int> aoa;
3  
  aoa.addA(2);
4  
  aoa.addA(4);
5  
  aoa.addB(6);
6  
  aoa.addB(100);
7  
  aoa.addB(95);
8  
  aoa.addB(30);
9  
  aoa.probabilityForPair = (a, b) -> (double) a*b;
10  
  assertEqualsVerbose(tlft([[
11  
    <4, 100>
12  
    <4, 95>
13  
    <2, 100>
14  
    <2, 95>
15  
    <4, 30>
16  
    <2, 30>
17  
    <4, 6>
18  
    <2, 6>
19  
  ]]),
20  
  tlft(hijackPrint(r { printWhileNotNull(() -> aoa.next()) })));
21  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028468
Snippet name: test_AllOnAll_probabilistic
Eternal ID of this version: #1028468/1
Text MD5: bceebb86f5a1f077b49d3c6c3ddff7ea
Transpilation MD5: 3ae53a82b9f21dc1b6d472d0d8d10f84
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-20 22:42:17
Source code size: 446 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 135 / 207
Referenced in: [show references]