Package it.unimi.dsi.fastutil.ints

Examples of it.unimi.dsi.fastutil.ints.IntSet


    }
    return nextRowId;
  }

  private void addRowIdAssociation(final int rowId, final ValueSpecification specification, final Map<ValueSpecification, IntSet> rowIdMap) {
    IntSet rowIdSet = rowIdMap.get(specification);
    if (rowIdSet == null) {
      rowIdSet = new IntArraySet();
      rowIdMap.put(specification, rowIdSet);
    }
    rowIdSet.add(rowId);
  }
View Full Code Here


    final Map<String, Object> rows = new HashMap<String, Object>();
    for (final Pair<ValueSpecification, Object> valuePair : valueResponse.getResults()) {
      final ValueSpecification specification = valuePair.getFirst();
      final Object value = valuePair.getSecond();

      final IntSet rowIds = _rowIdMap.get(specification);
      if (rowIds == null) {
        s_logger.warn("Cache query returned unexpected item with value specification {}", specification);
        continue;
      }
View Full Code Here

    int[] docs = new int[max];
    for (int i = 0; i < docs.length; ++i) {
      docs[i] = i;
    }
    int limit = 10000;
    IntSet set1 = new IntRBTreeSet();
    while (set1.size() < limit) {
      set1.add(rand.nextInt(max));
    }

    IntSet set2 = new IntOpenHashSet();
    for (int i : set1) {
      set2.add(i);
    }

    int[] set3 = set1.toIntArray();
    Arrays.sort(set3);

    BitSet set4 = new BitSet();
    for (int i : set1) {
      set4.set(i);
    }

    long start, end;

    start = System.nanoTime();
    for (int i = 0; i < docs.length; ++i) {
      set1.contains(i);
    }
    end = System.nanoTime();
    System.out.println("set1: " + (end - start) / 1000000);

    start = System.nanoTime();
    for (int i = 0; i < docs.length; ++i) {
      set2.contains(i);
    }
    end = System.nanoTime();
    System.out.println("set2: " + (end - start) / 1000000);

    start = System.nanoTime();
View Full Code Here

      }
    }

    @Override
    public int[] convert(FacetDataCache<String> dataCache, String[] vals) {
      IntSet intSet = new IntOpenHashSet();
      getFilters(dataCache, intSet, vals, _depth, _strict);
      return intSet.toIntArray();
    }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.ints.IntSet

Copyright © 2018 www.massapicom. 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.