congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
QuickSort_F64.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.ddogleg.sorting.QuickSort_F64
constructor

Best Java code snippets using org.ddogleg.sorting.QuickSort_F64.<init> (Showing top 2 results out of 315)

origin: lessthanoptimal/ddogleg

  @Test
  public void testSortingRandom_indexes() {
    int offset = 10;
    for( int a = 0; a < 20; a++ ) {
      double[] normal = BenchMarkSort.createRandom_F64(rand,20);
      double[] original = normal.clone();
      double[] withIndexes = new double[offset+normal.length];;
      int[] indexes = new int[ withIndexes.length ];

      System.arraycopy(normal,0,withIndexes,offset,normal.length);

      QuickSort_F64 sorter = new QuickSort_F64();

      sorter.sort(normal,normal.length);
      sorter.sort(withIndexes,offset,normal.length,indexes);

      for( int i = 0; i < normal.length; i++ ) {
        // make sure the original hasn't been modified
        assertEquals(original[i],withIndexes[i+offset], UtilEjml.TEST_F64);
        // see if it produced the same results as the normal one
        assertEquals(normal[i],withIndexes[indexes[i]],UtilEjml.TEST_F64);
      }
    }
  }
}
origin: lessthanoptimal/ddogleg

@Test
public void testSortingRandom() {
  double[] ret = BenchMarkSort.createRandom_F64(rand,200);
  double preTotal = UtilDouble.sum(ret);
  QuickSort_F64 sorter = new QuickSort_F64();
  sorter.sort(ret,ret.length);
  double postTotal = UtilDouble.sum(ret);
  // make sure it didn't modify the list, in an unexpected way
  assertEquals(preTotal,postTotal,UtilEjml.TEST_F64);
  double prev = ret[0];
  for( int i = 1; i < ret.length; i++ ) {
    if( ret[i] < prev )
      fail("Not ascending");
    prev = ret[i];
  }
}
org.ddogleg.sortingQuickSort_F64<init>

Popular methods of QuickSort_F64

  • sort

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Notification (javax.management)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
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