當前位置: 首頁>>代碼示例>>Java>>正文


Java TIntArrayList.get方法代碼示例

本文整理匯總了Java中gnu.trove.list.array.TIntArrayList.get方法的典型用法代碼示例。如果您正苦於以下問題:Java TIntArrayList.get方法的具體用法?Java TIntArrayList.get怎麽用?Java TIntArrayList.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gnu.trove.list.array.TIntArrayList的用法示例。


在下文中一共展示了TIntArrayList.get方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertInitializerBitRange

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public Init convertInitializerBitRange(TIntArrayList bits)
{
    if (!(getType() instanceof BitsRecTy))
        return null;

    BitsRecTy t = (BitsRecTy)getType();
    int numBits = t.getNumBits();

    BitsInit bi = new BitsInit(bits.size());
    for (int i = 0, e = bits.size(); i < e; i++)
    {
        if (bits.get(i) >= numBits)
            return null;

        bi.setBit(i, new VarBitInit(this, bits.get(i)));
    }
    return bi;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:20,代碼來源:Init.java

示例2: constructCostVector

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
private PBQPVector constructCostVector(int vreg,
        TIntArrayList allowedReg,
        TObjectDoubleHashMap<Pair<Integer, Integer>> coalsceMap,
        double spillCost)
{
    PBQPVector cost = new PBQPVector(allowedReg.size()+1);
    cost.set(0, spillCost);

    for (int i = 0, e = allowedReg.size(); i < e; i++)
    {
        int preg = allowedReg.get(i);
        Pair<Integer, Integer> regPair = Pair.get(preg, vreg);
        if (coalsceMap.containsKey(regPair))
        {
            cost.set(i+1, -coalsceMap.get(regPair));
        }
    }
    return cost;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:20,代碼來源:RegAllocPBQP.java

示例3: isValid

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public boolean isValid(UndirectedGraph<? extends TerminalExt, SwitchImpl> graph, TIntArrayList nodes, List<NodeTerminal> terminals) {
    int feederCount = 0;
    int branchCount = 0;
    int busbarSectionCount = 0;
    for (int i = 0; i < nodes.size(); i++) {
        int node = nodes.get(i);
        TerminalExt terminal = graph.getVertexObject(node);
        if (terminal != null) {
            AbstractConnectable connectable = terminal.getConnectable();
            switch (connectable.getType()) {
                case LINE:
                case TWO_WINDINGS_TRANSFORMER:
                case THREE_WINDINGS_TRANSFORMER:
                case HVDC_CONVERTER_STATION:
                    branchCount++;
                    feederCount++;
                    break;

                case LOAD:
                case GENERATOR:
                case SHUNT_COMPENSATOR:
                case DANGLING_LINE:
                case STATIC_VAR_COMPENSATOR:
                    feederCount++;
                    break;

                case BUSBAR_SECTION:
                    busbarSectionCount++;
                    break;

                default:
                    throw new AssertionError();
            }
        }
    }
    return (busbarSectionCount >= 1 && feederCount >= 1)
            || (branchCount >= 1 && feederCount >= 2);
}
 
開發者ID:powsybl,項目名稱:powsybl-core,代碼行數:40,代碼來源:NodeBreakerVoltageLevel.java

示例4: convertIntListSlice

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public Init convertIntListSlice(TIntArrayList elements)
{
    ArrayList<Init> vals = new ArrayList<>();
    for (int i = 0, e = elements.size(); i< e; i++)
    {
        if (elements.get(i) >= getSize())
            return null;
        vals.add(getElement(elements.get(i)));
    }
    return new ListInit(vals, getType());
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:13,代碼來源:Init.java

示例5: filterEVTs

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
public static TIntArrayList filterEVTs(TIntArrayList inVTs, Predicate<Integer> filter)
{
    TIntArrayList result = new TIntArrayList();
    for (int i = 0, e = inVTs.size(); i != e; i++)
    {
        int val = inVTs.get(i);
        if (filter.test(val))
            result.add(val);
    }
    return result;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:12,代碼來源:CodeGenDAGPatterns.java

示例6: filterVTs

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
public static TIntArrayList filterVTs(TIntArrayList inVTs, Predicate<Integer> filter)
{
    TIntArrayList result = new TIntArrayList();
    for (int i = 0; i < inVTs.size(); i++)
    {
        int vt = inVTs.get(i);
        if (filter.test(vt))
            result.add(vt);
    }
    return result;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:12,代碼來源:CodeGenDAGPatterns.java

示例7: lowerCall

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Lower the given call instruction, including argument and return value.
 * @param mbb The machine basic block where emit calling code.
 * @param ci    The Calling instruction.
 * @param resReg   The register where resides the returned value from callee.
 * @param args  The list virutal registeres of actual arguments.
 * @param calleeReg The register that resides the address of called function
 *                  if the target determines it can't jump to the destination
 *                  based purely on {@code ci}. This might be because {@code ci}
 *                  is indirect, or because of the limited range of an immediate
 *                  jump.
 * @return
 */
public boolean lowerCall(
        MachineBasicBlock mbb,
        CallInst ci,
        int resReg,
        TIntArrayList args,
        int calleeReg)
{
    TargetData td = ci.getParent().getParent().getMachineFunc().getTarget().getTargetData();

    int numFixedArgs = ci.getNumsOfArgs();
    ArrayList<ArgInfo> orignArgs = new ArrayList<>();
    for (int i = 0; i < numFixedArgs; i++)
    {
        ArgInfo ai = new ArgInfo(args.get(i), ci.argumentAt(i).getType(), ci.argumentAt(i));
        setArgFlags(ai, i+ AttrList.FirstArgIndex, td, ci);
        orignArgs.add(ai);
    }
    MachineOperand callee;
    Function f;
    if ((f = ci.getCalledFunction()) != null)
        callee = MachineOperand.createGlobalAddress(f, 0, 0);
    else
        callee = MachineOperand.createReg(calleeReg, false, false);

    ArgInfo origRet = new ArgInfo(resReg, ci.getType(), ci, new ArgFlagsTy());
    if (!origRet.ty.isVoidType())
        setArgFlags(origRet, AttrList.ReturnIndex, td, ci);

    return !lowerCall(mbb, ci.getCallingConv(), callee, origRet, orignArgs);
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:44,代碼來源:CallLowering.java

示例8: combineChildVariants

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Given a bunch of permutations of each child of the
 * 'operator' node, put them together in all possible ways.
 * @param orig
 * @param childVariants
 * @param outVariants
 * @param cdp
 * @param depVars
 */
private static void combineChildVariants(TreePatternNode orig,
        ArrayList<ArrayList<TreePatternNode>> childVariants,
        ArrayList<TreePatternNode> outVariants,
        CodeGenDAGPatterns cdp,
        HashSet<String> depVars)
{
    for (int i = 0, e = childVariants.size(); i != e; i++)
    {
        if (childVariants.get(i).isEmpty())
            return;
    }

    TIntArrayList idxs = new TIntArrayList();
    idxs.fill(0, childVariants.size(),0);
    boolean notDone;
    do
    {
        if (TableGen.DEBUG && !idxs.isEmpty())
        {
            System.err.printf("%s: Idxs = [ ", orig.getOperator().getName());
            for (int i = 0, e = idxs.size(); i != e; i++)
                System.err.printf("%d ", idxs.get(i));

            System.err.println("]");
        }

        ArrayList<TreePatternNode> newChildren = new ArrayList<>();
        for (int i = 0, e = childVariants.size(); i != e; i++)
            newChildren.add(childVariants.get(i).get(idxs.get(i)));

        TreePatternNode r = new TreePatternNode(orig.getOperator(), newChildren);

        r.setName(orig.getName());
        r.setPredicateFns(orig.getPredicateFns());
        r.setTransformFn(orig.getTransformFn());
        r.setTypes(orig.getExtTypes());

        StringBuilder errString = new StringBuilder();
        if (r.canPatternMatch(errString, cdp))
        {
            boolean alreadyExists = false;
            for (int i = 0, e = outVariants.size(); i != e; i++)
            {
                if (r.isIsomorphicTo(outVariants.get(i), depVars))
                {
                    alreadyExists = true;
                    break;
                }
            }

            if (!alreadyExists)
                outVariants.add(r);
        }

        // Increment indices to the next permutation by incrementing the
        // indicies from last index backward, e.g., generate the sequence
        // [0, 0], [0, 1], [1, 0], [1, 1].
        int j;
        for (j = idxs.size() - 1; j >= 0; --j)
        {
            int tmp = idxs.get(j);
            idxs.set(j, tmp + 1);
            if (tmp + 1 == childVariants.get(j).size())
                idxs.set(j, 0);
            else
                break;
        }
        notDone = j >= 0;
    }while (notDone);
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:80,代碼來源:CodeGenDAGPatterns.java

示例9: foldMemoryOperandImpl

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public MachineInstr foldMemoryOperandImpl(MachineFunction mf,
        MachineInstr mi, TIntArrayList ops, int frameIndex)
{
    // Check switch flag
    if (NoFusing.value)
        return null;

    MachineFrameInfo MFI = mf.getFrameInfo();
    int Alignment = MFI.getObjectAlignment(frameIndex);
    if (ops.size() == 2 && ops.get(0) == 0 && ops.get(1) == 1)
    {
        int NewOpc = 0;
        switch (mi.getOpcode())
        {
            default:
                return null;
            case TEST8rr:
                NewOpc = CMP8ri;
                break;
            case TEST16rr:
                NewOpc = CMP16ri;
                break;
            case TEST32rr:
                NewOpc = CMP32ri;
                break;
            case TEST64rr:
                NewOpc = CMP64ri32;
                break;
        }
        // Change to CMPXXri r, 0 first.
        mi.setDesc(get(NewOpc));
        mi.getOperand(1).changeToImmediate(0);
    }
    else if (ops.size() != 1)
        return null;

    ArrayList<MachineOperand> MOs = new ArrayList<>();
    MOs.add(MachineOperand.createFrameIndex(frameIndex));
    return foldMemoryOperandImpl(mf, mi, ops.get(0), MOs, Alignment);
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:42,代碼來源:X86InstrInfo.java

示例10: canFoldMemoryOperand

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
@Override
public boolean canFoldMemoryOperand(MachineInstr mi, TIntArrayList Ops)
{
    // Check switch flag
    if (NoFusing.value)
        return false;

    if (Ops.size() == 2 && Ops.get(0) == 0 && Ops.get(1) == 1)
    {
        switch (mi.getOpcode())
        {
            default:
                return false;
            case TEST8rr:
            case TEST16rr:
            case TEST32rr:
            case TEST64rr:
                return true;
        }
    }

    if (Ops.size() != 1)
        return false;

    int OpNum = Ops.get(0);
    int Opc = mi.getOpcode();
    int NumOps = mi.getDesc().getNumOperands();
    boolean isTwoAddr = NumOps > 1
            && mi.getDesc().getOperandConstraint(1, TIED_TO) != -1;

    // 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.
    TIntObjectHashMap<Pair<Integer, Integer>> OpcodeTablePtr = null;
    if (isTwoAddr && NumOps >= 2 && OpNum < 2)
    {
        OpcodeTablePtr = regOp2MemOpTable2Addr;
    }
    else if (OpNum == 0)
    { // If operand 0
        switch (Opc)
        {
            case MOV8r0:
            case MOV16r0:
            case MOV32r0:
                return true;
            default:
                break;
        }
        OpcodeTablePtr = regOp2MemOpTable0;
    }
    else if (OpNum == 1)
    {
        OpcodeTablePtr = regOp2MemOpTable1;
    }
    else if (OpNum == 2)
    {
        OpcodeTablePtr = regOp2MemOpTable2;
    }

    if (OpcodeTablePtr != null)
    {
        // Find the Opcode to fuse

        if (OpcodeTablePtr.containsKey(Opc))
            return true;
    }
    return false;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:70,代碼來源:X86InstrInfo.java

示例11: getDiagnosticMappingInfo

import gnu.trove.list.array.TIntArrayList; //導入方法依賴的package包/類
/**
 * Return the diagMapping info currently set for the
 * specified builtin diagnostic.  This returns the high bit encoding, or zero
 * if the field is completely uninitialized.
 * @param diag
 * @return
 */
private Mapping getDiagnosticMappingInfo(int diag)
{
    TIntArrayList currentMappings = diagMappingsStack.getLast();
    int idx = (currentMappings.get(diag/2) >> (((diag & 1)*4) & 15));
    return Mapping.values()[idx];
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:14,代碼來源:Diagnostic.java


注:本文中的gnu.trove.list.array.TIntArrayList.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。