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.

static Map<Int, OptimizedMultiSet<Int>> lcStream_rightPartnerMap(LCStreamingCompressor comp) {
  MultiSet<Int> ms = lcStream_itemCounts(comp);
  new Map<Int, OptimizedMultiSet<Int>> partners;
  for (int i = 0; i < comp.nItems(); i++) {
    IntPair p = comp.getPair(i);
    if (p != null) {
      int n = ms.get(i);
      //print("pair " + p + " => " + n);
      getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b, n);
    }
  }
  
  for (IntPair p : overlappingIntPairs(comp.chain.toList()))
    getOrCreate(() -> new OptimizedMultiSet, partners, p.a).add(p.b);
  
  ret partners;
}

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: 276 / 375
Version history: 7 change(s)
Referenced in: [show references]