congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
GrowQueue_I64.push
Code IndexAdd Tabnine to your IDE (free)

How to use
push
method
in
org.ddogleg.struct.GrowQueue_I64

Best Java code snippets using org.ddogleg.struct.GrowQueue_I64.push (Showing top 10 results out of 315)

origin: lessthanoptimal/ddogleg

public void add(long value) {
  push(value);
}
origin: org.ddogleg/ddogleg

public void add(long value) {
  push(value);
}
origin: lessthanoptimal/ddogleg

@Override
public void push(GrowQueue_I64 queue, double value) {
  queue.push((long)value);
}
origin: lessthanoptimal/ddogleg

@Test
public void indexOf() {
  GrowQueue_I64 alg = new GrowQueue_I64(10);
  alg.push(1);
  alg.push(3);
  alg.push(4);
  alg.push(5);
  assertEquals(1,alg.indexOf(3));
  assertEquals(-1,alg.indexOf(8));
}
origin: lessthanoptimal/ddogleg

@Test
public void reset() {
  GrowQueue_I64 alg = new GrowQueue_I64(10);
  alg.push(1);
  alg.push(3);
  alg.push(-2);
  assertTrue(1.0 == alg.get(0));
  assertEquals(3,alg.size);
  alg.reset();
  assertEquals(0,alg.size);
}
origin: lessthanoptimal/ddogleg

@Test
public void remove_one() {
  GrowQueue_I64 alg = new GrowQueue_I64(10);
  alg.push(1);
  alg.push(3);
  alg.push(4);
  alg.push(5);
  alg.remove(1);
  assertEquals(3,alg.size);
  assertEquals(1,alg.get(0));
  assertEquals(4,alg.get(1));
  assertEquals(5,alg.get(2));
}
origin: lessthanoptimal/ddogleg

@Test
public void sort() {
  GrowQueue_I64 alg = new GrowQueue_I64(6);
  alg.push(8);
  alg.push(2);
  alg.push(4);
  alg.push(3);
  alg.sort();
  assertEquals(4,alg.size);
  assertEquals(2,alg.get(0));
  assertEquals(3,alg.get(1));
  assertEquals(4,alg.get(2));
  assertEquals(8,alg.get(3));
}
origin: lessthanoptimal/ddogleg

@Test
public void push_pop() {
  GrowQueue_I64 alg = new GrowQueue_I64(10);
  alg.push(1);
  alg.push(3);
  assertEquals(2,alg.size);
  assertTrue(3==alg.pop());
  assertTrue(1==alg.pop());
  assertEquals(0, alg.size);
}
origin: lessthanoptimal/ddogleg

@Test
public void remove_two() {
  GrowQueue_I64 alg = new GrowQueue_I64(10);
  alg.push(1);
  alg.push(3);
  alg.push(4);
  alg.push(5);
  alg.push(6);
  alg.remove(1,1);
  assertEquals(4,alg.size);
  assertEquals(1,alg.get(0));
  assertEquals(4,alg.get(1));
  assertEquals(5,alg.get(2));
  assertEquals(6,alg.get(3));
  alg.remove(0,1);
  assertEquals(2,alg.size);
  assertEquals(5,alg.get(0));
  assertEquals(6,alg.get(1));
}
origin: lessthanoptimal/ddogleg

@Test
public void auto_grow() {
  GrowQueue_I64 alg = new GrowQueue_I64(3);
  assertEquals(3,alg.data.length);
  for( int i = 0; i < 10; i++ )
    alg.push(i);
  assertEquals(10,alg.size);
  for( int i = 0; i < 10; i++ )
    assertEquals(i,alg.get(i),1e-8);
}
org.ddogleg.structGrowQueue_I64push

Popular methods of GrowQueue_I64

  • get
  • <init>
  • add
  • reset
  • resize
  • setTo
  • size
  • zeros
    Creates a queue with the specified length as its size filled with all zeros
  • addAll
  • getFraction
    Gets the value at the index which corresponds to the specified fraction
  • indexOf
    Returns the index of the first element with the specified 'value'. return -1 if it wasn't found
  • insert
    Inserts the value at the specified index and shifts all the other values down.
  • indexOf,
  • insert,
  • pop,
  • remove,
  • sort

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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