Package it.unimi.dsi.fastutil.ints

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


  public int process( final Query query[], final int offset, final int length, final ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index,SelectedInterval[]>>> results ) throws QueryBuilderVisitorException, IOException {
    LOGGER.debug( "Processing Query array \"" + Arrays.toString( query ) + "\", offset=" + offset + ", length="+ length );
    results.clear();
    double lastMinScore = 1;
    int total = 0, count, currOffset = offset, currLength = length;
    final IntOpenHashSet alreadySeen = query.length > 1 ? new IntOpenHashSet() : null;

    for( int i = 0; i < query.length; i++ ) {
      final int initialResultSize = results.size();
     
      DocumentIterator documentIterator = query[ i ].accept( builderVisitor.prepare() );
View Full Code Here


   

    if ( ! jsapResult.getBoolean( "noComp" ) ) {
      IndexReader additionalReader;
      IntLinkedOpenHashSet s0 = new IntLinkedOpenHashSet();
      IntOpenHashSet s1 = new IntOpenHashSet();
      IntAVLTreeSet s2 = new IntAVLTreeSet();
      IntIterator it;
      IndexIterator indexIterator, additionalIterator;
      it.unimi.dsi.mg4j.search.DocumentIterator documentIterator;
      int u = 0;
     
      try {
        for (i = 0; i < index.length; i++) {
          pl.expectedUpdates = numberOfTerms[ i ];
          pl.start("Verifying composite iterators in " + index[i] + "...");
          additionalReader = index[ i ].getReader();
         
          for (t = 0; t < numberOfTerms[ i ]; t++) {
            for (u = 0; u < numberOfTerms[ i ]; u++) {
              s0.clear();
              s1.clear();
              // TODO: in case we have positions, we should check them, too
              IntIterators.pour( termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t ), s0 );
              IntIterators.pour( termLists ? indexReader[ i ].documents( terms[ i ].get( u ) ) : indexReader[ i ].documents( u ), s1 );
              s0.retainAll( s1 );
              indexIterator =  termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
View Full Code Here

      _numIter = numIter;
      _collector = statsCollector;

      int maxDoc = reader.maxDoc();

      IntSet idSet = new IntOpenHashSet();
      while (idSet.size() < numToFetch) {
        int docid = _rand.nextInt(maxDoc);
        if (!idSet.contains(docid) && !reader.isDeleted(docid)) {
          idSet.add(docid);
        }
      }

      docsToFetch = idSet.toIntArray();
    }
View Full Code Here

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

    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

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

   */
  public void test15() {
    for (int i = 0; i < 20; i++) {
      Model model = getModelFromResource("test15.rdf");
      ReferenceGroundedDecomposition refDec = getDecomposition(model);
      IntSet sizes = new IntOpenHashSet();
      for (FunctionallyGroundedNode fgNode : refDec
          .getFunctionallyGroundedNodes()) {
        sizes.add(fgNode.getGroundingMolecules().size());
      }
      System.out.println(sizes);
      IntSet expectedSizes = new IntOpenHashSet();
      expectedSizes.add(1); // for two nodes
      expectedSizes.add(3); // for the node with the 2 mboxes
      assertEquals(expectedSizes, sizes);
      // System.out.println(refDec.getFunctionallyGroundedNodes());
    }
  }
View Full Code Here

    /**
     * Constructor
     * @param capacity Capacity
     */
    public BasicIntOpenHashSet(int capacity) {
      set = new IntOpenHashSet(capacity);
    }
View Full Code Here

    }

    static final Pattern PARTITION_PATTERN = Pattern.compile("[\\d]+||[\\d]+-[\\d]+");

    public static int[] buildPartitions(String[] partitionArray) throws ConfigurationException {
        IntSet partitions = new IntOpenHashSet();
        try {
            for (int i = 0; i < partitionArray.length; ++i) {
                Matcher matcher = PARTITION_PATTERN.matcher(partitionArray[i]);
                if (!matcher.matches()) {
                    throw new ConfigurationException("Invalid partition: " + partitionArray[i]);
                }
                String[] partitionRange = partitionArray[i].split("-");
                int start = Integer.parseInt(partitionRange[0]);
                int end;
                if (partitionRange.length > 1) {
                    end = Integer.parseInt(partitionRange[1]);
                    if (end < start) {
                        throw new ConfigurationException("invalid partition range: " + partitionArray[i]);
                    }
                } else {
                    end = start;
                }

                for (int k = start; k <= end; ++k) {
                    partitions.add(k);
                }
            }
        } catch (Exception e) {
            throw new ConfigurationException(
                    "Error parsing '" + SENSEI_PROPERTIES + "': " + PARTITIONS + "=" + Arrays.toString(partitionArray), e);
        }

        int[] ret = partitions.toIntArray();
        Arrays.sort(ret);
        return ret;
    }
View Full Code Here

    return (T) request;
  }

  protected IntSet getPartitions(Set<Node> nodes)
  {
      IntSet partitionSet = new IntOpenHashSet();
      for (Node n : nodes)
      {
        partitionSet.addAll(n.getPartitionIds());
      }
      return partitionSet;
    }
View Full Code Here

TOP

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

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.