Package it.unimi.dsi.fastutil.ints

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


  @Override
  public void markDeletes(LongSet delDocs, LongSet deletedUIDs)
  {
      DocIDMapper idMapper = getDocIDMaper();
      LongIterator iter = delDocs.iterator();
      IntRBTreeSet delDocIdSet = _delDocIdSet;

      while(iter.hasNext())
      {
        long uid = iter.nextLong();
        if (ZoieIndexReader.DELETED_UID != uid)
        {
          int docid = idMapper.getDocID(uid);
          if(docid != DocIDMapper.NOT_FOUND)
          {
            delDocIdSet.add(docid);
            deletedUIDs.add(uid);
          }
        }
      }   
  }
View Full Code Here


    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();
View Full Code Here

      _sorted = docids;
    }
   
    public static int[] mapUID(long[] uidArray,DocIDMapper mapper)
  {
    IntRBTreeSet idSet = new IntRBTreeSet();
    for (long uid : uidArray)
    {
      if (uid != ZoieIndexReader.DELETED_UID)
      {
        int docid = mapper.getDocID(uid);
        if (docid!=DocIDMapper.NOT_FOUND)
        {
          idSet.add(docid);
          }
        }
    }
      return idSet.toIntArray();
  }
View Full Code Here

    protected final EdgeIterator edgeIterator;

    public Octree(int maxDepth, int size) {
        this.length = 0;
        this.leaves = new Octant[0];
        this.garbageQueue = new IntRBTreeSet();
        this.maxDepth = maxDepth;
        this.size = size;
        this.selectedLeaves = new ArrayList<Octant>();
        this.nodeIterator = new OctantIterator();
        this.edgeIterator = new EdgeIterator(null);
View Full Code Here

    };
  }

  public void markDeletes(LongSet delDocs, LongSet deletedUIDs) {
    LongIterator iter = delDocs.iterator();
    IntRBTreeSet delDocIdSet = _delDocIdSet;

    while (iter.hasNext()) {
      long uid = iter.nextLong();
      if (ZoieSegmentReader.DELETED_UID != uid) {
        int docid = _docIDMapper.getDocID(uid);
        if (docid != DocIDMapper.NOT_FOUND) {
          delDocIdSet.add(docid);
          deletedUIDs.add(uid);
        }
      }
    }
  }
View Full Code Here

    }
    _sorted = mapUID(uidArray, mapper);
  }

  public static int[] mapUID(long[] uidArray, DocIDMapper mapper) {
    IntRBTreeSet idSet = new IntRBTreeSet();
    for (long uid : uidArray) {
      if (uid != ZoieSegmentReader.DELETED_UID) {
        int docid = mapper.getDocID(uid);
        if (docid != DocIDMapper.NOT_FOUND) {
          idSet.add(docid);
        }
      }
    }
    return idSet.toIntArray();
  }
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();
View Full Code Here

TOP

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

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.