Examples of LongSet


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

        // One of the vector is empty
        if (vec1.norm() == 0 || vec2.norm() == 0){
            return Double.NaN;
        }

        LongSet ts = LongUtils.setUnion(vec1.keySet(),vec2.keySet());

        MutableSparseVector v1 = MutableSparseVector.create(ts);
        v1.fill(0);
        v1.set(vec1);
        v1.multiply(1.0 / v1.norm());
View Full Code Here

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

        if (history == null) {
            baseline.score(user, items);
        } else {
            MutableSparseVector vec = summarizer.summarize(history).mutableCopy();
            // score everything, both rated and not, for offsets
            LongSet allItems = LongUtils.setUnion(vec.keySet(), items.keyDomain());
            MutableSparseVector baseScores = MutableSparseVector.create(allItems);
            baseline.score(user, baseScores);
            // subtract scores from ratings, yielding offsets
            vec.subtract(baseScores);
            double meanOffset = vec.sum() / (vec.size() + damping);
View Full Code Here

Examples of nallar.collections.LongSet

      return 0;
    }

    profiler.startSection("spawnableChunks");
    int attemptedSpawnedMobs = 0;
    LongSet closeChunks = new LongSet();
    Collection<EntityPlayer> entityPlayers = worldServer.playerEntities;
    LongList spawnableChunks = new LongList(entityPlayers.size() * maxChunksPerPlayer);
    for (EntityPlayer entityPlayer : entityPlayers) {
      int pX = entityPlayer.chunkCoordX;
      int pZ = entityPlayer.chunkCoordZ;
      int x = pX - closeRange;
      int maxX = pX + closeRange;
      int startZ = pZ - closeRange;
      int maxZ = pZ + closeRange;
      for (; x <= maxX; x++) {
        for (int z = startZ; z <= maxZ; z++) {
          closeChunks.add(hash(x, z));
        }
      }
    }
    for (EntityPlayer entityPlayer : entityPlayers) {
      int pX = entityPlayer.chunkCoordX;
      int pZ = entityPlayer.chunkCoordZ;
      int x = pX - farRange;
      int maxX = pX + farRange;
      int startZ = pZ - farRange;
      int maxZ = pZ + farRange;
      for (; x <= maxX; x++) {
        for (int z = startZ; z <= maxZ; z++) {
          long hash = hash(x, z);
          if (!closeChunks.contains(hash)) {
            spawnableChunks.add(hash);
          }
        }
      }
    }
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.