congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IntHeapSemiIndirectPriorityQueue.dequeue
Code IndexAdd Tabnine to your IDE (free)

How to use
dequeue
method
in
it.unimi.dsi.fastutil.ints.IntHeapSemiIndirectPriorityQueue

Best Java code snippets using it.unimi.dsi.fastutil.ints.IntHeapSemiIndirectPriorityQueue.dequeue (Showing top 13 results out of 315)

origin: it.unimi.dsi/mg4j-big

private int hasNextInternal() {
  if ( positionQueue.isEmpty() ) return -1;
  
  int first;
  
  while ( curr[ first = positionQueue.first() ] == last ) {
    if ( ++currPos[ first ] == count[ first ] ) {
      positionQueue.dequeue();
      if ( positionQueue.isEmpty() ) return -1;
    }
    else {
      curr[ first ] = position[ first ][ currPos[ first ] ];
      positionQueue.changed();
    }
  }
  return first;
}
origin: it.unimi.di/mg4j

public int skipTo( final int p ) throws IOException {
  if ( curr >= p ) return curr;
  if ( p >= indexReader.index.numberOfDocuments ) return curr = END_OF_LIST;
  int i, d;
  
  //System.err.println( "Advancing to " + n  + " doc: " + Arrays.toString( doc ) + " first: " + queue.first() );
  while( ! queue.isEmpty() && globalDocumentPointer[ i = queue.first() ] < p ) {
    d = documentIterator[ i ].skipTo( strategy.localPointer( p ) );
    if ( d == END_OF_LIST ) queue.dequeue();
    else {
      globalDocumentPointer[ i ] = strategy.globalPointer( usedIndex[ i ], d );
      if ( globalDocumentPointer[ i ] < p ) queue.dequeue(); // This covers the case of getting to the end of list without finding p 
      else queue.changed();
    }
  }
  
  if ( queue.isEmpty() ) return curr = END_OF_LIST;
  return curr = globalDocumentPointer[ currentIterator = queue.first() ];
}
origin: it.unimi.di/mg4j

public int nextDocument() throws IOException {
  if ( curr == END_OF_LIST ) return END_OF_LIST;
  if ( curr != -1 ) {
    final int result;
    if ( ( result = documentIterator[ currentIterator ].nextDocument() ) != END_OF_LIST ) {
      globalDocumentPointer[ currentIterator ] = strategy.globalPointer( usedIndex[ currentIterator ], result );
      queue.changed();
    }
    else queue.dequeue();
  }
  return curr = queue.isEmpty() ? END_OF_LIST : globalDocumentPointer[ currentIterator = queue.first() ];
}

origin: it.unimi.dsi/mg4j

public int skipTo( final int p ) throws IOException {
  ahead = false;
  if ( curr >= p ) return curr;
  if ( p >= indexReader.index.numberOfDocuments ) return curr = END_OF_LIST;
  int i, d;
  
  //System.err.println( "Advancing to " + n  + " doc: " + Arrays.toString( doc ) + " first: " + queue.first() );
  while( ! queue.isEmpty() && globalDocumentPointer[ i = queue.first() ] < p ) {
    d = documentIterator[ i ].skipTo( strategy.localPointer( p ) );
    if ( d == Integer.MAX_VALUE ) queue.dequeue();
    else {
      globalDocumentPointer[ i ] = strategy.globalPointer( usedIndex[ i ], d );
      if ( globalDocumentPointer[ i ] < p ) queue.dequeue(); // This covers the case of getting to the end of list without finding p 
      else queue.changed();
    }
  }
  
  if ( queue.isEmpty() ) return curr = END_OF_LIST;
  return curr = globalDocumentPointer[ currentIterator = queue.first() ];
}
origin: it.unimi.dsi/mg4j-big

public Interval nextInterval() {
  if ( next != null ) {
    final Interval result = next;
    next = null;
    return result;
  }
  
  if ( emitted < extracted ) return Interval.valueOf( cache[ emitted++ ] );
  if ( positionQueue.isEmpty() ) return null;
  final int first = positionQueue.first();
  if ( extracted == cache.length ) cache = IntArrays.grow( cache, extracted + 1 );
  cache[ extracted++ ] = curr[ first ];
  if ( ++currPos[ first ] < count[ first ] ) {
    curr[ first ] = position[ first ][ currPos[ first ] ];
    positionQueue.changed();
    if ( curr[ positionQueue.first() ] == cache[ extracted - 1 ] ) throw new IllegalArgumentException( "Duplicate positions in " + this );
  }
  else positionQueue.dequeue();
    
  return Interval.valueOf( cache[ emitted++ ] );
}
origin: it.unimi.dsi/mg4j

