Examples of IntList


Examples of bak.pcj.list.IntList

    public IntArrayDequeBenchmark() {
        super(
            new IntListFactory() {
                public IntList create(int[] elements) {
                    IntList s = new IntArrayDeque(elements.length);
                    for (int i = 0; i < elements.length; i++)
                        s.add(elements[i]);
                    return s;
                }
            }
        );
    }
View Full Code Here

Examples of com.almworks.integers.IntList

  }

  public int[] toArray(int sourceOffset, int[] dest, int destOffset, int length) {
    int slices = mySlices.size();
    for (int i = 0; i < slices && length > 0; i++) {
      IntList list = mySlices.get(i);
      int size = list.size();
      if (sourceOffset >= size) {
        sourceOffset -= size;
      } else {
        int x = Math.min(size - sourceOffset, length);
        list.toArray(sourceOffset, dest, destOffset, x);
        destOffset += x;
        sourceOffset = 0;
        length -= x;
      }
    }
View Full Code Here

Examples of com.android.dx.util.IntList

            result.set(i, instructions.get(i));
        }
        result.setImmutable();

        int primarySuccessorIndex = -1;
        IntList successors = new IntList();
        for (Label catchLabel : catchLabels) {
            successors.add(catchLabel.id);
        }
        if (primarySuccessor != null) {
            primarySuccessorIndex = primarySuccessor.id;
            successors.add(primarySuccessorIndex);
        }
        if (alternateSuccessor != null) {
            successors.add(alternateSuccessor.id);
        }
        successors.setImmutable();

        return new BasicBlock(id, result, successors, primarySuccessorIndex);
    }
View Full Code Here

