当前位置: 首页>>代码示例>>Java>>正文


Java Long2LongOpenHashMap.containsKey方法代码示例

本文整理汇总了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;
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:31,代码来源:OrConditionTraverser.java

示例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;
    }
  }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:37,代码来源:OrConditionTraverser.java

示例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;
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:34,代码来源:SimpleConditionTraverser.java

示例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));
    }
  }
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:53,代码来源:OrConditionTraverser.java


注:本文中的it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap.containsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。