Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongArrayList


     * Construct a new empty indexer.  The first interned ID will have index 0.
     */
    public Indexer() {
        indexes = new Long2IntOpenHashMap();
        indexes.defaultReturnValue(-1);
        ids = new LongArrayList();
    }
View Full Code Here


    private List<ScoredId> rescore(long user, List<ScoredId> recs) {
        if (recs.isEmpty()) {
            return Collections.emptyList();
        }

        LongList items = new LongArrayList(recs.size());
        for (ScoredId sid: recs) {
            items.add(sid.getId());
        }

        SparseVector scores = scorer.score(user, items);
        ScoredIdListBuilder builder = ScoredIds.newListBuilder(recs.size());
        builder.addChannel(ORIGINAL_SCORE_SYMBOL);
View Full Code Here

        if (ideal.size() > listSize) {
            ideal = ideal.subList(0, listSize);
        }
        double idealGain = computeDCG(ideal, ratings);

        LongList actual = new LongArrayList(recommendations.size());
        for (ScoredId id: recommendations) {
            actual.add(id.getId());
        }
        double gain = computeDCG(actual, ratings);

        double score = gain / idealGain;
View Full Code Here

    }

    @Test
    public void testCollectionCtor() {
        long[] data = {5, 2, 6};
        LongSortedSet set = new LongSortedArraySet(new LongArrayList(data));
        testSetSimple(set);
    }
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.archive.crawler.util.FPMergeUriUniqFilter#beginFpMerge()
     */
    protected LongIterator beginFpMerge() {
        newFps = new LongArrayList((int) (allFps.size()+(pending()/2)));
        return allFps.iterator();
    }
View Full Code Here

    public PagesIndex(List<Type> types, int expectedPositions, OperatorContext operatorContext)
    {
        this.types = ImmutableList.copyOf(checkNotNull(types, "types is null"));
        this.operatorContext = checkNotNull(operatorContext, "operatorContext is null");
        this.valueAddresses = new LongArrayList(expectedPositions);

        //noinspection rawtypes
        channels = (ObjectArrayList<RandomAccessBlock>[]) new ObjectArrayList[types.size()];
        for (int i = 0; i < channels.length; i++) {
            channels[i] = ObjectArrayList.wrap(new RandomAccessBlock[1024], 0);
View Full Code Here

    public PagesIndex(List<Type> types, int expectedPositions, OperatorContext operatorContext)
    {
        this.types = ImmutableList.copyOf(checkNotNull(types, "types is null"));
        this.operatorContext = checkNotNull(operatorContext, "operatorContext is null");
        this.valueAddresses = new LongArrayList(expectedPositions);

        //noinspection rawtypes
        channels = (ObjectArrayList<Block>[]) new ObjectArrayList[types.size()];
        for (int i = 0; i < channels.length; i++) {
            channels[i] = ObjectArrayList.wrap(new Block[1024], 0);
View Full Code Here

        // crate hash strategy with a single channel blocks -- make sure there is some overlap in values
        List<Block> channel = ImmutableList.of(
                BlockAssertions.createStringSequenceBlock(10, 20),
                BlockAssertions.createStringSequenceBlock(20, 30),
                BlockAssertions.createStringSequenceBlock(15, 25));
        LongArrayList addresses = new LongArrayList();
        for (int blockIndex = 0; blockIndex < channel.size(); blockIndex++) {
            Block block = channel.get(blockIndex);
            for (int positionIndex = 0; positionIndex < block.getPositionCount(); positionIndex++) {
                addresses.add(encodeSyntheticAddress(blockIndex, positionIndex));
            }
        }
        LookupSource lookupSource = lookupSourceFactoryFactory.createLookupSource(addresses, types, ImmutableList.of(channel), operatorContext);

        JoinProbeCompiler joinProbeCompiler = new JoinProbeCompiler();
View Full Code Here

  public void addParent(long vertexId) {
    // Initialize the list of parent vertices only when one attempts to add
    // the first item, so we save some memory on vertices that have no incoming
    // edges
    if (parents == null) {
      parents = new LongArrayList();
    }
    parents.add(vertexId);
  }
View Full Code Here

    return true;
  }

  @Override
  protected LongArrayList createList() {
    return new LongArrayList();
  }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.LongArrayList

Copyright © 2018 www.massapicom. 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.