Examples of nextLong()


Examples of org.apache.mahout.cf.taste.impl.common.LongPrimitiveArrayIterator.nextLong()

      preferredItemIDsIterator =
          new SamplingLongPrimitiveIterator(preferredItemIDsIterator, samplingRate);
    }
    FastIDSet possibleItemsIDs = new FastIDSet();
    while (preferredItemIDsIterator.hasNext()) {
      long itemID = preferredItemIDsIterator.nextLong();
      PreferenceArray prefs = dataModel.getPreferencesForItem(itemID);
      int prefsLength = prefs.length();
      if (prefsLength > maxUsersPerItem) {
        Iterator<Preference> sampledPrefs =
            new FixedSizeSamplingIterator<Preference>(maxUsersPerItem, prefs.iterator());
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator.nextLong()

    FastByIDMap<PreferenceArray> testUserPrefs = new FastByIDMap<PreferenceArray>(
        1 + (int) (evaluationPercentage * numUsers));
   
    LongPrimitiveIterator it = dataModel.getUserIDs();
    while (it.hasNext()) {
      long userID = it.nextLong();
      if (random.nextDouble() < evaluationPercentage) {
        processOneUser(trainingPercentage, trainingUsers, testUserPrefs, userID, dataModel);
      }
    }
   
View Full Code Here

Examples of org.apache.mahout.cf.taste.impl.common.SamplingLongPrimitiveIterator.nextLong()

  private void addSomeOf(FastIDSet possibleItemIDs, FastIDSet itemIDs) {
    if (itemIDs.size() > maxItemsPerUser) {
      LongPrimitiveIterator it =
          new SamplingLongPrimitiveIterator(itemIDs.iterator(), (double) maxItemsPerUser / itemIDs.size());
      while (it.hasNext()) {
        possibleItemIDs.add(it.nextLong());
      }
    } else {
      possibleItemIDs.addAll(itemIDs);
    }
  }
View Full Code Here

Examples of org.cliffc.high_scale_lib.NonBlockingHashMapLong.IteratorLong.nextLong()

        int size = actors.size();
        IteratorLong it = (IteratorLong) actors.keys();
        long[] ids = new long[size];
        int i = 0;
        while (it.hasNext() && i < size) {
            ids[i] = it.nextLong();
            i++;
        }
        if (i < size)
            return Arrays.copyOf(ids, i);
        else
View Full Code Here

Examples of org.hsqldb.lib.Iterator.nextLong()

        }

        i = scsMap.keySet().iterator();

        while (i.hasNext()) {
            csid = i.nextLong();

            int usecount = useMap.get(csid, 1) - 1;

            if (usecount == 0) {
                Statement cs = (Statement) csidMap.remove(csid);
View Full Code Here

Examples of org.hsqldb_voltpatches.lib.Iterator.nextLong()

            if (!lobUsageCount.isEmpty()) {
                Iterator it = lobUsageCount.keySet().iterator();

                while (it.hasNext()) {
                    long lobID = it.nextLong();
                    int  delta = lobUsageCount.get(lobID);

                    database.lobManager.adjustUsageCount(lobID, delta - 1);
                }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom.nextLong()

    IRandom seedGen = instance.groups.get(ofGroup);
    if (seedGen == null) {
      throw new IllegalArgumentException(NO_GROUP_FOUND_FOR + ofGroup);
    }

    long seed = seedGen.nextLong();
    return seed;
  }

  public static synchronized void deleteGroup(long group) {
    instance.groups.remove(group);
View Full Code Here

Examples of prefuse.util.collections.LiteralIterator.nextLong()

     * Test method for 'edu.berkeley.guir.prefuse.data.util.IntIntTreeMap.keyIterator()'
     */
    public void testKeyIterator() {
        LiteralIterator iter = map.keyIterator();
        for ( int i=0; iter.hasNext(); ++i ) {
            long key = iter.nextLong();
            assertEquals(sort[i], key);
        }
    }

    /*
 
View Full Code Here

Examples of xbird.util.distribution.ZipfGenerator.nextLong()

    private static void runAllBenchmarksWithZipfDistribution(int capacity, int round) {
        // skew 1.0
        ZipfGenerator zipf1 = new ZipfGenerator(2.0d);
        long[] data = new long[round];
        for(int i = 0; i < round; i++) {
            data[i] = Math.abs(zipf1.nextLong()) % round;
        }
        runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.GClockK);
        runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.GClock);
        runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.LRU);
        // skew 0.8
View Full Code Here

Examples of xbird.util.distribution.ZipfGenerator.nextLong()

        runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.GClock);
        runBenchmarkWithZipfDistribution(capacity, round, 1.0, data, ReplacementAlgorithm.LRU);
        // skew 0.8
        ZipfGenerator zipf2 = new ZipfGenerator(1.8d);
        for(int i = 0; i < round; i++) {
            data[i] = Math.abs(zipf2.nextLong()) % round;
        }
        runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.GClockK);
        runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.GClock);
        runBenchmarkWithZipfDistribution(capacity, round, 0.8, data, ReplacementAlgorithm.LRU);
        // skew 0.5
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.