public int adjustOrPutValue( long key, int adjust_amount, int put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
public int adjustOrPutValue( long key, int adjust_amount, int put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
@Override public int adjustOrPutValue( long key, int adjust_amount, int put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
public int adjustOrPutValue( long key, int adjust_amount, int put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
public int adjustOrPutValue( long key, int adjust_amount, int put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
/** * Counts a bigram. * @param word */ public void countBigram(String word) { word = word.trim(); if (word.isEmpty()) { return; } if (containsMentions) { Matcher m = PATTERN_MENTION.matcher(word); if (m.matches()) { word = m.group(1); } } long h = getHash(word); synchronized (bigramCounts) { bigramCounts.adjustOrPutValue(h, 1, 1); } if (totalBigrams.incrementAndGet() % PRUNE_INTERVAL == 0) { pruneIfNecessary(); } }
public long getExpectedPosition() { TLongIntMap map = new TLongIntHashMap(); for (Support s : support) { map.adjustOrPutValue(s.expectedLinearPosition, s.weight, s.weight); } return getKeyWithMaxValue(map); } public long getExpectedReferencePosition() {
private TLongIntMap getPhraseLinkCounts() { Iterator<Pair<String, PrunedCounts<Integer>>> phraseIter = phraseDao.getAllPhraseCounts(lang); TLongIntMap counts = new TLongIntHashMap(); while (phraseIter.hasNext()) { Pair<String, PrunedCounts<Integer>> pair = phraseIter.next(); String phrase = cleanString(pair.getLeft()); long hash = hashCode(phrase); int n = pair.getRight().getTotal(); counts.adjustOrPutValue(hash, n, n); } return counts; }
public long getExpectedReferencePosition() { if (!isReference()) throw new IllegalStateException("No reference kmer support"); TLongIntMap map = new TLongIntHashMap(); for (Support s : support) { if (s.isReference) { map.adjustOrPutValue(s.expectedLinearPosition, s.weight, s.weight); } } return getKeyWithMaxValue(map); } public static <T extends DeBruijnNodeBase> long getExpectedReferencePosition(Iterable<T> nodes) {
public static <T extends DeBruijnNodeBase> long getExpectedReferencePosition(Iterable<T> nodes) { TLongIntMap map = new TLongIntHashMap(); for (DeBruijnNodeBase n : nodes) { for (Support s : n.support) { if (s.isReference) { map.adjustOrPutValue(s.expectedLinearPosition, s.weight, s.weight); } } } if (map.isEmpty()) throw new IllegalStateException("No reference support"); return getKeyWithMaxValue(map); } private static long getKeyWithMaxValue(TLongIntMap map) {
n = unigramCounts.adjustOrPutValue(hash, 1, 1);
degrees.adjustOrPutValue(edge.field0, 1, 1); degrees.adjustOrPutValue(edge.field0, 0, 0);