it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet Java Examples
The following examples show how to use
it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 6 votes |
public Attribute(int attributeId, List<String> attributeTypes, PruningStatistics pruningStatistics) { this.attributeId = attributeId; int numAttributes = attributeTypes.size(); this.referenced = new IntLinkedOpenHashSet(numAttributes); this.dependents = new IntLinkedOpenHashSet(numAttributes); for (int i = 0; i < numAttributes; i++) { if ((i != this.attributeId) && (DatabaseUtils.matchSameDataTypeClass(attributeTypes.get(i), attributeTypes.get(this.attributeId)))) { if (pruningStatistics.isValid(i, this.attributeId)) this.dependents.add(i); if (pruningStatistics.isValid(this.attributeId, i)) this.referenced.add(i); } } }
Example #2
Source File: GreedyReranker.java From RankSys with Mozilla Public License 2.0 | 6 votes |
/** * Returns the permutation to obtain the re-ranking * * @return permutation to obtain the re-ranking */ public int[] rerankPermutation() { List<Tuple2od<I>> list = recommendation.getItems(); IntList perm = new IntArrayList(); IntLinkedOpenHashSet remainingI = new IntLinkedOpenHashSet(); IntStream.range(0, list.size()).forEach(remainingI::add); while (!remainingI.isEmpty() && perm.size() < min(maxLength, cutoff)) { int bestI = selectItem(remainingI, list); perm.add(bestI); remainingI.remove(bestI); update(list.get(bestI)); } while (perm.size() < min(maxLength, list.size())) { perm.add(remainingI.removeFirstInt()); } return perm.toIntArray(); }
Example #3
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 5 votes |
public Attribute(int attributeId, List<String> attributeTypes, RelationalInputGenerator inputGenerator, int inputRowLimit, int relativeAttributeIndex, File tempFolder, long maxMemoryUsage, int memoryCheckFrequency) throws AlgorithmExecutionException { this.attributeId = attributeId; int numAttributes = attributeTypes.size(); this.referenced = new IntLinkedOpenHashSet(numAttributes); this.dependents = new IntLinkedOpenHashSet(numAttributes); for (int i = 0; i < numAttributes; i++) { if ((i != this.attributeId) && (DatabaseUtils.matchSameDataTypeClass(attributeTypes.get(i), attributeTypes.get(this.attributeId)))) { this.referenced.add(i); this.dependents.add(i); } } try { // Read, sort and write attribute TPMMS.sortToDisk(inputGenerator, inputRowLimit, tempFolder.getPath() + File.separator + attributeId, relativeAttributeIndex, maxMemoryUsage, memoryCheckFrequency); // Open reader on written values this.valueReader = FileUtils.buildFileReader(tempFolder.getPath() + File.separator + attributeId); // TODO: Use Metanome temp file functionality here this.currentValue = ""; // currentValue must not be null, otherwise no nextValue will be read! this.nextValue(); } catch (IOException e) { e.printStackTrace(); throw new AlgorithmExecutionException(e.getMessage()); } }
Example #4
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 4 votes |
public IntLinkedOpenHashSet getReferenced() { return this.referenced; }
Example #5
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 4 votes |
public IntLinkedOpenHashSet getDependents() { return this.dependents; }
Example #6
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 4 votes |
public IntLinkedOpenHashSet getReferenced() { return this.referenced; }
Example #7
Source File: Attribute.java From metanome-algorithms with Apache License 2.0 | 4 votes |
public IntLinkedOpenHashSet getDependents() { return this.dependents; }
Example #8
Source File: Object2IntHashMultimap.java From BungeeTabListPlus with GNU General Public License v3.0 | 4 votes |
public void put(T key, int value) { IntCollection collection = map.computeIfAbsent(key, k -> new IntLinkedOpenHashSet(2, .75f)); collection.add(value); }