本文整理汇总了Java中it.unimi.dsi.fastutil.longs.Long2LongMap.Entry方法的典型用法代码示例。如果您正苦于以下问题:Java Long2LongMap.Entry方法的具体用法?Java Long2LongMap.Entry怎么用?Java Long2LongMap.Entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.longs.Long2LongMap
的用法示例。
在下文中一共展示了Long2LongMap.Entry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pickUpSampling
import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
private int pickUpSampling(long seconds, long start, int last, Long2LongMap buckets) {
if (seconds < start) {
return 1;
}
long sample = 0;
for (Long2LongMap.Entry e : buckets.long2LongEntrySet()) {
if (seconds < e.getLongKey()) {
sample = e.getLongValue();
break;
}
}
if (sample == 0) {
return last;
}
return (int) sample;
}
示例2: computeNewLabel
import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
private long computeNewLabel(Node node) {
// Count the frequency of labels at neighbours of the current node
labelCounts.clear();
labelCounts.defaultReturnValue(0L);
for (Relationship relationship : node.getRelationships(EDGE, Direction.BOTH)) {
long otherLabel = labels.get(relationship.getOtherNode(node));
labelCounts.put(otherLabel, labelCounts.get(otherLabel) + 1);
}
// Find the most frequent label with the lowest id
long bestLabel = labels.get(node);
long bestFrequency = 0;
for (Long2LongMap.Entry labelFrequencyPair : labelCounts.long2LongEntrySet()) {
long nextLabel = labelFrequencyPair.getLongKey();
long nextFrequency = labelFrequencyPair.getLongValue();
if (nextFrequency > bestFrequency) {
bestLabel = nextLabel;
bestFrequency = nextFrequency;
} else if (nextFrequency == bestFrequency && nextLabel < bestLabel) {
bestLabel = nextLabel;
}
}
return bestLabel;
}
开发者ID:atlarge-research,项目名称:graphalytics-platforms-neo4j,代码行数:25,代码来源:CommunityDetectionLPComputation.java
示例3: contains
import it.unimi.dsi.fastutil.longs.Long2LongMap; //导入方法依赖的package包/类
@Override
public boolean contains(long address) {
if (indexedMemoryAccessChecker != null) {
int result = indexedMemoryAccessChecker.isAllocated(address);
if (result == IndexedMemoryAccessChecker.ALLOCATED) {
return true;
} else if (result == IndexedMemoryAccessChecker.NOT_ALLOCATED) {
return false;
}
// Not indexed, so check over allocated memories
}
Long2LongMap.Entry entry = allocatedMemories.tailMap(address).long2LongEntrySet().first();
if (entry == null) {
return false;
}
long startAddress = entry.getLongKey();
long endAddress = startAddress + entry.getLongValue();
return address >= startAddress && address <= endAddress;
}