@Override public void clear() { set.clear(); }
@Override public void readFields(DataInput in) throws IOException { long size = in.readLong(); set.clear(); trim(size); for (long i = 0; i < size; ++i) { set.add(in.readLong()); } } }
/** * populate direct interactions * * @param queryNode is the left query node */ public void addDirectInteractions(long queryNode) { EdgeIterator iterator = bipartiteGraph.getLeftNodeEdges(queryNode); if (iterator == null) { return; } leftNodeEdgeSet.clear(); while (iterator.hasNext()) { leftNodeEdgeSet.add(iterator.nextLong()); } }
/** * Resets all internal state kept for SALSA to enable reuse. * * @param incomingSalsaRequest is the new incoming request */ public void resetWithRequest(SalsaRequest incomingSalsaRequest) { this.salsaRequest = incomingSalsaRequest; nonZeroSeedSet.clear(); currentLeftNodes.clear(); currentRightNodes.clear(); visitedRightNodes.clear(); salsaStats.reset(); incomingSalsaRequest.resetFilters(); }
private static boolean isLessThanMinUserSocialProofSizeCombined( SmallArrayBasedLongToDoubleMap[] socialProofs, int minUserSocialProofSize, Set<byte[]> socialProofTypeUnions) { if (socialProofTypeUnions.isEmpty() || // check if the size of any social proof union is greater than minUserSocialProofSize before dedupping isSocialProofUnionSizeLessThanMin(socialProofs, minUserSocialProofSize, socialProofTypeUnions)) { return true; } LongSet uniqueNodes = new LongOpenHashSet(minUserSocialProofSize); for (byte[] socialProofTypeUnion: socialProofTypeUnions) { // Clear removes all elements, but does not change the size of the set. // Thus, we only use one LongOpenHashSet with at most a size of 2*minUserSocialProofSize uniqueNodes.clear(); for (byte socialProofType: socialProofTypeUnion) { if (socialProofs[socialProofType] != null) { for (int i = 0; i < socialProofs[socialProofType].size(); i++) { uniqueNodes.add(socialProofs[socialProofType].keys()[i]); if (uniqueNodes.size() >= minUserSocialProofSize) { return false; } } } } } return true; }
this.closedConnections.clear();
private static boolean isLessThanMinUserSocialProofSizeCombined( SmallArrayBasedLongToDoubleMap[] socialProofs, int minUserSocialProofSize, Set<byte[]> socialProofTypeUnions) { if (socialProofTypeUnions.isEmpty() || // check if the size of any social proof union is greater than minUserSocialProofSize before dedupping isSocialProofUnionSizeLessThanMin(socialProofs, minUserSocialProofSize, socialProofTypeUnions)) { return true; } LongSet uniqueNodes = new LongOpenHashSet(minUserSocialProofSize); for (byte[] socialProofTypeUnion: socialProofTypeUnions) { // Clear removes all elements, but does not change the size of the set. // Thus, we only use one LongOpenHashSet with at most a size of 2*minUserSocialProofSize uniqueNodes.clear(); for (byte socialProofType: socialProofTypeUnion) { if (socialProofs[socialProofType] != null) { for (int i = 0; i < socialProofs[socialProofType].size(); i++) { uniqueNodes.add(socialProofs[socialProofType].keys()[i]); if (uniqueNodes.size() >= minUserSocialProofSize) { return false; } } } } } return true; }
getConf().createOutEdges(); edges.initialize(edgesPerVertex); destVertices.clear(); destVertices.add(vertexId); long destVertexId = vertexId - edgesPerVertex / 2;
getConf().createOutEdges(); edges.initialize(edgesPerVertex); destVertices.clear(); destVertices.add(vertexId); long destVertexId = vertexId - edgesPerVertex / 2;
private void clear() { this.shader_to_lights.clear(); this.light_shaders.clear(); this.lights.clear(); this.lights_unclipped.clear(); final LongIterator iter = this.clip_groups.keySet().iterator(); while (iter.hasNext()) { final ClipGroup cg = this.clip_groups.get(iter.nextLong()); cg.shader_to_lights.clear(); cg.deleted = true; } this.clip_groups.clear(); }
bipartiteGraph.getRandomRightNodeEdges(node, request.getMaxNumNeighbors(), random); neighborSet.clear(); int repeatedLHSNeighbors = 0; if (currentIterator != null) { leftNeighbor, request.getMaxNumSamplesPerNeighbor(), random); neighborSet.clear(); if (rightNeighborsForLeftNeighbor != null) { // redundant check if degree > 0 while (rightNeighborsForLeftNeighbor.hasNext()) {
this.alreadyTicked.clear(); return Arrays.copyOf( returnVal, index ); } else {