本文整理汇总了Java中gnu.trove.map.hash.TIntObjectHashMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectHashMap.get方法的具体用法?Java TIntObjectHashMap.get怎么用?Java TIntObjectHashMap.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.map.hash.TIntObjectHashMap
的用法示例。
在下文中一共展示了TIntObjectHashMap.get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1:
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
/**
* <p>
* Invert an index of quantised features. The inversion process swaps keys
* and feature {@link QuantisedLocalFeature#id}s around so that the inverted
* index is a hash of ids to {@link QuantisedLocalFeature}s with the
* {@link Object#hashCode()} of the key stored in the
* {@link QuantisedLocalFeature#id} field.
* </p>
* <p>
* The original index is not affected by the inversion operation.
* </p>
*
* @param <T>
* the type of local feature.
* @param <K>
* the type of key.
* @param index
* the index to invert.
* @return an inverted-index data structure.
*/
public static <K extends ReadWriteable, T extends QuantisedLocalFeature<?>>
TIntObjectHashMap<TIntObjectHashMap<List<T>>>
invert(LocalFeatureListIndex<K, T> index)
{
final TIntObjectHashMap<TIntObjectHashMap<List<T>>> invertedIndex = new TIntObjectHashMap<TIntObjectHashMap<List<T>>>();
for (final Entry<K, LocalFeatureList<T>> e : index.entrySet()) {
final K docid = e.getKey();
for (final T t : e.getValue()) {
final int termid = t.id;
if (!invertedIndex.containsKey(termid))
invertedIndex.put(termid, new TIntObjectHashMap<List<T>>());
final TIntObjectHashMap<List<T>> postings = invertedIndex.get(termid);
if (!postings.containsKey(docid.hashCode()))
postings.put(docid.hashCode(), new ArrayList<T>());
postings.get(docid.hashCode()).add(t);
}
}
return invertedIndex;
}
示例2: get
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
@Override
public T get(int x, int y) {
if (!grid.containsKey(x)) {
return defaultElement;
}
TIntObjectHashMap<T> map = grid.get(x);
if (!map.containsKey(y)) {
return defaultElement;
}
return map.get(y);
}
示例3: reverseDirected
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public static String reverseDirected(String ss, TIntObjectHashMap<String> props_index){
String p = reverse(ss);
String[] vals = p.split("-");
String out = "";
String prop = "";
String to_search = "";
for(String s : vals){
prop = props_index.get(Integer.parseInt(s));
to_search = "";
if(prop.startsWith("inv_"))
to_search = prop.substring(4);
else
to_search = "inv_" + prop;
for(int i : props_index.keys()){
if(props_index.get(i).equals(to_search))
out += i + "-";
}
}
return out.substring(0, out.length()-1);
}
示例4: get
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public List get (int key1, int key2)
{
TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
if (inner == null) {
return null;
} else {
return (List) inner.get (key2);
}
}
示例5: get
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
public Object get (int key1, int key2)
{
TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
if (inner == null) {
return null;
} else {
return inner.get (key2);
}
}
示例6: foldMemoryOperandImpl
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
@Override
protected MachineInstr foldMemoryOperandImpl(MachineFunction mf,
MachineInstr mi, int i, ArrayList<MachineOperand> mos, int align)
{
TIntObjectHashMap<Pair<Integer, Integer>> OpcodeTablePtr = null;
boolean isTwoAddrFold = false;
int NumOps = mi.getDesc().getNumOperands();
boolean isTwoAddr = NumOps > 1
&& mi.getDesc().getOperandConstraint(1, TIED_TO) != -1;
MachineInstr NewMI = null;
// Folding a memory location into the two-address part of a two-address
// instruction is different than folding it other places. It requires
// replacing the *two* registers with the memory location.
if (isTwoAddr && NumOps >= 2 && i < 2 && mi.getOperand(0).isRegister() && mi
.getOperand(1).isRegister() && mi.getOperand(0).getReg() == mi
.getOperand(1).getReg())
{
OpcodeTablePtr = regOp2MemOpTable2Addr;
isTwoAddrFold = true;
}
else if (i == 0)
{ // If operand 0
if (mi.getOpcode() == MOV16r0)
NewMI = MakeM0Inst(this, MOV16mi, mos, mi);
else if (mi.getOpcode() == MOV32r0)
NewMI = MakeM0Inst(this, MOV32mi, mos, mi);
else if (mi.getOpcode() == MOV8r0)
NewMI = MakeM0Inst(this, MOV8mi, mos, mi);
if (NewMI != null)
return NewMI;
OpcodeTablePtr = regOp2MemOpTable0;
}
else if (i == 1)
{
OpcodeTablePtr = regOp2MemOpTable1;
}
else if (i == 2)
{
OpcodeTablePtr = regOp2MemOpTable2;
}
// If table selected...
if (OpcodeTablePtr != null)
{
// Find the Opcode to fuse
if (OpcodeTablePtr.containsKey(mi.getOpcode()))
{
int MinAlign = OpcodeTablePtr.get(mi.getOpcode()).second;
if (align < MinAlign)
return null;
if (isTwoAddrFold)
NewMI = FuseTwoAddrInst(mf,
OpcodeTablePtr.get(mi.getOpcode()).first, mos, mi,
this);
else
NewMI = FuseInst(mf,
OpcodeTablePtr.get(mi.getOpcode()).first, i, mos,
mi, this);
return NewMI;
}
}
// No fusion
if (PrintFailedFusing.value)
{
System.err.printf("We failed to fuse operand %d in ", i);
mi.print(System.err, null);
}
return null;
}
示例7: getItemModel
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
protected IBakedModel getItemModel(Item item, int meta)
{
TIntObjectHashMap<IBakedModel> map = models.get(item);
return map == null ? null : map.get(meta);
}
示例8: analyseImage
import gnu.trove.map.hash.TIntObjectHashMap; //导入方法依赖的package包/类
@Override
public void analyseImage(FImage image) {
final int height = image.getHeight();
final int width = image.getWidth();
this.radmap = new TIntObjectHashMap<TIntObjectHashMap<TIntFloatHashMap>>();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (image.pixels[y][x] == 1)
{
for (int rad = 0; rad < nRadius; rad++) {
final int actualrad = (rad * this.radIncr) + this.minRad;
final float radiusWeight = 1f / this.nDegree;
// if(actualrad == 0){
// throw new
// RuntimeException("The weight should never be 0");
// }
for (int ang = 0; ang < nDegree; ang++) {
final int x0 = round(x + this.cosanglemap[rad][ang]);
final int y0 = round(y + this.sinanglemap[rad][ang]);
TIntObjectHashMap<TIntFloatHashMap> xMap = this.radmap.get(actualrad);
if (xMap == null) {
this.radmap.put(actualrad, xMap = new TIntObjectHashMap<TIntFloatHashMap>());
}
TIntFloatHashMap yMap = xMap.get(x0);
if (yMap == null) {
xMap.put(x0, yMap = new TIntFloatHashMap());
}
yMap.adjustOrPutValue(y0, radiusWeight, radiusWeight);
// if(x0 == 37 && y0 == 22 && actualrad == 1){
// logger.debug("This should not be !");
// logger.debug(String.format("Pixel = %d,%d",
// x,y));
// logger.debug(String.format("x=%d,y=%d,r=%d,v=%2.5f",x0
// ,y0 ,actualrad , newValue ));
// }
// if(x0 > 22 && x0 < 27 && y0 > 22 && y0 < 27 &&
// actualrad > 10 && actualrad < 14){
// logger.debug("This should be correct!");
// logger.debug(String.format("x=%d,y=%d,r=%d,v=%2.5f",x0
// ,y0 ,actualrad , newValue ));
// }
// if(Float.isInfinite(newValue)){
// throw new
// RuntimeException("The value held should never be infinity");
// }
// logger.debug(String.format("x=%d,y=%d,r=%d,v=%2.5f\n",x0
// ,y0 ,actualrad , newValue ));
// maxWeight = Math.max(newValue, maxWeight);
}
}
}
}
}
logger.debug("Done analysing the image!");
}