本文整理了Java中gnu.trove.map.hash.TIntIntHashMap.()
方法的一些代码示例,展示了TIntIntHashMap.()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TIntIntHashMap.()
方法的具体详情如下:
包路径:gnu.trove.map.hash.TIntIntHashMap
类名称:TIntIntHashMap
方法名:
TIntIntHashMap.介绍
[英]Creates a new TIntIntHashMap
instance with the default capacity and load factor.
[中]使用默认容量和负载系数创建新的TIntIntHashMap
实例。
代码示例
代码示例来源:origin: FudanNLP/fnlp
public HashFeatureAlphabet() {
intdata = new TIntIntHashMap(DEFAULT_CAPACITY,DEFAULT_LOAD_FACTOR,noEntryValue,noEntryValue);
frozen = false;
last = 0;
}
代码示例来源:origin: FudanNLP/fnlp
@Override
public void run() {
for(int i = 0; i int a = al.get(i);
for(int j = i + 1; j int b = al.get(j);
double lenDiff;
lenDiff = Math.abs(featureLen[a]-featureLen[b]);
lenDiff /=Math.max(featureLen[a],featureLen[b]);
if(lenDiff>lenDiffThresh)
continue;
int ids,idl;
if(a<=b){
ids = a;
idl=b;
}else{
ids = b;
idl=a;
}
if(similarityMap[ids] == null)
similarityMap[ids] = new TIntIntHashMap();
synchronized (similarityMap[ids]) {
similarityMap[ids].adjustOrPutValue(idl, 1, 1);
}
}
}
}
}
代码示例来源:origin: CalebFenton/simplify
ExecutionGraph execute(ExecutionGraph graph) throws VirtualMachineException {
TIntIntMap addressToVisitCount = new TIntIntHashMap();
VirtualMethod method = graph.getMethod();
ExecutionNode node = graph.getRoot();
代码示例来源:origin: CalebFenton/simplify
@Override
public Op create(MethodLocation location, TIntObjectMap addressToLocation, VirtualMachine vm) {
SwitchPayload instr = (SwitchPayload) location.getInstruction();
TIntIntMap targetKeyToOffset = new TIntIntHashMap();
for (SwitchElement element : instr.getSwitchElements()) {
targetKeyToOffset.put(element.getKey(), element.getOffset());
}
return new SwitchPayloadOp(location, addressToLocation, targetKeyToOffset);
}
代码示例来源:origin: opentripplanner/OpenTripPlanner
TIntIntMap initialStops = new TIntIntHashMap();
TIntIntIterator initialIterator = accessTimes.iterator();
while (initialIterator.hasNext()) {
代码示例来源:origin: opentripplanner/OpenTripPlanner
TIntIntMap accessTimes = new TIntIntHashMap();
代码示例来源:origin: opentripplanner/OpenTripPlanner
List patternForIndex = Lists.newArrayList(totalPatterns);
TObjectIntMap indexForPattern = new TObjectIntHashMap<>(totalPatterns, 0.75f, -1);
indexForStop = new TIntIntHashMap(totalStops, 0.75f, Integer.MIN_VALUE, -1);
TIntList stopForIndex = new TIntArrayList(totalStops, Integer.MIN_VALUE);
LOG.warn("Temporary stop at {}, {} not connected to graph", t.lat, t.lon);
temporaryStopTreeCache.put(t.index, new int[0]);
temporaryTransfers.put(t.index, new TIntIntHashMap());
continue;
TIntIntMap transfersFromStopWithGraphIndices = new TIntIntHashMap();
temporaryTransfers.put(graphIndex, new TIntIntHashMap());
TIntIntMap out = new TIntIntHashMap();
代码示例来源:origin: FudanNLP/fnlp
TIntIntHashMap diffF = new TIntIntHashMap(); // 最多有2*L*numTemplets个不同
代码示例来源:origin: palantir/atlasdb
private synchronized void incrementReadCount(int clientIndex) {
if (readLockHolders == null) {
readLockHolders = new TIntIntHashMap(1);
}
readLockHolders.adjustOrPutValue(clientIndex, 1, 1);
}
代码示例来源:origin: FudanNLP/fnlp
TIntIntHashMap index = new TIntIntHashMap();
TIntIntIterator it = feature.iterator();
while (it.hasNext()) {
代码示例来源:origin: Vazkii/Botania
private void calculateCollisionAndDiffs() {
TIntIntHashMap lastactivesegment = new TIntIntHashMap();
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Constructor.
*
* @param size Expected size
* @param def Default value
*/
public MapIntegerDBIDIntegerStore(int size, int def) {
super();
map = new TIntIntHashMap(size, 0.5f, Integer.MIN_VALUE, def);
}
代码示例来源:origin: fozziethebeat/S-Space
/**
* Creates a new vector of the specified length
*
* @param length the length of this vector
*/
public SparseHashIntegerVector(int length) {
this.length = length;
map = new TIntIntHashMap();
magnitude = -1;
}
代码示例来源:origin: openimaj/openimaj
/**
* @param clusterer the underlying clusterer
* @param window
*/
public IncrementalLifetimeSparseClusterer(SparseMatrixClusterer extends IndexClusters> clusterer, int window) {
super(clusterer, window);
this.lifetime = 3;
this.seenCount = new TIntIntHashMap();
}
代码示例来源:origin: zavtech/morpheus-core
/**
* Constructor
* @param length the length for this array
* @param defaultValue the default value for array
*/
SparseArrayOfInts(int length, Integer defaultValue) {
super(Integer.class, ArrayStyle.SPARSE, false);
this.length = length;
this.defaultValue = defaultValue != null ? defaultValue : 0;
this.values = new TIntIntHashMap((int)Math.max(length * 0.5, 10d), 0.8f, -1, this.defaultValue);
}
代码示例来源:origin: SlimeKnights/TinkersConstruct
TIntIntMap assigned = new TIntIntHashMap();
TinkersItem tool = (TinkersItem) toolStack.getItem();
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Constructor.
*
* @param size Expected size
*/
public MapIntegerDBIDDBIDStore(int size) {
super();
map = new TIntIntHashMap(size, 0.5f, Integer.MIN_VALUE, DBIDUtil.asInteger(DBIDUtil.invalid()));
}
代码示例来源:origin: chocoteam/choco-solver
public Solution copySolution() {
Solution ret = new Solution(model, varsToStore);
ret.empty = empty;
ret.intmap = new TIntIntHashMap(intmap);
ret.realmap = new TIntObjectHashMap<>(realmap);
ret.setmap = new TIntObjectHashMap<>(setmap);
return ret;
}
代码示例来源:origin: openimaj/openimaj
@Override
public SparseIntArray reverse() {
//TODO: this could be more efficient and avoid the copy
TIntIntHashMap tmp = new TIntIntHashMap(data.size());
for (Entry e : entries())
tmp.put(length - e.index, e.value);
this.data = tmp;
return this;
}
}
代码示例来源:origin: openimaj/openimaj
/**
* @throws IOException
* Load X input and y output from {@link #INPUT_LOCATION}
*/
public HandWritingNeuralNetENCOG() throws IOException {
examples = new TIntIntHashMap();
this.tests = new TIntObjectHashMap>>();
prepareDataCollection();
learnNeuralNet();
testNeuralNet();
// new HandWritingInputDisplay(this.training);
}