@Nonnull @Override public Integer extractFinalResult(@Nonnull IntOpenHashSet intermediateResult) { return intermediateResult.size(); }
public int size() { return this.ints.size() + this.longs.size(); } }
@Override public void toData(DataOutput out) throws IOException { super.toData(out); DataSerializer.writeInteger(this.originatingDSId, out); if (this.receipientDSIds != null) { out.writeInt(this.receipientDSIds.size()); for (Integer gateway : this.receipientDSIds) { out.writeInt(gateway); } } else { out.writeInt(0); } }
@Override public int countUnique() { IntOpenHashSet hashSet = new IntOpenHashSet(data); hashSet.remove(TimeColumnType.missingValueIndicator()); return hashSet.size(); }
String group = _groups.get(i); Assert.assertEquals(((Double) trimmedSumResultMap.get(group)).intValue(), i, ERROR_MESSAGE); Assert.assertEquals(((IntOpenHashSet) trimmedDistinctCountResultMap.get(group)).size(), i / (NUM_GROUPS / MAX_SIZE_OF_SET) + 1, ERROR_MESSAGE); finalDistinctCountResultMap.put(entry.getKey(), ((IntOpenHashSet) entry.getValue()).size());
while (intSet.size() < NUM_VALUES) { intSet.add(RANDOM.nextInt());
/** * @return the cardinality of the set of sources/targets */ public int getSize() { return documentList.size(); }
@Override public Integer reduce(List<IntOpenHashSet> combineResults) { if (combineResults.isEmpty()) { return 0; } IntOpenHashSet ret = combineResults.get(0); for (int i = 1; i < combineResults.size(); i++) { ret.addAll(combineResults.get(i)); } return ret.size(); }
private long numBitsForMistakes() { if (emptyTrie) return 0; return corrections.numBits() + mistakeSignatures.size() * (long)Integer.SIZE; }
public int size() { return this.ints.size() + this.longs.size(); } }
@Override public boolean addAll(Collection<? extends Integer> c) { // The resulting collection will be at least c.size() big if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @Override
this.numInputsToUpdate = numInputs.size(); return partialDots;
@Override public int countUnique() { IntOpenHashSet hashSet = new IntOpenHashSet(data); hashSet.remove(TimeColumnType.missingValueIndicator()); return hashSet.size(); }
/** * Serializes an AnchorText object * * @param out * Output Stream */ public void write(DataOutput out) throws IOException { out.writeByte(type); if(hasValidText()) { out.writeUTF(text); } if(hasValidDocumentList()) { out.writeInt(documentList.size()); IntIterator iterator = documentList.iterator(); while(iterator.hasNext()) { out.writeInt(iterator.next()); } } if(hasValidWeight()) { out.writeFloat(weight); } }
/** * Does a thorough comparison of two AnchorText objects. */ public boolean equals(Object obj) { AnchorText other = (AnchorText) obj; if(hasValidDocumentList() && other.hasValidDocumentList()) { if(documentList.size() != other.documentList.size()) { return false; } IntIterator iterator = documentList.iterator(); while(iterator.hasNext()) { if(!other.containsDocument(iterator.next())) { return false; } } } return equalsIgnoreSources(other); }
@Override public boolean addAll(IntCollection c) { if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @Override
@Override public int[] successorArray() { if (outdegree < 0) { final int d = it0.outdegree(); final int[] s = it0.successorArray(); successors.clear(); for (int i = 0; i < d; i++) { final LazyIntIterator s1 = g1.successors(s[i]); int x; while ((x = s1.nextInt()) >= 0) successors.add(x); } outdegree = successors.size(); succ = IntArrays.ensureCapacity(succ, outdegree, 0); successors.toArray(succ); IntArrays.quickSort(succ, 0, outdegree); } return succ; }