Examples of defaultReturnValue()


Examples of it.unimi.dsi.fastutil.ints.Int2ByteOpenHashMap.defaultReturnValue()

        for(int run=0; run<100; run++) {
            final HLL hll = new HLL(log2m, regwidth, 128/*explicitThreshold, arbitrary, unused*/, sparseThreshold, HLLType.SPARSE);

            final Int2ByteOpenHashMap map = new Int2ByteOpenHashMap();
            map.defaultReturnValue((byte)0);

            for(int i=0; i<sparseThreshold; i++) {
                final long rawValue = random.nextLong();

                final short registerIndex = ProbabilisticTestUtil.getRegisterIndex(rawValue, log2m);
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.Int2IntLinkedOpenHashMap.defaultReturnValue()

    @Test
    public void fastutilLinkedOpenHashMap()
    {
        final char [] CHARS = DATA;
        final Int2IntLinkedOpenHashMap map = new Int2IntLinkedOpenHashMap();
        map.defaultReturnValue(0);
   
        for (int i = 0; i < CHARS.length - 1; i++)
        {
            final int bigram = CHARS[i] << 16 | CHARS[i+1];
            map.addTo(bigram, 1);
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.Int2IntMap.defaultReturnValue()

     */
    public void putIndex(int uidx, int iidx, int idx) {
        Int2IntMap imap = null;
        while (uidx >= mapping.size()) {
            imap = new Int2IntOpenHashMap();
            imap.defaultReturnValue(-1);
            mapping.add(imap);
        }
        if (imap == null) {
            imap = mapping.get(uidx);
        }
View Full Code Here

Examples of it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap.defaultReturnValue()

    @Test
    public void fastutilOpenHashMap()
    {
        final char [] CHARS = DATA;
        final Int2IntOpenHashMap map = new Int2IntOpenHashMap();
        map.defaultReturnValue(0);
   
        for (int i = 0; i < CHARS.length - 1; i++)
        {
            final int bigram = CHARS[i] << 16 | CHARS[i+1];
            map.addTo(bigram, 1);
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.Long2IntMap.defaultReturnValue()

                // get the item -> index map for this user
                Long2IntMap imap = uiIndexes.get(user);
                if (imap == null) {
                    imap = new Long2IntOpenHashMap();
                    imap.defaultReturnValue(-1);
                    uiIndexes.put(user, imap);
                }

                // have we seen the item?
                final int index = imap.get(item);
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.Long2IntMap.defaultReturnValue()

     * @param dao The DAO of the source file
     * @return a map of users to partition numbers. Users not in a partition will return -1.
     */
    protected Long2IntMap splitUsers(UserDAO dao) {
        Long2IntMap userMap = new Long2IntOpenHashMap();
        userMap.defaultReturnValue(-1);

        switch (method) {
        case PARTITION_USERS:
            partitionUsers(userMap, dao.getUserIds());
            break;
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap.defaultReturnValue()

     * @param dao The DAO of the source file
     * @return a map of users to partition numbers. Users not in a partition will return -1.
     */
    protected Long2IntMap splitUsers(UserDAO dao) {
        Long2IntMap userMap = new Long2IntOpenHashMap();
        userMap.defaultReturnValue(-1);

        switch (method) {
        case PARTITION_USERS:
            partitionUsers(userMap, dao.getUserIds());
            break;
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.Long2LongRBTreeMap.defaultReturnValue()

       */
      private Long2LongRBTreeMap computeTermFrequencies(
                    ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index, SelectedInterval[]>>> results)
          throws IOException {
        Long2LongRBTreeMap relFreq = new Long2LongRBTreeMap();
        relFreq.defaultReturnValue(0);

        for (int i = 0; i < min(k, results.size()); i++) {
          Document document = collection
              .document(results.get(i).document);
          Reader reader = (Reader) document.content(fieldIndex);
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.