Package net.myrrix.common.collection

Examples of net.myrrix.common.collection.FastIDSet.toArray()


    }
    FastIDSet chosen = new FastIDSet(n);   
    while (it.hasNext()) {
      chosen.add(it.nextLong());
    }
    return chosen.toArray();
  }

}
View Full Code Here


      }
    }
   
    this.client = client;   
    this.uniqueUserIDs = userIDsSet.toArray();
    this.uniqueItemIDs = itemIDsSet.toArray();
    this.steps = steps;
  }
 
  /**
   * @param client recommender to load
View Full Code Here

    FastIDSet keys = new FastIDSet(map.size());
    LongPrimitiveIterator it = map.keySetIterator();
    while (it.hasNext()) {
      keys.add(it.nextLong());
    }
    long[] keysArray = keys.toArray();
    Arrays.sort(keysArray);
    return keysArray;
  }

  private static long[] unionColumnKeysInOrder(FastByIDMap<FastByIDFloatMap> M) {
View Full Code Here

      LongPrimitiveIterator it = entry.getValue().keySetIterator();
      while (it.hasNext()) {
        keys.add(it.nextLong());
      }
    }
    long[] keysArray = keys.toArray();
    Arrays.sort(keysArray);
    return keysArray;
  }

  private static void appendWithPadOrTruncate(long value, StringBuilder to) {
View Full Code Here

    } catch (NumberFormatException nfe) {
      response.sendError(HttpServletResponse.SC_BAD_REQUEST, nfe.toString());
      return;
    }

    long[] userIDs = userIDSet.toArray();

    MyrrixRecommender recommender = getRecommender();
    RescorerProvider rescorerProvider = getRescorerProvider();
    try {
      IDRescorer rescorer = rescorerProvider == null ? null :
View Full Code Here

    RescorerProvider rescorerProvider = getRescorerProvider();
    try {
      int howMany = getHowMany(request);
      Iterable<RecommendedItem> similar;
      if (rescorerProvider == null) {
        similar = recommender.mostSimilarItems(itemIDSet.toArray(), howMany);
      } else {
        Rescorer<LongPair> rescorer =
            rescorerProvider.getMostSimilarItemsRescorer(recommender, getRescorerParams(request));
        similar = recommender.mostSimilarItems(itemIDSet.toArray(),
                                               howMany,
View Full Code Here

      if (rescorerProvider == null) {
        similar = recommender.mostSimilarItems(itemIDSet.toArray(), howMany);
      } else {
        Rescorer<LongPair> rescorer =
            rescorerProvider.getMostSimilarItemsRescorer(recommender, getRescorerParams(request));
        similar = recommender.mostSimilarItems(itemIDSet.toArray(),
                                               howMany,
                                               rescorer);
      }
      output(request, response, similar);
    } catch (NoSuchItemException nsie) {
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.