Examples of IntOpenHashSet


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

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

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

    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

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

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

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

   */
  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

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

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

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

    }

    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

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

    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

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

  }

  public void handleClusterDisconnected()
  {
    logger.info("handleClusterDisconnected() called");
    _partitions = new IntOpenHashSet();
  }
View Full Code Here

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

  }
 
  @Override
  public boolean containsAny(Object set)
  {
    IntOpenHashSet setInt = (IntOpenHashSet)set;
    for(int i=0; i< this._length; i++)
      if( setInt.contains(((TermIntList) _mTermList).getPrimitiveValue(_buf[i])) )
        return true;
             
    return false;
  }
View Full Code Here

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

          throw new JSONException("Variable "+ symbol + " does not have value.");

        switch (typeNum)
        {
        case RelevanceJSONConstants.TYPENUMBER_SET_INT:
          hs = new IntOpenHashSet();
          for (int k = 0; k < values.length(); k++)
          {
            hs.add(values.getInt(k));
          }
          break;
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.