本文整理汇总了Java中it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java Long2LongOpenHashMap.containsKey方法的具体用法?Java Long2LongOpenHashMap.containsKey怎么用?Java Long2LongOpenHashMap.containsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap
的用法示例。
在下文中一共展示了Long2LongOpenHashMap.containsKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateConditions
import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; //导入方法依赖的package包/类
public List<LongArrayList> calculateConditions(PositionListIndex partialUnique,
PositionListIndex PLICondition,
int frequency,
List<LongArrayList> unsatisfiedClusters) {
List<LongArrayList> result = new LinkedList<>();
Long2LongOpenHashMap uniqueHashMap = partialUnique.asHashMap();
LongArrayList touchedClusters = new LongArrayList();
nextCluster:
for (LongArrayList cluster : PLICondition.getClusters()) {
int unsatisfactionCount = 0;
touchedClusters.clear();
for (long rowNumber : cluster) {
if (uniqueHashMap.containsKey(rowNumber)) {
if (touchedClusters.contains(uniqueHashMap.get(rowNumber))) {
unsatisfactionCount++;
} else {
touchedClusters.add(uniqueHashMap.get(rowNumber));
}
}
}
if (unsatisfactionCount == 0) {
result.add(cluster);
} else {
//if ((cluster.size() - unsatisfactionCount) >= frequency) {
unsatisfiedClusters.add(cluster);
//}
}
}
return result;
}
示例2: remove
import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; //导入方法依赖的package包/类
public boolean remove(long conditionClusterNumber, ConditionEntry entryToRemove) {
if (entryToRemove.condition.getSetBits().size() < 2) {
if (((this.size - entryToRemove.cluster.size()) + this.andJointCluster.size())
>= this.frequency) {
this.size = this.size - entryToRemove.cluster.size();
this.conditionClusters.remove(conditionClusterNumber);
this.removedConditionClusters.add(conditionClusterNumber);
return true;
} else {
return false;
}
} else {
Long2LongOpenHashMap newAndJointCluster = andJointCluster.clone();
for (long row : entryToRemove.cluster) {
if (newAndJointCluster.containsKey(row)) {
long previousValue = newAndJointCluster.get(row);
previousValue--;
if (0 == previousValue) {
newAndJointCluster.remove(row);
} else {
newAndJointCluster.put(row, previousValue);
}
} else {
//dunno
}
}
if (this.size + newAndJointCluster.size() >= this.frequency) {
this.andJointCluster = newAndJointCluster;
this.conditionClusters.remove(conditionClusterNumber);
this.removedConditionClusters.add(conditionClusterNumber);
return true;
} else {
return false;
}
}
}
示例3: calculateConditions
import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; //导入方法依赖的package包/类
public List<LongArrayList> calculateConditions(PositionListIndex partialUnique,
PositionListIndex PLICondition,
int frequency,
List<LongArrayList> unsatisfiedClusters) {
List<LongArrayList> result = new LinkedList<>();
Long2LongOpenHashMap uniqueHashMap = partialUnique.asHashMap();
LongArrayList touchedClusters = new LongArrayList();
nextCluster:
for (LongArrayList cluster : PLICondition.getClusters()) {
if (cluster.size() < frequency) {
continue;
}
int unsatisfactionCount = 0;
touchedClusters.clear();
for (long rowNumber : cluster) {
if (uniqueHashMap.containsKey(rowNumber)) {
if (touchedClusters.contains(uniqueHashMap.get(rowNumber))) {
unsatisfactionCount++;
} else {
touchedClusters.add(uniqueHashMap.get(rowNumber));
}
}
}
if (unsatisfactionCount == 0) {
result.add(cluster);
} else {
if ((cluster.size() - unsatisfactionCount) >= frequency) {
unsatisfiedClusters.add(cluster);
}
}
}
return result;
}
示例4: combineClusterIntoResult
import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; //导入方法依赖的package包/类
protected void combineClusterIntoResult(ColumnCombinationBitset partialUnique)
throws AlgorithmExecutionException {
LongArrayList touchedCluster = new LongArrayList();
Long2LongOpenHashMap partialUniqueHash = this.algorithm.getPLI(partialUnique).asHashMap();
Set<ColumnCombinationBitset> startPoints = this.getConditionStartPoints();
for (ColumnCombinationBitset minimalConditionStartPoint : startPoints) {
if (minimalConditionStartPoint.getSetBits().size() != 1) {
minimalConditionStartPoint =
minimalConditionStartPoint.getContainedOneColumnCombinations().get(0);
}
List<ConditionEntry> satisfiedCluster = new ArrayList<>();
Long2ObjectOpenHashMap<LongArrayList> intersectingCluster = new Long2ObjectOpenHashMap<>();
int clusterNumber = 0;
//build intersecting cluster
for (ConditionEntry singleCluster : this.singleConditions.get(minimalConditionStartPoint)) {
satisfiedCluster.add(singleCluster.setClusterNumber(clusterNumber));
touchedCluster.clear();
for (long rowNumber : singleCluster.cluster) {
if (partialUniqueHash.containsKey(rowNumber)) {
touchedCluster.add(partialUniqueHash.get(rowNumber));
}
}
for (long partialUniqueClusterNumber : touchedCluster) {
if (intersectingCluster.containsKey(partialUniqueClusterNumber)) {
intersectingCluster.get(partialUniqueClusterNumber).add(clusterNumber);
} else {
LongArrayList newConditionClusterNumbers = new LongArrayList();
newConditionClusterNumbers.add(clusterNumber);
intersectingCluster.put(partialUniqueClusterNumber, newConditionClusterNumbers);
}
}
clusterNumber++;
}
intersectingCluster = purgeIntersectingClusterEntries(intersectingCluster);
//convert into list
List<LongArrayList> intersectingClusterList = new ArrayList<>();
for (long partialUniqueCluster : intersectingCluster.keySet()) {
intersectingClusterList.add(intersectingCluster.get(partialUniqueCluster));
}
Object2FloatArrayMap<List<ConditionEntry>>
clustergroups =
this.combineClusters(this.algorithm.frequency, satisfiedCluster,
intersectingClusterList);
for (List<ConditionEntry> singleCondition : clustergroups.keySet()) {
ResultSingleton.getInstance().addConditionToResult(partialUnique, singleCondition,
clustergroups.get(singleCondition));
}
}
}