Tabnine Logo
IntBigArrays.set
Code IndexAdd Tabnine to your IDE (free)

How to use
set
method
in
it.unimi.dsi.fastutil.ints.IntBigArrays

Best Java code snippets using it.unimi.dsi.fastutil.ints.IntBigArrays.set (Showing top 20 results out of 315)

origin: it.unimi.dsi/fastutil

/**
 * Writes a length.
 * 
 * @param a
 *            the data array.
 * @param length
 *            the length to be written.
 * @param pos
 *            the starting position.
 * @return the number of elements coding {@code length}.
 */
private static int writeInt(final int a[][], int length, long pos) {
  IntBigArrays.set(a, pos, length);
  return 1;
}
/**
origin: it.unimi.dsi/fastutil

  private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();
    a = IntBigArrays.newBigArray(size);
    for (int i = 0; i < size; i++)
      IntBigArrays.set(a, i, s.readInt());
  }
}
origin: it.unimi.dsi/fastutil

@Override
public int set(final long index, final int k) {
  if (index >= size)
    throw new IndexOutOfBoundsException(
        "Index (" + index + ") is greater than or equal to list size (" + size + ")");
  int old = IntBigArrays.get(a, index);
  IntBigArrays.set(a, index, k);
  return old;
}
@Override
origin: it.unimi.dsi/fastutil

/**
 * Shuffles the specified big array fragment using the specified pseudorandom
 * number generator.
 *
 * @param a
 *            the big array to be shuffled.
 * @param from
 *            the index of the first element (inclusive) to be shuffled.
 * @param to
 *            the index of the last element (exclusive) to be shuffled.
 * @param random
 *            a pseudorandom number generator.
 * @return {@code a}.
 */
public static int[][] shuffle(final int[][] a, final long from, final long to, final Random random) {
  for (long i = to - from; i-- != 0;) {
    final long p = (random.nextLong() & 0x7FFFFFFFFFFFFFFFL) % (i + 1);
    final int t = get(a, from + i);
    set(a, from + i, get(a, from + p));
    set(a, from + p, t);
  }
  return a;
}
/**
origin: it.unimi.dsi/fastutil

@Override
public boolean add(final int k) {
  grow(size + 1);
  IntBigArrays.set(a, size++, k);
  assert size <= IntBigArrays.length(a);
  return true;
}
@Override
origin: it.unimi.dsi/fastutil

  /**
   * Shuffles the specified big array using the specified pseudorandom number
   * generator.
   *
   * @param a
   *            the big array to be shuffled.
   * @param random
   *            a pseudorandom number generator.
   * @return {@code a}.
   */
  public static int[][] shuffle(final int[][] a, final Random random) {
    for (long i = length(a); i-- != 0;) {
      final long p = (random.nextLong() & 0x7FFFFFFFFFFFFFFFL) % (i + 1);
      final int t = get(a, i);
      set(a, i, get(a, p));
      set(a, p, t);
    }
    return a;
  }
}
origin: it.unimi.dsi/mg4j-big

protected int combineSizes( final OutputBitStream sizesOutputBitStream ) throws IOException {
  int maxDocSize = 0, currDoc = 0;
  if ( needsSizes ) size = IntBigArrays.newBigArray( numberOfDocuments );
  for( int i = 0; i < numIndices; i++ ) {
    final IntIterator sizes = sizes( i );
    int s = 0;
    long j = index[ i ].numberOfDocuments;
    while( j-- != 0 ) {
      maxDocSize = Math.max( maxDocSize, s = sizes.nextInt() );
      if ( needsSizes ) IntBigArrays.set( size, currDoc++, s );
      sizesOutputBitStream.writeGamma( s );
    }
    if ( sizes instanceof Closeable ) ((Closeable)sizes).close();
  }
  return maxDocSize;
}
origin: it.unimi.dsi/fastutil

/**
 * Shifts left entries with the specified hash code, starting at the specified
 * position, and empties the resulting free entry.
 *
 * @param pos
 *            a starting position.
 */
