本文整理汇总了Java中gnu.trove.TIntHashSet.contains方法的典型用法代码示例。如果您正苦于以下问题:Java TIntHashSet.contains方法的具体用法?Java TIntHashSet.contains怎么用?Java TIntHashSet.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntHashSet
的用法示例。
在下文中一共展示了TIntHashSet.contains方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mixClassifications
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private static IClassificationDB mixClassifications(
IClassificationDB trueClassification,
IClassificationDB predictedClassification,
TIntHashSet fromTrueClassification) {
TroveClassificationDBBuilder builder = new TroveClassificationDBBuilder(
trueClassification.getDocumentDB(),
trueClassification.getCategoryDB());
IIntIterator documents = trueClassification.getDocumentDB()
.getDocuments();
while (documents.hasNext()) {
int document = documents.next();
if (fromTrueClassification.contains(document))
copyClassification(document, trueClassification, builder);
else
copyClassification(document, predictedClassification, builder);
}
return builder.getClassificationDB();
}
示例2: Incremental
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public Incremental(int trainSize, ClassificationScoreDB classification, TIntHashSet categoriesFilter,
EstimationType estimation, ContingencyTableSet evaluation, IGain gain, IGain firstRankGain, double[] probabilitySlope, double[] prevalencies) {
super(trainSize, classification, categoriesFilter, estimation, evaluation, firstRankGain, probabilitySlope, prevalencies);
macroRankTable = new TIntDoubleHashMap((int) (testSize + testSize * 0.25), (float) 0.75);
microRankTable = new TIntDoubleHashMap((int) (testSize + testSize * 0.25), (float) 0.75);
macroAlreadySeen = new TIntHashSet((int) (testSize + testSize * 0.25), (float) 0.75);
microAlreadySeen = new TIntHashSet((int) (testSize + testSize * 0.25), (float) 0.75);
probabilities = new double[testSize][numOfCategories];
for (int docId = 0; docId < testSize; docId++) {
Set<Entry<Short, ClassifierRangeWithScore>> entries = classification.getDocumentScoresAsSet(docId);
Iterator<Entry<Short, ClassifierRangeWithScore>> iterator = entries.iterator();
while (iterator.hasNext()) {
Entry<Short, ClassifierRangeWithScore> next = iterator.next();
ClassifierRangeWithScore value = next.getValue();
if (categoriesFilter.contains(next.getKey())) {
probabilities[docId][catMap.get(next.getKey())] = probability(Math.abs(value.score - value.border), next.getKey());
}
}
}
}
示例3: getSafeToDeleteOutputs
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public Collection<String> getSafeToDeleteOutputs(Collection<String> outputPaths, int currentTargetId) throws IOException {
final int size = outputPaths.size();
if (size == 0) {
return outputPaths;
}
final Collection<String> result = new ArrayList<String>(size);
for (String outputPath : outputPaths) {
final int key = FileUtil.pathHashCode(outputPath);
synchronized (myDataLock) {
final TIntHashSet associatedTargets = getState(key);
if (associatedTargets == null || associatedTargets.size() != 1) {
continue;
}
if (associatedTargets.contains(currentTargetId)) {
result.add(outputPath);
}
}
}
return result;
}
示例4: visitPostOrderIterative
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
private TObjectIntHashMap<Instruction> visitPostOrderIterative(Instruction start, ArrayList<Instruction> instructionsInPostOrderTraversalOfReverseControlFlowGraph) {
TObjectIntHashMap<Instruction>postOrderNumbers = new TObjectIntHashMap<Instruction>();
ArrayList<Instruction> stack = new ArrayList<Instruction>();
TIntHashSet visitedIndices = new TIntHashSet(code.getNumberOfInstructions());
TIntHashSet processedIndices = new TIntHashSet(code.getNumberOfInstructions());
stack.add(start);
while(stack.size() > 0) {
Instruction top = stack.get(stack.size() - 1);
if(visitedIndices.contains(top.getIndex())) {
stack.remove(stack.size() - 1);
if(!processedIndices.contains(top.getIndex())) {
processedIndices.add(top.getIndex());
instructionsInPostOrderTraversalOfReverseControlFlowGraph.add(0, top);
postOrderNumbers.put(top, instructionsInPostOrderTraversalOfReverseControlFlowGraph.size());
}
}
// Remember that we were here, then add the predecessors in reverse order to the stack.
else {
visitedIndices.add(top.getIndex());
int insertionIndex = 0;
for(Instruction predecessor : top.getOrderedPredecessors()) {
if(!visitedIndices.contains(predecessor.getIndex())) {
stack.add(stack.size() - insertionIndex, predecessor);
insertionIndex++;
}
}
}
}
return postOrderNumbers;
}
示例5: isOrIsSubclassOf
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public boolean isOrIsSubclassOf(QualifiedClassName name, QualifiedClassName superclass) {
if(name == null) return false;
if(name == superclass) return true;
TIntHashSet subclasses = getSubclassesOf(superclass);
return subclasses.contains(name.getID());
}
示例6: drawSoftWrapAwareBackground
import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
private int drawSoftWrapAwareBackground(@NotNull Graphics g,
@Nullable Color backColor,
@Nullable Color prevBackColor,
@NotNull CharSequence text,
int start,
int end,
@NotNull Point position,
@JdkConstants.FontStyle int fontType,
@NotNull Color defaultBackground,
@NotNull Rectangle clip,
@NotNull TIntHashSet softWrapsToSkip,
@NotNull boolean[] caretRowPainted) {
int startToUse = start;
// Given 'end' offset is exclusive though SoftWrapModel.getSoftWrapsForRange() uses inclusive end offset.
// Hence, we decrement it if necessary. Please note that we don't do that if start is equal to end. That is the case,
// for example, for soft-wrapped collapsed fold region - we need to draw soft wrap before it.
int softWrapRetrievalEndOffset = end;
if (end > start) {
softWrapRetrievalEndOffset--;
}
List<? extends SoftWrap> softWraps = getSoftWrapModel().getSoftWrapsForRange(start, softWrapRetrievalEndOffset);
for (SoftWrap softWrap : softWraps) {
int softWrapStart = softWrap.getStart();
if (softWrapsToSkip.contains(softWrapStart)) {
continue;
}
if (startToUse < softWrapStart) {
position.x = drawBackground(g, backColor, text, startToUse, softWrapStart, position, fontType, defaultBackground, clip);
}
boolean drawCustomBackgroundAtSoftWrapVirtualSpace =
!Comparing.equal(backColor, defaultBackground) && (softWrapStart > start || Comparing.equal(prevBackColor, backColor));
drawSoftWrap(
g, softWrap, position, fontType, backColor, drawCustomBackgroundAtSoftWrapVirtualSpace, defaultBackground, clip, caretRowPainted
);
startToUse = softWrapStart;
}
if (startToUse < end) {
position.x = drawBackground(g, backColor, text, startToUse, end, position, fontType, defaultBackground, clip);
}
return position.x;
}