Java Code Examples for it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap#get()
The following examples show how to use
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap#get() .
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: FDTree.java From metanome-algorithms with Apache License 2.0 | 6 votes |
public void generalize() { int maxLevel = this.numAttributes; // Build an index level->nodes for the top-down, level-wise traversal Int2ObjectOpenHashMap<ArrayList<ElementLhsPair>> level2elements = new Int2ObjectOpenHashMap<>(maxLevel); for (int level = 0; level < maxLevel; level++) level2elements.put(level, new ArrayList<ElementLhsPair>()); this.addToIndex(level2elements, 0, new BitSet(this.numAttributes)); // Traverse the levels top-down and add all direct generalizations for (int level = maxLevel - 1; level >= 0; level--) { for (ElementLhsPair pair : level2elements.get(level)) { // Remove isFDs, because we will mark valid FDs later on pair.element.removeAllFds(); // Generate and add generalizations for (int lhsAttr = pair.lhs.nextSetBit(0); lhsAttr >= 0; lhsAttr = pair.lhs.nextSetBit(lhsAttr + 1)) { pair.lhs.clear(lhsAttr); de.metanome.algorithms.cfdfinder.structures.FDTreeElement generalization = this.addGeneralization(pair.lhs, pair.element.getRhsAttributes()); if (generalization != null) level2elements.get(level - 1).add(new ElementLhsPair(generalization, (BitSet) pair.lhs.clone())); pair.lhs.set(lhsAttr); } } } }
Example 2
Source File: SPIDER.java From metanome-algorithms with Apache License 2.0 | 6 votes |
private void output() throws CouldNotReceiveResultException, ColumnNameMismatchException { // Read the discovered INDs from the attributes Int2ObjectOpenHashMap<IntList> dep2ref = new Int2ObjectOpenHashMap<IntList>(this.numColumns); for (Attribute spiderAttribute : this.attributeId2attributeObject.values()) if (!spiderAttribute.getReferenced().isEmpty()) dep2ref.put(spiderAttribute.getAttributeId(), new IntArrayList(spiderAttribute.getReferenced())); // Write the result to the resultReceiver for (int dep : dep2ref.keySet()) { String depTableName = this.getTableNameFor(dep, this.tableColumnStartIndexes); String depColumnName = this.columnNames.get(dep); for (int ref : dep2ref.get(dep)) { String refTableName = this.getTableNameFor(ref, this.tableColumnStartIndexes); String refColumnName = this.columnNames.get(ref); this.resultReceiver.receiveResult(new InclusionDependency(new ColumnPermutation(new ColumnIdentifier(depTableName, depColumnName)), new ColumnPermutation(new ColumnIdentifier(refTableName, refColumnName)))); this.numUnaryINDs++; } } }
Example 3
Source File: FDTree.java From metanome-algorithms with Apache License 2.0 | 6 votes |
public void generalize() { int maxLevel = this.numAttributes; // Build an index level->nodes for the top-down, level-wise traversal Int2ObjectOpenHashMap<ArrayList<ElementLhsPair>> level2elements = new Int2ObjectOpenHashMap<>(maxLevel); for (int level = 0; level < maxLevel; level++) level2elements.put(level, new ArrayList<ElementLhsPair>()); this.addToIndex(level2elements, 0, new BitSet(this.numAttributes)); // Traverse the levels top-down and add all direct generalizations for (int level = maxLevel - 1; level >= 0; level--) { for (ElementLhsPair pair : level2elements.get(level)) { // Remove isFDs, because we will mark valid FDs later on pair.element.removeAllFds(); // Generate and add generalizations for (int lhsAttr = pair.lhs.nextSetBit(0); lhsAttr >= 0; lhsAttr = pair.lhs.nextSetBit(lhsAttr + 1)) { pair.lhs.clear(lhsAttr); FDTreeElement generalization = this.addGeneralization(pair.lhs, pair.element.getRhsAttributes()); if (generalization != null) level2elements.get(level - 1).add(new ElementLhsPair(generalization, (BitSet) pair.lhs.clone())); pair.lhs.set(lhsAttr); } } } }
Example 4
Source File: FDTree.java From winter with Apache License 2.0 | 6 votes |
public void generalize() { int maxLevel = this.numAttributes; // Build an index level->nodes for the top-down, level-wise traversal Int2ObjectOpenHashMap<ArrayList<ElementLhsPair>> level2elements = new Int2ObjectOpenHashMap<>(maxLevel); for (int level = 0; level < maxLevel; level++) level2elements.put(level, new ArrayList<ElementLhsPair>()); this.addToIndex(level2elements, 0, new OpenBitSet(this.numAttributes)); // Traverse the levels top-down and add all direct generalizations for (int level = maxLevel - 1; level >= 0; level--) { for (ElementLhsPair pair : level2elements.get(level)) { // Remove isFDs, because we will mark valid FDs later on pair.element.removeAllFds(); // Generate and add generalizations for (int lhsAttr = pair.lhs.nextSetBit(0); lhsAttr >= 0; lhsAttr = pair.lhs.nextSetBit(lhsAttr + 1)) { pair.lhs.clear(lhsAttr); FDTreeElement generalization = this.addGeneralization(pair.lhs, pair.element.getRhsAttributes()); if (generalization != null) level2elements.get(level - 1).add(new ElementLhsPair(generalization, pair.lhs.clone())); pair.lhs.set(lhsAttr); } } } }
Example 5
Source File: ItemStackComplexRemapperRegistry.java From ProtocolSupport with GNU Affero General Public License v3.0 | 6 votes |
protected static NetworkItemStack remapComplex( Int2ObjectOpenHashMap<EnumMap<ProtocolVersion, List<ItemStackComplexRemapper>>> registry, ProtocolVersion version, String locale, NetworkItemStack itemstack ) { EnumMap<ProtocolVersion, List<ItemStackComplexRemapper>> map = registry.get(itemstack.getTypeId()); if (map != null) { List<ItemStackComplexRemapper> transformers = map.get(version); if (transformers != null) { for (ItemStackComplexRemapper transformer : transformers) { itemstack = transformer.remap(version, locale, itemstack); } } } return itemstack; }
Example 6
Source File: MToNSimple.java From twister2 with Apache License 2.0 | 5 votes |
private RoutingParameters sendRoutingParameters(int source, int path) { Int2ObjectOpenHashMap p = routingParamCache.get(source); if (p.containsKey(path)) { return (RoutingParameters) p.get(path); } else { RoutingParameters routingParameters = new RoutingParameters(); routingParameters.setDestinationId(path); routingParameters.addInteranlRoute(source); p.put(path, routingParameters); return routingParameters; } }
Example 7
Source File: TopologicalIndex.java From data-polygamy with BSD 3-Clause "New" or "Revised" License | 5 votes |
void getEvents(ArrayList<byte[]> events, double eventTh, Int2ObjectOpenHashMap<Feature[] > featureMap, boolean min, Attribute att) { // getting events using merge tree for (int tempBin : att.data.keySet()) { Feature[] features = featureMap.get(tempBin); GraphInput tf = functions.get(tempBin); getEvents(events, tf, features, min, eventTh, false); if (min) { att.minThreshold.put(tempBin, new Float(eventTh)); } else { att.maxThreshold.put(tempBin, new Float(eventTh)); } } }