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

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

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

origin: it.unimi.dsi/fastutil

@Override
public long indexOf(final int k) {
  for (long i = 0; i < size; i++)
    if (((k) == (IntBigArrays.get(a, i))))
      return i;
  return -1;
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public long lastIndexOf(final int k) {
  for (long i = size; i-- != 0;)
    if (((k) == (IntBigArrays.get(a, i))))
      return i;
  return -1;
}
@Override
origin: it.unimi.dsi/sux4j

@Override
public long getLong(long index) {
  return IntBigArrays.get(lcpLengths, index >>> log2BucketSize) << log2BucketSize | index & bucketSizeMask;
}
@Override
origin: it.unimi.dsi/fastutil

/**
 * Reads a coded length.
 * 
 * @param a
 *            the data big array.
 * @param pos
 *            the starting position.
 * @return the length coded at {@code pos}.
 */
private static int readInt(final int a[][], long pos) {
  return IntBigArrays.get(a, pos);
}
/**
origin: it.unimi.dsi/sux4j

@Override
public long getLong(long index) {
  return IntBigArrays.get(lcpLengths, index >>> log2BucketSize);
}
@Override
origin: it.unimi.dsi/fastutil

private static long med3(final int x[][], final long a, final long b, final long c) {
  int ab = (Integer.compare((get(x, a)), (get(x, b))));
  int ac = (Integer.compare((get(x, a)), (get(x, c))));
  int bc = (Integer.compare((get(x, b)), (get(x, c))));
  return (ab < 0 ? (bc < 0 ? b : ac < 0 ? c : a) : (bc > 0 ? b : ac > 0 ? c : a));
}
origin: it.unimi.dsi/fastutil

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

private static long med3(final int x[][], final long a, final long b, final long c, IntComparator comp) {
  int ab = comp.compare(get(x, a), get(x, b));
  int ac = comp.compare(get(x, a), get(x, c));
  int bc = comp.compare(get(x, b), get(x, c));
  return (ab < 0 ? (bc < 0 ? b : ac < 0 ? c : a) : (bc > 0 ? b : ac > 0 ? c : a));
}
private static void selectionSort(final int[][] a, final long from, final long to, final IntComparator comp) {
origin: it.unimi.dsi/fastutil

private static void selectionSort(final int[][] a, 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))))
        m = j;
    if (m != i)
      swap(a, i, m);
  }
}
/**
origin: it.unimi.dsi/fastutil

private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
  s.defaultWriteObject();
  for (int i = 0; i < size; i++)
    s.writeInt(IntBigArrays.get(a, i));
}
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.dsi/fastutil

@Override
public int nextInt() {
  if (!hasNext())
    throw new NoSuchElementException();
  return IntBigArrays.get(a, last = pos++);
}
@Override
origin: it.unimi.dsi/fastutil

private static void selectionSort(final int[][] a, final long from, final long to, final IntComparator comp) {
  for (long i = from; i < to - 1; i++) {
    long m = i;
    for (long j = i + 1; j < to; j++)
      if (comp.compare(IntBigArrays.get(a, j), IntBigArrays.get(a, m)) < 0)
        m = j;
    if (m != i)
      swap(a, i, m);
  }
}
/**
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

@Override
public int previousInt() {
  if (!hasPrevious())
    throw new NoSuchElementException();
  return IntBigArrays.get(a, last = --pos);
}
@Override
origin: it.unimi.dsi/fastutil

public static String toString(final int[][] a) {
  if (a == null)
    return "null";
  final long last = length(a) - 1;
  if (last == -1)
    return "[]";
  final StringBuilder b = new StringBuilder();
  b.append('[');
  for (long i = 0;; i++) {
    b.append(String.valueOf(get(a, i)));
    if (i == last)
      return b.append(']').toString();
    b.append(", ");
  }
}
/**
origin: it.unimi.dsi/fastutil

/**
 * Compares this type-specific big-array list to another one.
 *
 * <p>
 * This method exists only for sake of efficiency. The implementation inherited
 * from the abstract implementation would already work.
 *
 * @param l
 *            a type-specific big-array list.
 * @return true if the argument contains the same elements of this type-specific
 *         big-array list.
 */
public boolean equals(final IntBigArrayBigList l) {
  if (l == this)
    return true;
  long s = size64();
  if (s != l.size64())
    return false;
  final int[][] a1 = a;
  final int[][] a2 = l.a;
  while (s-- != 0)
    if (IntBigArrays.get(a1, s) != IntBigArrays.get(a2, s))
      return false;
  return true;
}
/**
origin: it.unimi.dsi/fastutil

@Override
public int removeInt(final long index) {
  if (index >= size)
    throw new IndexOutOfBoundsException(
        "Index (" + index + ") is greater than or equal to list size (" + size + ")");
  final int old = IntBigArrays.get(a, index);
  size--;
  if (index != size)
    IntBigArrays.copy(a, index + 1, a, index, size - index);
  assert size <= IntBigArrays.length(a);
  return old;
}
@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/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 addElements(long index, final int a[][], long offset, long length) {
  ensureIndex(index);
  IntBigArrays.ensureOffsetLength(a, offset, length);
  while (length-- != 0)
    add(index++, IntBigArrays.get(a, offset++));
}
/**
it.unimi.dsi.fastutil.intsIntBigArraysget

Javadoc

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

Popular methods of IntBigArrays

  • newBigArray
    Creates a new big array.
  • set
    Sets the element of the given big array of specified index.
  • 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
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • setScale (BigDecimal)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • 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
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top PhpStorm 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