本文整理了Java中it.unimi.dsi.fastutil.ints.IntSet.forEach()
方法的一些代码示例,展示了IntSet.forEach()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IntSet.forEach()
方法的具体详情如下:
包路径:it.unimi.dsi.fastutil.ints.IntSet
类名称:IntSet
方法名:forEach
暂无
代码示例来源:origin: RankSys/RankSys
@Override
public Stream<? extends FMInstance> stream() {
return uidxs.stream()
.flatMap(uidx -> {
IntSet uidxIidxs = new IntOpenHashSet();
prefs.getUidxIidxs(uidx).forEachRemaining(uidxIidxs::add);
List<FMInstance> instances = new ArrayList<>();
// adding positive examples
uidxIidxs
.forEach(iidx -> instances.add(getInstance(uidx, iidx, 1.0)));
// adding negative examples
rnd.ints(iidxs.size(), 0, iidxs.size()).map(iidxs::getInt)
.filter(jidx -> !uidxIidxs.contains(jidx))
.distinct()
.limit((int) (negativeProp * uidxIidxs.size()))
.forEach(jidx -> instances.add(getInstance(uidx, jidx, 0.0)));
Collections.shuffle(instances);
return instances.stream();
});
}
代码示例来源:origin: com.qwazr/qwazr-search
void reduce(final GroupQueue groupQueue) {
docIds.keySet()
.forEach((IntConsumer) ord -> groupQueue.offer(sdv.lookupOrd(ord), scores.get(ord), count.get(ord),
(bytesRef, score, collapsedCount) -> new GroupLeader(context, bytesRef, docIds.get(ord),
score, collapsedCount)));
}
代码示例来源:origin: vmware/hillview
mutableInteger.set(count);
toRemove.forEach((IntConsumer) hMap::remove);
min = !hMap.isEmpty() ? Collections.min(hMap.values(), MutableInteger.COMPARATOR).get() : 0;
内容来源于网络,如有侵权,请联系作者删除!