protected int nextDocumentInternal() throws IOException {
  final int result;
  if ( ( result = documentIterator[ currentIterator ].nextDocument() ) != -1 ) {
    globalDocumentPointer[ currentIterator ] = strategy.globalPointer( usedIndex[ currentIterator ], result );
    queue.changed();
  }
  else queue.dequeue();
  curr = queue.isEmpty() ? END_OF_LIST : globalDocumentPointer[ currentIterator = queue.first() ];
  return toNextDocument( curr );
}

origin: it.unimi.dsi/mg4j

public Interval nextInterval() {
  if ( next != null ) {
    final Interval result = next;
    next = null;
    return result;
  }
  
  if ( emitted < extracted ) return Interval.valueOf( cache[ emitted++ ] );
  if ( positionQueue.isEmpty() ) return null;
  final int first = positionQueue.first();
  if ( extracted == cache.length ) cache = IntArrays.grow( cache, extracted + 1 );
  cache[ extracted++ ] = curr[ first ];
  if ( ++currPos[ first ] < count[ first ] ) {
    curr[ first ] = position[ first ][ currPos[ first ] ];
    positionQueue.changed();
    if ( curr[ positionQueue.first() ] == cache[ extracted - 1 ] ) throw new IllegalArgumentException( "Duplicate positions in " + this );
  }
  else positionQueue.dequeue();
    
  return Interval.valueOf( cache[ emitted++ ] );
}
origin: it.unimi.dsi/mg4j

public int skipTo( final int n ) throws IOException {
  ahead = false;
  if ( curr >= n ) return curr;
  currentIterators.clear(); 
  frontSize = -1; // Invalidate front
  int first, res;
  while( refArray[ first = queue.first() ] < n ) {
    // Cannot advance the minimum
    if ( ( res = documentIterator[ first ].skipTo( n ) ) == END_OF_LIST ) {
      // Remove it
      queue.dequeue();
      // If nothing else remains, we are done
      if ( queue.isEmpty() ) return curr = END_OF_LIST;
    }
    else {
      // Advance the top element, and signal this fact to the queue
      refArray[ first ] = res;
      queue.changed();
    }
  }
  
  return curr = refArray[ first ];
}
origin: it.unimi.dsi/webgraph

successor[d] = (prevTarget[i] += batchIbs[i].readDelta() + 1);
if (--inputStreamLength[i] == 0) {
  queue.dequeue();
  batchIbs[i].close();
  batchIbs[i] = null;
origin: it.unimi.dsi/mg4j

protected int nextDocumentInternal() throws IOException {
  currentIterators.clear(); 
  frontSize = -1; // Invalidate front
  
  // The least element
  int first, c = refArray[ queue.first() ];

  // Advance all elements equal to the least one
  while( refArray[ first = queue.first() ] == c ) {
    if ( ( refArray[ first ] = documentIterator[ first ].nextDocument() ) != - 1 ) queue.changed();
    else {
      // Remove it
      queue.dequeue();
      // If nothing else remains, we are done
      if ( queue.isEmpty() ) {
        curr = END_OF_LIST;
        return -1;
      }
    }
  }
  return curr = refArray[ first ];
}

origin: it.unimi.dsi/mg4j

public Interval nextInterval() {
  if ( next != null ) {
    final Interval result = next;
    next = null; 
    return result;
  }
  
  if ( positionQueue.isEmpty() ) return null;
  
  int first = positionQueue.first();
  final int previous = curr[ first ];
  
  do
    if ( ++currPos[ first ] == count[ first ] ) {
      positionQueue.dequeue();
      if ( positionQueue.isEmpty() ) return null;
    }
    else {
      curr[ first ] = position[ first ][ currPos[ first ] ];
      positionQueue.changed();
    }
  while ( curr[ first = positionQueue.first() ] == previous );
  return Interval.valueOf( curr[ first ] );
}
origin: it.unimi.dsi/mg4j

if ( --frequency[ currIndex ] == 0 ) documentQueue.dequeue();
else {
  doc[ currIndex ] = ir.nextDocument();
origin: it.unimi.di/mg4j

if ( --frequency[ currIndex ] == 0 ) documentQueue.dequeue();
else {
  doc[ currIndex ] = ir.nextDocument();
it.unimi.dsi.fastutil.intsIntHeapSemiIndirectPriorityQueuedequeue

Popular methods of IntHeapSemiIndirectPriorityQueue

  • <init>
    Wraps a given array in a queue using a given comparator. The queue returned by this method will be b
  • changed
    The caller must guarantee that when this method is called the index of the first element appears ju
  • enqueue
  • first
  • clear
  • isEmpty
  • front
    Writes in the provided array the front of the queue, that is, the set of indices whose elements have
  • ensureElement
    Ensures that the given index is a valid reference.
  • size

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now