/** * Find a bucket number using a key * @param key * @return Non zero bucket number. Zero if 'not found' */ int getBucketNumber(long key) { return hash.get(key); }
protected int get(long key) { return hash.get(key); }
TLongIntHashMap map = ... int val = map.get(((long) k1 << 32) | k2);
/** Return -1 if entry isn't present. */ public int lookupIndex (long entry, int value) { int ret = map.get(entry); if (ret <= 0 && !growthStopped) { numEntries++; ret = value + 1; map.put (entry, ret); } return ret - 1; // feature id should be 0-based }
/** Return -1 if entry isn't present. */ public int lookupIndex (long entry) { int ret = map.get(entry); if (ret <= 0 && !growthStopped) { numEntries++; ret = numEntries; map.put (entry, ret); } return ret - 1; // feature id should be 0-based }
/** Return -1 if entry isn't present. */ public int lookupIndex (long entry, int value) { int ret = map.get(entry); if (ret <= 0 && !growthStopped) { numEntries++; ret = value + 1; map.put (entry, ret); } return ret - 1; // feature id should be 0-based }
/** Return -1 if entry isn't present. */ public int lookupIndex (long entry) { int ret = map.get(entry); if (ret <= 0 && !growthStopped) { numEntries++; ret = numEntries; map.put (entry, ret); } return ret - 1; // feature id should be 0-based }
/** * Get kmer count * @param nmer * @return */ public int get(Nmer nmer) { long key = nmer.getNmer(); return hash.get(key); }
@Override public int getIdByTitle(String title, Language language, NameSpace nameSpace) throws DaoException { if (titlesToIds==null){ buildTitlesToIds(); } return titlesToIds.get(Title.longHashCode(language, title, nameSpace)); }
/** * Count an instance of this Nmer * @param nmer */ public void count(Nmer nmer) { long key = nmer.getNmer(); int count = hash.get(key) + 1; hash.put(key, count); }
@Override public int getIdByTitle(Title title) throws DaoException { if (titlesToIds==null){ buildTitlesToIds(); } return titlesToIds.get(title.longHashCode()); }
/** * Update counts matrix. * @param dna */ public void updateCounts(String dna, int inc, long rsId) { updateCounts(dna, inc); nmer.set(dna); // Add to Nmer entry long nmerLong = nmer.getNmer(); // Nmer coded as long int count = countSeqs.get(nmerLong); countSeqs.put(nmerLong, count + inc); // Update count // Add to rsId entry count = countRsIds.get(rsId); countRsIds.put(rsId, count + inc); // Update count } }
public CircularFingerprinter.FP[] getFingerprintDetails() { final CircularFingerprinter.FP[] ary = new CircularFingerprinter.FP[HASH_SET.size()]; for (int k=0; k < circularFingerprinter.getFPCount(); ++k) { final CircularFingerprinter.FP fp = circularFingerprinter.getFP(k); if (HASH_SET.containsKey(fp.hashCode)) { ary[HASH_SET.get(fp.hashCode)] = fp; } } return ary; }
private void doVariableBound(IntVar var) throws ContradictionException { TLongIntHashMap map; for (long k : (map = vv2lit[var.getId()]).keys()) { int value = ivalue(k); if (iseq(k)) { if (var.contains(value)) { if (var.isInstantiated()) { VariableBound(map.get(k), true); } } else { VariableBound(map.get(k), false); } } else { if (var.getUB() <= value) { VariableBound(map.get(k), true); } else if (var.getLB() > value) { VariableBound(map.get(k), false); } } } }
if ((var = map.get(lvalue)) == NO_ENTRY) { var = sat_.newVariable(); map.put(lvalue, var);
@Override public IBitFingerprint getBitFingerprint(IAtomContainer container) throws CDKException { final BitSetFingerprint bf = new BitSetFingerprint(getSize()); final ICountFingerprint icfp = circularFingerprinter.getCountFingerprint(container); for (int k=0, n = icfp.numOfPopulatedbins(); k < n; ++k) { final int index = HASH_SET.get(icfp.getHash(k)); if (index >= 0) { if (icfp.getCount(k)>0) bf.set(index, true); } } return bf; }
for(int j = BitsUtil.nextSetBit(scratch, i + 1); j >= 0; j = BitsUtil.nextSetBit(scratch, j + 1)) { long key = (((long) i) << 32) | j; map.put(key, 1 + map.get(key)); ++lives;