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

17
LINES

< > BotCompany Repo | #1029117 // lcStream_rightPartnerMap

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

Transpiled version (4694L) is out of date.

1  
static Map<Int, OptimizedMultiSet<Int>> lcStream_rightPartnerMap(LCStreamingCompressor comp) {
2  
  MultiSet<Int> ms = lcStream_itemCounts(comp);
3  
  new Map<Int, OptimizedMultiSet<Int>> partners;
4  
  for (int i = 0; i < comp.nItems(); i++) {
5  
    IntPair p = comp.getPair(i);
6  
    if (p != null) {
7  
      int n = ms.get(i);
8  
      //print("pair " + p + " => " + n);
9  
      getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b, n);
10  
    }
11  
  }
12  
  
13  
  for (IntPair p : overlappingIntPairs(comp.chain.toList()))
14  
    getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b);
15  
  
16  
  ret partners;
17  
}

Author comment

Began life as a copy of #1029110

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: #1029117
Snippet name: lcStream_rightPartnerMap
Eternal ID of this version: #1029117/8
Text MD5: cc3dffd6f8809860a138a39e3e50bd85
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-20 01:55:40
Source code size: 611 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 278 / 377
Version history: 7 change(s)
Referenced in: [show references]