protected final void shiftKeys(long pos) {
  // Shift entries with the same hash.
  long last, slot;
  final int[][] key = this.key;
  for (;;) {
    pos = ((last = pos) + 1) & mask;
    for (;;) {
      if (((IntBigArrays.get(key, pos)) == (0))) {
        IntBigArrays.set(key, last, (0));
        return;
      }
      slot = (it.unimi.dsi.fastutil.HashCommon.mix((long) ((IntBigArrays.get(key, pos))))) & mask;
      if (last <= pos ? last >= slot || slot > pos : last >= slot && slot > pos)
        break;
      pos = (pos + 1) & mask;
    }
    IntBigArrays.set(key, last, IntBigArrays.get(key, pos));
  }
}
private boolean removeEntry(final int base, final int displ) {
origin: it.unimi.di/mg4j-big

protected int combineSizes( final OutputBitStream sizesOutputBitStream ) throws IOException {
  int maxDocSize = 0, currDoc = 0;
  if ( needsSizes ) size = IntBigArrays.newBigArray( numberOfDocuments );
  for( int i = 0; i < numIndices; i++ ) {
    final IntIterator sizes = sizes( i );
    int s = 0;
    long j = index[ i ].numberOfDocuments;
    while( j-- != 0 ) {
      maxDocSize = Math.max( maxDocSize, s = sizes.nextInt() );
      if ( needsSizes ) IntBigArrays.set( size, currDoc++, s );
      sizesOutputBitStream.writeGamma( s );
    }
    if ( sizes instanceof Closeable ) ((Closeable)sizes).close();
  }
  return maxDocSize;
}
origin: it.unimi.dsi/fastutil

private static void selectionSort(final int[][] a, final int[][] b, final long from, final long to) {
  for (long i = from; i < to - 1; i++) {
    long m = i;
    for (long j = i + 1; j < to; j++)
      if (((IntBigArrays.get(a, j)) < (IntBigArrays.get(a, m)))
          || ((IntBigArrays.get(a, j)) == (IntBigArrays.get(a, m)))
              && ((IntBigArrays.get(b, j)) < (IntBigArrays.get(b, m))))
        m = j;
    if (m != i) {
      int t = IntBigArrays.get(a, i);
      IntBigArrays.set(a, i, IntBigArrays.get(a, m));
      IntBigArrays.set(a, m, t);
      t = IntBigArrays.get(b, i);
      IntBigArrays.set(b, i, IntBigArrays.get(b, m));
      IntBigArrays.set(b, m, t);
    }
  }
}
/**
origin: it.unimi.di/mg4j-big

protected int combineSizes( final OutputBitStream sizesOutputBitStream ) throws IOException {
  int curSize, s, maxDocSize = 0;
  if ( needsSizes ) size = IntBigArrays.newBigArray( numberOfDocuments );
  
  final IntIterator[] sizes = new IntIterator[ numIndices ];
  for( int i = 0; i < numIndices; i++ ) sizes[ i ] = sizes( i );
  
  for( int d = 0; d < numberOfDocuments; d++ ) {
    curSize = 0;
    for( int i = 0; i < numIndices; i++ ) {
      if ( d < index[ i ].numberOfDocuments && ( s = sizes[ i ].nextInt() ) != 0 ) {
        if ( curSize != 0 ) throw new IllegalArgumentException( "Document " + d + " has nonzero length in two indices" );
        curSize = s;
      }
    }
    if ( needsSizes ) IntBigArrays.set( size, d, curSize );
    if ( curSize > maxDocSize ) maxDocSize = curSize;
    sizesOutputBitStream.writeGamma( curSize );
  }
  for( int i = 0; i < numIndices; i++ ) if ( sizes[ i ] instanceof Closeable ) ((Closeable)sizes[ i ]).close();
  return maxDocSize;
}
origin: it.unimi.dsi/mg4j-big

protected int combineSizes( final OutputBitStream sizesOutputBitStream ) throws IOException {
  int curSize, s, maxDocSize = 0;
  if ( needsSizes ) size = IntBigArrays.newBigArray( numberOfDocuments );
  
  final IntIterator[] sizes = new IntIterator[ numIndices ];
  for( int i = 0; i < numIndices; i++ ) sizes[ i ] = sizes( i );
  
  for( int d = 0; d < numberOfDocuments; d++ ) {
    curSize = 0;
    for( int i = 0; i < numIndices; i++ ) {
      if ( d < index[ i ].numberOfDocuments && ( s = sizes[ i ].nextInt() ) != 0 ) {
        if ( curSize != 0 ) throw new IllegalArgumentException( "Document " + d + " has nonzero length in two indices" );
        curSize = s;
      }
    }
    if ( needsSizes ) IntBigArrays.set( size, d, curSize );
    if ( curSize > maxDocSize ) maxDocSize = curSize;
    sizesOutputBitStream.writeGamma( curSize );
  }
  for( int i = 0; i < numIndices; i++ ) if ( sizes[ i ] instanceof Closeable ) ((Closeable)sizes[ i ]).close();
  return maxDocSize;
}
origin: it.unimi.dsi/fastutil

@Override
public void add(final long index, final int k) {
  ensureIndex(index);
  grow(size + 1);
  if (index != size)
    IntBigArrays.copy(a, index, a, index + 1, size - index);
  IntBigArrays.set(a, index, k);
  size++;
  assert size <= IntBigArrays.length(a);
}
@Override
origin: it.unimi.dsi/fastutil

for (;;) {
  if (((curr = IntBigArrays.get(key, pos)) == (0))) {
    IntBigArrays.set(key, last, (0));
    return;
  wrapped.add(IntBigArrays.get(key, pos));
IntBigArrays.set(key, last, curr);
origin: it.unimi.dsi/fastutil

/**
 * {@inheritDoc}
 *
 * <p>
 * This is a trivial iterator-based implementation. It is expected that
 * implementations will override this method with a more optimized version.
 */
@Override
public void getElements(final long from, final int a[][], long offset, long length) {
  IntBigListIterator i = listIterator(from);
  IntBigArrays.ensureOffsetLength(a, offset, length);
  if (from + length > size64())
    throw new IndexOutOfBoundsException(
        "End index (" + (from + length) + ") is greater than list size (" + size64() + ")");
  while (length-- != 0)
    IntBigArrays.set(a, offset++, i.nextInt());
}
/**
origin: it.unimi.dsi/mg4j-big

while( j-- != 0 ) {
  final int s = sizes.nextInt();
  IntBigArrays.set( size, currDoc++, s );
  maxDocSize = Math.max( maxDocSize, s );
if ( needsSizes ) IntBigArrays.set( size, j, s );
maxDocSize = Math.max( maxDocSize, s );
sizesOutputBitStream.writeGamma( s );
origin: it.unimi.di/mg4j-big

while( j-- != 0 ) {
  final int s = sizes.nextInt();
  IntBigArrays.set( size, currDoc++, s );
  maxDocSize = Math.max( maxDocSize, s );
if ( needsSizes ) IntBigArrays.set( size, j, s );
maxDocSize = Math.max( maxDocSize, s );
sizesOutputBitStream.writeGamma( s );
origin: it.unimi.dsi/fastutil

  t = IntBigArrays.get(a, d + first);
  c = ByteBigArrays.get(digit, d) & 0xFF;
  IntBigArrays.set(a, d + first, z);
  ByteBigArrays.set(digit, d, (byte) zz);
IntBigArrays.set(a, i + first, t);
origin: it.unimi.di/mg4j-big

if ( indexingIsVirtual ) IntBigArrays.set( currSize, documentPointer, IntBigArrays.get( currSize, documentPointer ) + occsInCurrDoc + virtualDocumentGap );
origin: it.unimi.dsi/mg4j-big

if ( indexingIsVirtual ) IntBigArrays.set( currSize, documentPointer, IntBigArrays.get( currSize, documentPointer ) + occsInCurrDoc + virtualDocumentGap );
it.unimi.dsi.fastutil.intsIntBigArraysset

Javadoc

Sets the element of the given big array of specified index.

Popular methods of IntBigArrays

  • get
    Returns the element of the given big array of specified index.
  • newBigArray
    Creates a new big array.
  • length
    Returns the length of the given big array.
  • binarySearch
    Searches a range of the specified big array for the specified value using the binary search algorith
  • copy
    Copies a big array from the specified source big array, beginning at the specified position, to the
  • copyFromBig
    Copies a big array from the specified source big array, beginning at the specified position, to the
  • copyToBig
    Copies an array from the specified source array, beginning at the specified position, to the specifi
  • ensureCapacity
    Ensures that a big array can contain the given number of entries, preserving just a part of the big
  • ensureOffsetLength
    Ensures that a range given by an offset and a length fits a big array. This method may be used whene
  • equals
    Returns true if the two big arrays are elementwise equal. This method uses a backward loop. It is si
  • fill
    Fills a portion of the given big array with the given value. If possible (i.e., from is 0) this meth
  • forceCapacity
    Forces a big array to contain the given number of entries, preserving just a part of the big array.W
  • fill,
  • forceCapacity,
  • grow,
  • med3,
  • quickSort,
  • radixSort,
  • selectionSort,
  • swap,
  • trim

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for Android Studio
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