Package it.unimi.dsi.fastutil.longs

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


  }

  @Override
  public RandomAccessFilter buildRandomAccessAndFilter(String[] vals,
      Properties prop) throws IOException {
    LongSet longSet = new LongOpenHashSet();
    for (String val : vals){
      try{
        longSet.add(Long.parseLong(val));
      }
      catch(Exception e){
        throw new IOException(e.getMessage());
      }
    }
    if (longSet.size()!=1){
      return EmptyFilter.getInstance();
    }
    else{
      return buildRandomAccessFilter(longSet.iterator().nextLong());
    }
  }
View Full Code Here


  }

  @Override
  public RandomAccessFilter buildRandomAccessOrFilter(String[] vals,
      Properties prop, boolean isNot) throws IOException {
    LongSet longSet = new LongOpenHashSet();
    for (String val : vals){
      try{
        longSet.add(Long.parseLong(val));
      }
      catch(Exception e){
        throw new IOException(e.getMessage());
      }
    }
View Full Code Here

    // assertion helpers
    /**
     * Asserts that values in both sets are exactly equal.
     */
    private static void assertElementsEqual(final HLL hllA, final HLL hllB) {
        final LongOpenHashSet internalSetA = (LongOpenHashSet)getInternalState(hllA, "explicitStorage");
        final LongOpenHashSet internalSetB = (LongOpenHashSet)getInternalState(hllB, "explicitStorage");

        assertTrue(internalSetA.equals(internalSetB));
    }
View Full Code Here

        switch(type) {
            case EMPTY:
                // nothing to be done
                break;
            case EXPLICIT:
                this.explicitStorage = new LongOpenHashSet();
                break;
            case SPARSE:
                this.sparseProbabilisticStorage = new Int2ByteOpenHashMap();
                break;
            case FULL:
View Full Code Here

      deleteDirectory(idxDir);
    }
  }

  public void testUIDDocIdSet() throws IOException{
    LongOpenHashSet uidset = new LongOpenHashSet();
    int count = 100;
    Random rand = new Random();
    int id;
    for (int i=0;i<count;++i){
      do { id = rand.nextInt(); } while(id == ZoieIndexReader.DELETED_UID || uidset.contains(id));
      uidset.add(id);
    }

    long[] uidArray = uidset.toLongArray();

    long[] even = new long[uidArray.length/2];
    int[] ans = new int[even.length];
    for (int i=0;i<even.length;++i){
      even[i]=uidArray[i*2];
 
View Full Code Here

    BaseSearchIndex<R,V> idx = getSearchIndex();

    Long2ObjectMap<List<IndexingReq>> addList = new Long2ObjectOpenHashMap<List<IndexingReq>>();
    V version = idx.getVersion();    // current version

    LongSet delSet =new LongOpenHashSet();
   
    try {
      for(DataEvent<ZoieIndexable,V> evt : events)
      {
        if (evt == null) continue;
            //version = Math.max(version, evt.getVersion());
            version = version == null ? evt.getVersion() : (version.compareTo(evt.getVersion()) < 0 ? evt.getVersion() : version);
            // interpret and get get the indexable instance
            ZoieIndexable indexable = evt.getData();
            if (indexable == null || indexable.isSkip())
              continue;
   
            long uid = indexable.getUID();
            delSet.add(uid);
            addList.remove(uid);
        if (!indexable.isDeleted()) // update event
        {
          IndexingReq[] reqs = indexable.buildIndexingReqs();
          for (IndexingReq req : reqs) {
View Full Code Here

      return _delDocs;
    }
   
    public void clearDeletes()
    {
      _delDocs = new LongOpenHashSet();
    }
View Full Code Here

    }
  }

  @Override
  public void initialize(int capacity) {
    neighbors = new LongOpenHashSet(capacity);
  }
View Full Code Here

    neighbors = new LongOpenHashSet(capacity);
  }

  @Override
  public void initialize() {
    neighbors = new LongOpenHashSet();
  }
View Full Code Here

        LongCollection qset = items;
        if (vector.size() < qset.size()) {
            qset = vector.keySet();
        }
        final LongSet candidates = new LongOpenHashSet();
        for (LongIterator iter = qset.iterator(); iter.hasNext();) {
            final long item = iter.nextLong();
            LongSet users = snapshot.getItemUsers(item);
            if (users != null) {
                candidates.addAll(users);
            }
        }
        candidates.remove(uid);
        logger.debug("Found {} candidate neighbors for user {}", candidates.size(), uid);
        return new Iterable<Neighbor>() {
            @Override
            public Iterator<Neighbor> iterator() {
                return new NeighborIterator(uid, vector, candidates);
            }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.LongOpenHashSet

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.