Tabnine Logo
IntHeapSemiIndirectPriorityQueue.changed
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: it.unimi.dsi/mg4j-big

public boolean hasNext() {
  if ( endOfProcess ) return false;
  int first;
  while ( curr[ first = queue.first() ] == lastLeft ) {
    if ( ++currPos[ first ] == count[ first ] ) {
      endOfProcess = true;
      return false;
    }
    curr[ first ] = position[ first ][ currPos[ first ] ];
    maxRight = Math.max( maxRight, curr[ first ] );
    queue.changed();
  }

  return true;
}

origin: it.unimi.dsi/mg4j

  queue.changed();
  queue.changed();
} while ( maxRight == nextRight );
origin: it.unimi.di/mg4j-big

@Override
public Interval nextInterval() throws IOException {
  if ( endOfProcess ) return null;
  int first;
  while ( curr[ first = queue.first() ] == lastLeft ) {
    if ( ( curr[ first ] = indexIterator[ first ].nextPosition() ) == IndexIterator.END_OF_POSITIONS ) {
      endOfProcess = true;
      return null;
    }
    maxRight = Math.max( maxRight, curr[ first ] );
    queue.changed();
  }

  int nextLeft, nextRight;
  
  do {
    nextLeft = curr[ first = queue.first() ];
    nextRight = maxRight;
    if ( DEBUG ) System.err.println( this + " is saving interval " + Interval.valueOf( nextLeft, nextRight ) );
    /* We check whether all iterators are on the same position, and
     * whether the top interval iterator is exhausted. In both cases, the
     * current span is guaranteed to be a minimal interval. */
    if ( curr[ first ] == maxRight || ( endOfProcess = ( curr[ first ] = indexIterator[ first ].nextPosition() ) == IndexIterator.END_OF_POSITIONS ) ) break; 
    if ( maxRight < curr[ first ] ) maxRight = curr[ first ];
    queue.changed();
  } while ( maxRight == nextRight );
  
  return Interval.valueOf( lastLeft = nextLeft, nextRight );
}
origin: it.unimi.di/mg4j

@Override
public Interval nextInterval() throws IOException {
  if ( endOfProcess ) return null;
  int first;
  while ( curr[ first = queue.first() ] == lastLeft ) {
    if ( ( curr[ first ] = indexIterator[ first ].nextPosition() ) == IndexIterator.END_OF_POSITIONS ) {
      endOfProcess = true;
      return null;
    }
    maxRight = Math.max( maxRight, curr[ first ] );
    queue.changed();
  }

  int nextLeft, nextRight;
  
  do {
    nextLeft = curr[ first = queue.first() ];
    nextRight = maxRight;
    if ( DEBUG ) System.err.println( this + " is saving interval " + Interval.valueOf( nextLeft, nextRight ) );
    /* We check whether all iterators are on the same position, and
     * whether the top interval iterator is exhausted. In both cases, the
     * current span is guaranteed to be a minimal interval. */
    if ( curr[ first ] == maxRight || ( endOfProcess = ( curr[ first ] = indexIterator[ first ].nextPosition() ) == IndexIterator.END_OF_POSITIONS ) ) break; 
    if ( maxRight < curr[ first ] ) maxRight = curr[ first ];
    queue.changed();
  } while ( maxRight == nextRight );
  
  return Interval.valueOf( lastLeft = nextLeft, nextRight );
}
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.dsi/mg4j-big

public Interval nextInterval() {
  if ( ! hasNext() ) return null;
  int nextLeft, nextRight;
  do {
    final int first = queue.first(); 
    nextLeft = curr[ first ];
    nextRight = maxRight;
    if ( DEBUG ) System.err.println( this + " is saving interval " + Interval.valueOf( nextLeft, nextRight ) );
    /* We check whether all iterators are on the same position, and
     * whether the top interval iterator is exhausted. In both cases, the
     * current span is guaranteed to be a minimal interval. */
    if ( curr[ first ] == maxRight || ( endOfProcess = ++currPos[ first ] == count[ first ] ) ) break; 
    curr[ first ] = position[ first ][ currPos[ first ] ];
    if ( maxRight < curr[ first ] ) maxRight = curr[ first ];
    queue.changed();
  } while ( maxRight == nextRight );
  
  return Interval.valueOf( lastLeft = nextLeft, nextRight );
}

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

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

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

refArray[i] += sourceDelta;
prevTarget[i] = -1;
queue.changed();
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

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.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.dsi/mg4j

else {
  doc[ currIndex ] = ir.nextDocument();
  documentQueue.changed();
origin: it.unimi.di/mg4j

else {
  doc[ currIndex ] = ir.nextDocument();
  documentQueue.changed();
it.unimi.dsi.fastutil.intsIntHeapSemiIndirectPriorityQueuechanged

Javadoc

The caller must guarantee that when this method is called the index of the first element appears just once in the queue. Failure to do so will bring the queue in an inconsistent state, and will cause unpredictable behaviour.

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
  • enqueue
  • first
  • clear
  • dequeue
  • 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

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Best IntelliJ plugins
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