本文整理汇总了Java中it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap.defaultReturnValue方法的典型用法代码示例。如果您正苦于以下问题:Java Int2IntOpenHashMap.defaultReturnValue方法的具体用法?Java Int2IntOpenHashMap.defaultReturnValue怎么用?Java Int2IntOpenHashMap.defaultReturnValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap
的用法示例。
在下文中一共展示了Int2IntOpenHashMap.defaultReturnValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFasterIntersectionMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
private Int2IntMap getFasterIntersectionMap(int uidx) {
Int2IntOpenHashMap intersectionMap = new Int2IntOpenHashMap();
intersectionMap.defaultReturnValue(0);
IntIterator iidxs = data.getUidxIidxs(uidx);
while (iidxs.hasNext()) {
IntIterator vidxs = data.getIidxUidxs(iidxs.nextInt());
while (vidxs.hasNext()) {
intersectionMap.addTo(vidxs.nextInt(), 1);
}
}
intersectionMap.remove(uidx);
return intersectionMap;
}
示例2: getIntersectionMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
private Int2IntMap getIntersectionMap(int idx1) {
Int2IntOpenHashMap intersectionMap = new Int2IntOpenHashMap();
intersectionMap.defaultReturnValue(0);
data.getUidxPreferences(idx1)
.forEach(ip -> data.getIidxPreferences(ip.v1)
.forEach(up -> intersectionMap.addTo(up.v1, 1)));
intersectionMap.remove(idx1);
return intersectionMap;
}
示例3: IntIntMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
public IntIntMap(int initialCapacity) {
if (initialCapacity <= 0) {
throw new IllegalArgumentException("Initial capacity must be > 0");
}
_map = new Int2IntOpenHashMap(initialCapacity);
_map.defaultReturnValue(0);
}
示例4: IntToIndex
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
public IntToIndex(int initialCapacity) {
if (initialCapacity <= 0) {
throw new IllegalArgumentException("Initial capacity must be > 0");
}
_map = new Int2IntOpenHashMap(initialCapacity);
_map.defaultReturnValue(-1);
}
示例5: OnHeapIntDictionary
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
/**
* Constructor for the class.
* Populates the value <-> mappings.
*
* @param dataBuffer Pinot data buffer
* @param length Length of the dictionary
*/
public OnHeapIntDictionary(PinotDataBuffer dataBuffer, int length) {
super(dataBuffer, length, V1Constants.Numbers.INTEGER_SIZE, (byte) 0);
_valToDictId = new Int2IntOpenHashMap(length);
_valToDictId.defaultReturnValue(-1);
_dictIdToVal = new int[length];
for (int dictId = 0; dictId < length; dictId++) {
int value = getInt(dictId);
_dictIdToVal[dictId] = value;
_valToDictId.put(value, dictId);
}
}
示例6: MapIntegerDBIDDBIDStore
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param size Expected size
*/
public MapIntegerDBIDDBIDStore(int size) {
super();
map = new Int2IntOpenHashMap(size);
map.defaultReturnValue(DBIDUtil.asInteger(DBIDUtil.invalid()));
}
示例7: createNewInt2IntMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
public static Int2IntOpenHashMap createNewInt2IntMap(int initialSize) {
Int2IntOpenHashMap result = new Int2IntOpenHashMap(initialSize);
result.defaultReturnValue(0);
return result;
}
示例8: IntToIdMap
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
public IntToIdMap() {
_valueToIdMap = new Int2IntOpenHashMap();
_valueToIdMap.defaultReturnValue(INVALID_KEY);
_idToValueMap = new IntArrayList();
}
示例9: MapIntegerDBIDIntegerStore
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param size Expected size
* @param def Default value
*/
public MapIntegerDBIDIntegerStore(int size, int def) {
super();
map = new Int2IntOpenHashMap(size);
map.defaultReturnValue(def);
}
示例10: initialize
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; //导入方法依赖的package包/类
/**
* Initialize the values of the vector. The default value is 0.0
*
* @param size the size of the vector
*/
private void initialize(int size) {
entries = new Int2IntOpenHashMap(size);
entries.defaultReturnValue(0);
}