Tabnine Logo
QuickSort_F64.sort
Code IndexAdd Tabnine to your IDE (free)

How to use
sort
method
in
org.ddogleg.sorting.QuickSort_F64

Best Java code snippets using org.ddogleg.sorting.QuickSort_F64.sort (Showing top 5 results out of 315)

origin: lessthanoptimal/ddogleg

@Override
public void computeStatistics() {
  int size = allPoints.size();
  if (errors.length < size) {
    errors = new double[size * 3 / 2];
    origErrors = new double[errors.length];
  }
  Iterator<PointIndex<Point>> iter = allPoints.iterator();
  int index = 0;
  while( iter.hasNext() ) {
    Point pt = iter.next().data;
    errors[index++] = modelError.computeDistance(pt);
  }
  System.arraycopy(errors, 0, origErrors, 0, size);
  int where = (int) (size * pruneThreshold);
  sorter.sort(errors, size);
  medianError = errors[size / 2];
  pruneVal = errors[where];
}
origin: org.ddogleg/ddogleg

@Override
public void computeStatistics() {
  int size = allPoints.size();
  if (errors.length < size) {
    errors = new double[size * 3 / 2];
    origErrors = new double[errors.length];
  }
  Iterator<PointIndex<Point>> iter = allPoints.iterator();
  int index = 0;
  while( iter.hasNext() ) {
    Point pt = iter.next().data;
    errors[index++] = modelError.computeDistance(pt);
  }
  System.arraycopy(errors, 0, origErrors, 0, size);
  int where = (int) (size * pruneThreshold);
  sorter.sort(errors, size);
  medianError = errors[size / 2];
  pruneVal = errors[where];
}
origin: org.boofcv/feature

@Override
public double compute(double c_x, double c_y) {
  double period = scale*this.period;
  // top left corner of the region being sampled
  double tl_x = c_x - sampleRadius *period;
  double tl_y = c_y - sampleRadius *period;
  computeGradient(tl_x,tl_y,period);
  // apply weight to each gradient dependent on its position
  if( weights != null ) {
    for( int i = 0; i < total; i++ ) {
      double w = weights.data[i];
      derivX[i] *= w;
      derivY[i] *= w;
    } 
  }
  
  for( int i = 0; i < total; i++ ) {
    angles[i] = Math.atan2(derivY[i],derivX[i]);
  }
  // order points from lowest to highest
  sorter.sort(angles, angles.length, order);
  return estimateAngle();
}
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_F64sort

Popular methods of QuickSort_F64

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • 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