Codota Logo
LongBigArrays.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
it.unimi.dsi.fastutil.longs.LongBigArrays

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: it.unimi.dsi/fastutil

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

@Override
public long indexOf(final long k) {
  for (long i = 0; i < size; i++)
    if (((k) == (LongBigArrays.get(a, i))))
      return i;
  return -1;
}
@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 long a[][], long pos) {
  return (int) LongBigArrays.get(a, pos);
}
/**
origin: it.unimi.dsi/fastutil

private static long med3(final long x[][], final long a, final long b, final long c) {
  int ab = (Long.compare((get(x, a)), (get(x, b))));
  int ac = (Long.compare((get(x, a)), (get(x, c))));
  int bc = (Long.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 long getLong(final long index) {
  if (index >= size)
    throw new IndexOutOfBoundsException(
        "Index (" + index + ") is greater than or equal to list size (" + size + ")");
  return LongBigArrays.get(a, index);
}
@Override
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.writeLong(LongBigArrays.get(a, i));
}
origin: it.unimi.dsi/fastutil

private static long med3(final long x[][], final long a, final long b, final long c, LongComparator 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 long[][] a, final long from, final long to, final LongComparator comp) {
origin: it.unimi.dsi/fastutil

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

private static void selectionSort(final long[][] a, final long[][] 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 (((LongBigArrays.get(a, j)) < (LongBigArrays.get(a, m)))
          || ((LongBigArrays.get(a, j)) == (LongBigArrays.get(a, m)))
              && ((LongBigArrays.get(b, j)) < (LongBigArrays.get(b, m))))
        m = j;
    if (m != i) {
      long t = LongBigArrays.get(a, i);
      LongBigArrays.set(a, i, LongBigArrays.get(a, m));
      LongBigArrays.set(a, m, t);
      t = LongBigArrays.get(b, i);
      LongBigArrays.set(b, i, LongBigArrays.get(b, m));
      LongBigArrays.set(b, m, t);
    }
  }
}
/**
origin: it.unimi.dsi/fastutil

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

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

private static void selectionSort(final long[][] a, final long from, final long to, final LongComparator comp) {
  for (long i = from; i < to - 1; i++) {
    long m = i;
    for (long j = i + 1; j < to; j++)
      if (comp.compare(LongBigArrays.get(a, j), LongBigArrays.get(a, m)) < 0)
        m = j;
    if (m != i)
      swap(a, i, m);
  }
}
/**
origin: it.unimi.dsi/fastutil

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

public static String toString(final long[][] 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 LongBigArrayBigList l) {
  if (l == this)
    return true;
  long s = size64();
  if (s != l.size64())
    return false;
  final long[][] a1 = a;
  final long[][] a2 = l.a;
  while (s-- != 0)
    if (LongBigArrays.get(a1, s) != LongBigArrays.get(a2, s))
      return false;
  return true;
}
/**
origin: it.unimi.dsi/fastutil

@Override
public long removeLong(final long index) {
  if (index >= size)
    throw new IndexOutOfBoundsException(
        "Index (" + index + ") is greater than or equal to list size (" + size + ")");
  final long old = LongBigArrays.get(a, index);
  size--;
  if (index != size)
    LongBigArrays.copy(a, index + 1, a, index, size - index);
  assert size <= LongBigArrays.length(a);
  return old;
}
@Override
origin: it.unimi.dsi/fastutil

/**
 * Compares this big list to another big list.
 *
 * <p>
 * This method exists only for sake of efficiency. The implementation inherited
 * from the abstract implementation would already work.
 *
 * @param l
 *            a big list.
 * @return a negative integer, zero, or a positive integer as this big list is
 *         lexicographically less than, equal to, or greater than the argument.
 */
public int compareTo(final LongBigArrayBigList l) {
  final long s1 = size64(), s2 = l.size64();
  final long a1[][] = a, a2[][] = l.a;
  long e1, e2;
  int r, i;
  for (i = 0; i < s1 && i < s2; i++) {
    e1 = LongBigArrays.get(a1, i);
    e2 = LongBigArrays.get(a2, i);
    if ((r = (Long.compare((e1), (e2)))) != 0)
      return r;
  }
  return i < s2 ? -1 : (i < s1 ? 1 : 0);
}
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
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 long[][] key = this.key;
  for (;;) {
    pos = ((last = pos) + 1) & mask;
    for (;;) {
      if (((LongBigArrays.get(key, pos)) == (0))) {
        LongBigArrays.set(key, last, (0));
        return;
      }
      slot = it.unimi.dsi.fastutil.HashCommon.mix((LongBigArrays.get(key, pos))) & mask;
      if (last <= pos ? last >= slot || slot > pos : last >= slot && slot > pos)
        break;
      pos = (pos + 1) & mask;
    }
    LongBigArrays.set(key, last, LongBigArrays.get(key, pos));
  }
}
private boolean removeEntry(final int base, final int displ) {
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 long[][] shuffle(final long[][] a, final Random random) {
    for (long i = length(a); i-- != 0;) {
      final long p = (random.nextLong() & 0x7FFFFFFFFFFFFFFFL) % (i + 1);
      final long 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 long a[][], long offset, long length) {
  ensureIndex(index);
  LongBigArrays.ensureOffsetLength(a, offset, length);
  while (length-- != 0)
    add(index++, LongBigArrays.get(a, offset++));
}
/**
it.unimi.dsi.fastutil.longsLongBigArraysget

Javadoc

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

Popular methods of LongBigArrays

  • 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 big array for the specified value using the binary search algorithm and a specified compa
  • 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

  • Finding current android device location
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now