Examples of com.android.dx.util.IntList

             * will simply terminate with zero iterations and without
             * picking a new starter block.
             */
            traceBack:
            for (;;) {
                IntList preds = method.labelToPredecessors(label);
                int psz = preds.size();

                for (int i = 0; i < psz; i++) {
                    int predLabel = preds.get(i);

                    if (Bits.get(tracebackSet, predLabel)) {
                        /*
                         * We found a predecessor loop; stop tracing back
                         * from here.
                         */
                        break;
                    }

                    if (!Bits.get(workSet, predLabel)) {
                        // This one's already ordered.
                        continue;
                    }

                    BasicBlock pred = blocks.labelToBlock(predLabel);
                    if (pred.getPrimarySuccessor() == label) {
                        // Found one!
                        label = predLabel;
                        Bits.set(tracebackSet, label);
                        continue traceBack;
                    }
                }

                // Failed to find a better block to start the trace.
                break;
            }

            /*
             * Trace a path from the chosen block to one of its
             * unordered successors (hopefully the primary), and so
             * on, until we run out of unordered successors.
             */
            while (label != -1) {
                Bits.clear(workSet, label);
                Bits.clear(tracebackSet, label);
                order[at] = label;
                at++;

                BasicBlock one = blocks.labelToBlock(label);
                BasicBlock preferredBlock = blocks.preferredSuccessorOf(one);

                if (preferredBlock == null) {
                    break;
                }

                int preferred = preferredBlock.getLabel();
                int primary = one.getPrimarySuccessor();

                if (Bits.get(workSet, preferred)) {
                    /*
                     * Order the current block's preferred successor
                     * next, as it has yet to be scheduled.
                     */
                    label = preferred;
                } else if ((primary != preferred) && (primary >= 0)
                        && Bits.get(workSet, primary)) {
                    /*
                     * The primary is available, so use that.
                     */
                    label = primary;
                } else {
                    /*
                     * There's no obvious candidate, so pick the first
                     * one that's available, if any.
                     */
                    IntList successors = one.getSuccessors();
                    int ssz = successors.size();
                    label = -1;
                    for (int i = 0; i < ssz; i++) {
                        int candidate = successors.get(i);
                        if (Bits.get(workSet, candidate)) {
                            label = candidate;
                            break;
                        }
                    }
View Full Code Here

Examples of com.android.dx.util.IntList

        }

        /** {@inheritDoc} */
        public void visitSwitchInsn(SwitchInsn insn) {
            SourcePosition pos = insn.getPosition();
            IntList cases = insn.getCases();
            IntList successors = block.getSuccessors();
            int casesSz = cases.size();
            int succSz = successors.size();
            int primarySuccessor = block.getPrimarySuccessor();

            /*
             * Check the assumptions that the number of cases is one
             * less than the number of successors and that the last
             * successor in the list is the primary (in this case, the
             * default). This test is here to guard against forgetting
             * to change this code if the way switch instructions are
             * constructed also gets changed.
             */
            if ((casesSz != (succSz - 1)) ||
                (primarySuccessor != successors.get(casesSz))) {
                throw new RuntimeException("shouldn't happen");
            }

            CodeAddress[] switchTargets = new CodeAddress[casesSz];

            for (int i = 0; i < casesSz; i++) {
                int label = successors.get(i);
                switchTargets[i] = addresses.getStart(label);
            }

            CodeAddress dataAddress = new CodeAddress(pos);
            SwitchData dataInsn =
View Full Code Here

Examples of com.gs.collections.api.list.primitive.IntList

        }
        if (!(otherList instanceof IntList))
        {
            return false;
        }
        IntList list = (IntList) otherList;
        if (this.items.length != list.size())
        {
            return false;
        }
        for (int i = 0; i < this.items.length; i++)
        {
            if (this.items[i] != list.get(i))
            {
                return false;
            }
        }
        return true;
View Full Code Here

Examples of de.ailis.jollada.model.IntList

     */

    @Test
    public void testDefaultConstructor()
    {
        final IntList data = new IntList(3);
        final Triangles triangles = new Triangles(1, data);
        assertNull(triangles.getName());
        assertNull(triangles.getMaterial());
        assertEquals(0, triangles.getInputs().size());
        assertSame(data, triangles.getData());
View Full Code Here

Examples of eu.stratosphere.pact.runtime.test.util.types.IntList

        table.insert(lists[i]);
        result += lists[i].getKey();
      }
 
      MutableObjectIterator<IntList> iter = table.getEntryIterator();
      IntList target = new IntList();
     
      int sum = 0;
      while((target = iter.next(target)) != null) {
        sum += target.getKey();
      }
      table.close();
     
      assertTrue(sum == result);
      assertEquals("Memory lost", NUM_MEM_PAGES, table.getFreeMemory().size());
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.IntList

   * @throws IOException
   */

  public static IntList readSizesSuccinct( final CharSequence filename, final int N ) throws IOException {
    LOGGER.debug( "Loading sizes..." );
    final IntList sizes = new AbstractIntList() {
      final EliasFanoLongBigList list = new EliasFanoLongBigList( new GammaCodedIterableList( BinIO.loadBytes( filename ), N ) );

      public int getInt( int index ) {
        return (int)list.getLong( index );
      }
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.IntList

    final Coding positionCoding = flags.get( Component.POSITIONS );
   
    if ( countCoding == null && positionCoding != null ) throw new IllegalArgumentException( "Index " + basename + " has positions but no counts (this can't happen)" );
   
    // Load document sizes if forced to do so, or if the pointer/position compression methods make it necessary.
    IntList sizes = null;
    // TODO: quick patch to avoid loading sizes in case of payloads.
    if ( payload == null && ( documentSizes || positionCoding == Coding.GOLOMB || positionCoding == Coding.INTERPOLATIVE ) ) {
      sizes = queryProperties != null && queryProperties.containsKey( UriKeys.SUCCINCTSIZES ) ? readSizesSuccinct( basename + DiskBasedIndex.SIZES_EXTENSION, numberOfDocuments ) : readSizes( basename + DiskBasedIndex.SIZES_EXTENSION, numberOfDocuments );
      if ( sizes.size() != numberOfDocuments ) throw new IllegalStateException( "The length of the size list (" + sizes.size() + ") is not equal to the number of documents (" + numberOfDocuments + ")" );
    }
   
    // Load offsets if forced to do so. Depending on a property, we use the core-memory or the semi-external version.
    final LongList offsets;
    // TODO: quick patch to avoid loading sizes in case of payloads.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.