Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongSortedSet.containsAll()


    @Override
    public void score(long user, @Nonnull MutableSparseVector scores){
        LongSortedSet reqItems = scores.keyDomain();
        if(cachedId == user && cachedScores != null) {
            LongSortedSet cachedItems = cachedScores.keyDomain();
            if(!cachedItems.containsAll(reqItems)) {
                LongSortedSet diffItems = LongUtils.setDifference(reqItems, cachedItems);
                SparseVector newCache = scorer.score(user, diffItems);
                cachedScores = cachedScores.combineWith(newCache);
            }
            scores.set(cachedScores);
View Full Code Here


        if (predictions == null) {
            predictions = MutableSparseVector.create();
        }

        LongSortedSet items = ratings.keySet();
        if (!items.containsAll(predictions.keySet())) {
            items = LongUtils.setUnion(items, predictions.keySet());
        }

        logger.debug("outputting {} predictions for user {}", predictions.size(), user.getUserId());
        for (LongIterator iter = items.iterator(); iter.hasNext(); /* no increment */) {
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.