@Override public long[] toLongArray() { synchronized (sync) { return collection.toLongArray(); } } @Override
@Override public long[] toLongArray() { return collection.toLongArray(); } /*
/** * Creates a queue using the elements in a type-specific collection using a * given comparator. * * <p> * This constructor is more efficient than enqueing the elements of * {@code collection} one by one. * * @param collection * a collection; its elements will be used to initialize the queue. * @param c * the comparator used in this queue, or {@code null} for the natural * order. */ public LongHeapPriorityQueue(final LongCollection collection, final LongComparator c) { this(collection.toLongArray(), c); } /**
@Override public <V> List<V> link(LongCollection ids, Class<V> viewType) { return new LinkViewList<>(ids.toLongArray(), viewType); }
@Override public <V> Set<V> linkSet(LongCollection ids, Class<V> viewType) { return new LinkViewSet<>(ids.toLongArray(), viewType); }
@Override public boolean retainAll(LongCollection c) { if (c instanceof LongSortedSet) { return retainAll(c.iterator()); } else { long[] longs = c.toLongArray(); Arrays.sort(longs); return retainAll(LongArrayList.wrap(longs).iterator()); } }
@Override public boolean removeAll(LongCollection c) { if (c instanceof LongSortedSet) { return removeAll(c.iterator()); } else { long[] longs = c.toLongArray(); Arrays.sort(longs); return removeAll(LongArrayList.wrap(longs).iterator()); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder((int) Longs.max(frequencies.keySet().toLongArray()) + 1); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.length(Longs.max(frequencies.keySet().toLongArray()))); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.mostSignificantBit(Longs.max(frequencies.keySet().toLongArray()) + 1) * 2 + 1); } }
@Nonnull @Override public MetricResult measureUser(TestUser user, ResultList recommendations, MeanAccumulator context) { if (recommendations == null) { return MetricResult.empty(); } Long2DoubleMap ratings = user.getTestRatings(); long[] ideal = ratings.keySet().toLongArray(); LongArrays.quickSort(ideal, LongComparators.oppositeComparator(LongUtils.keyValueComparator(ratings))); double idealGain = computeDCG(ideal, ratings); long[] actual = LongUtils.asLongCollection(recommendations.idList()).toLongArray(); double gain = computeDCG(actual, ratings); double score = gain / idealGain; context.add(score); return MetricResult.singleton(columnName, score); }
new SignedRedirectedStringMap( numberOfDocuments, new ShiftAddXorSignedStringMap( allURIs.iterator(), new GOV3Function.Builder<CharSequence>().keys( allURIs ).transform( transformationStrategy ).build(), jsapResult.getInt( "width" ) ), resolved.values().toLongArray() ) ), jsapResult.getString( "redvdr" ) );
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; final int size = frequencies.size(); if (size == 0 || size == 1) return new Coder(new long[0], new int[0], new long[0], Long2IntMaps.EMPTY_MAP);