congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.ddogleg.sorting
Code IndexAdd Tabnine to your IDE (free)

How to use org.ddogleg.sorting

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

origin: org.ddogleg/ddogleg

  public static double fraction( GrowQueue_F64 list , double fraction ) {
    int k = (int)((list.size-1)*fraction+0.5);
    return QuickSelect.select(list.data,k,list.size);
  }
}
origin: org.boofcv/feature

/**
 * If this function is called the exact sort routine will not be used and instead an approximate routine will
 * be used.
 * @param numBins Number of bins.  Try 2000.  More bins the more accurate it will be
 */
public void configureApproximateSort( int numBins ) {
  sorterApprox = new ApproximateSort_F32(numBins);
}
origin: org.ddogleg/ddogleg

public ApproximateSort_F32(int minValue, int maxValue, int numBins) {
  this.numBins = numBins;
  setRange(minValue,maxValue);
}
origin: lessthanoptimal/ddogleg

@Test
public void sortObject() {
  int numBins = 150;
  double tolerance = 15.0/numBins;
  double[] data = random(-5,10,4,200);
  SortableParameter_F64[] objs = convert(data);
  ApproximateSort_F64 alg = new ApproximateSort_F64(-5,10,numBins);
  alg.sortObject(objs, 4, 200);
  // see if the sort was to within the expected tolerance
  for( int i = 5; i < objs.length; i++ ) {
    assertTrue( objs[i].sortValue > objs[i-1].sortValue -tolerance );
  }
}
origin: org.ddogleg/ddogleg

public ApproximateSort_F64(double minValue, double maxValue, int numBins) {
  this.numBins = numBins;
  setRange(minValue,maxValue);
}
origin: org.ddogleg/ddogleg

public CountingSort(int minValue, int maxValue) {
  setRange(minValue,maxValue);
}
origin: org.boofcv/recognition

public EllipseClustersIntoAsymmetricGrid() {
  sorter = new QuickSortComparator<>(new Comparator<Edge>() {
    @Override
    public int compare(Edge o1, Edge o2) {
      if (o1.angle < o2.angle)
        return -1;
      else if (o1.angle > o2.angle)
        return 1;
      else
        return 0;
    }
  });
}
origin: lessthanoptimal/ddogleg

  public static void main( String args[] ) throws FileNotFoundException {
    GenerateQuickSelect app = new GenerateQuickSelect();
    app.generate();
  }
}
origin: lessthanoptimal/ddogleg

@Test
public void test_F32() {
  float[] ret = BenchMarkSort.createRandom_F32(rand,200);
  ShellSort.sort(ret);
  float prev = ret[0];
  for( int i = 1; i < ret.length; i++ ) {
    if( ret[i] < prev )
      fail("Not ascending");
    prev = ret[i];
  }
}
origin: lessthanoptimal/ddogleg

@Test
public void test_F64() {
  double[] ret = BenchMarkSort.createRandom_F64(rand,200);
  ShellSort.sort(ret);
  double prev = ret[0];
  for( int i = 1; i < ret.length; i++ ) {
    if( ret[i] < prev )
      fail("Not ascending");
    prev = ret[i];
  }
}
origin: lessthanoptimal/ddogleg

  @Test
  public void testSortDouble() {
    double[] ret = BenchMarkSort.createRandom_F64(rand,200);

    StraightInsertionSort.sort(ret);

    double prev = ret[0];
    for( int i = 1; i < ret.length; i++ ) {
      if( ret[i] < prev )
        fail("Not ascending");
    }
  }
}
origin: lessthanoptimal/ddogleg

@Test
public void test_S32() {
  int[] ret = BenchMarkSort.createRandom_S32(rand,200);
  ShellSort.sort(ret);
  double prev = ret[0];
  for( int i = 1; i < ret.length; i++ ) {
    if( ret[i] < prev )
      fail("Not ascending");
    prev = ret[i];
  }
}
origin: lessthanoptimal/ddogleg

public static SortableParameter_F32[] copy( SortableParameter_F32[] list ) {
  SortableParameter_F32[] ret = new SortableParameter_F32[ list.length ];
  for( int i = 0; i < list.length; i++ ) {
    ret[i] = new SortableParameter_F32();
    ret[i].sortValue = list[i].sortValue;
  }
  return ret;
}
origin: lessthanoptimal/ddogleg

public static SortableParameter_F64[] copy( SortableParameter_F64[] list ) {
  SortableParameter_F64[] ret = new SortableParameter_F64[ list.length ];
  for( int i = 0; i < list.length; i++ ) {
    ret[i] = new SortableParameter_F64();
    ret[i].sortValue = list[i].sortValue;
  }
  return ret;
}
origin: lessthanoptimal/ddogleg

  public static double fraction( GrowQueue_F64 list , double fraction ) {
    int k = (int)((list.size-1)*fraction+0.5);
    return QuickSelect.select(list.data,k,list.size);
  }
}
origin: lessthanoptimal/ddogleg

public ApproximateSort_F32(int minValue, int maxValue, int numBins) {
  this.numBins = numBins;
  setRange(minValue,maxValue);
}
origin: lessthanoptimal/ddogleg

public ApproximateSort_F64(double minValue, double maxValue, int numBins) {
  this.numBins = numBins;
  setRange(minValue,maxValue);
}
origin: lessthanoptimal/ddogleg

public CountingSort(int minValue, int maxValue) {
  setRange(minValue,maxValue);
}
origin: lessthanoptimal/ddogleg

  public SortableParameter_F32[] convert(float[] data ) {
    SortableParameter_F32[] ret = new SortableParameter_F32[data.length];

    for( int i = 0; i < data.length; i++ ) {
      ret[i] = new SortableParameter_F32(data[i]);
    }

    return ret;
  }
}
origin: lessthanoptimal/ddogleg

  public SortableParameter_F64[] convert(double[] data ) {
    SortableParameter_F64[] ret = new SortableParameter_F64[data.length];

    for( int i = 0; i < data.length; i++ ) {
      ret[i] = new SortableParameter_F64(data[i]);
    }

    return ret;
  }
}
org.ddogleg.sorting

Most used classes

  • QuickSelect
    QuickSelect searches for the k-th largest item in the list. While doing this search it will sort th
  • ApproximateSort_F32
    Counting sort for floating point numbers. Sorting accuracy will be to within range/numBins.
  • QuickSort_F64
    An implementation of the quick sort algorithm from Numerical Recipes Third Edition that is specified
  • ApproximateSort_F64
    Counting sort for floating point numbers. Sorting accuracy will be to within range/numBins.
  • CountingSort
    A O(N) sorting routine for integer valued elements with a known upper and lower bound. This performa
  • QuickSortObj_F32,
  • QuickSort_F32,
  • BenchMarkSort,
  • GenerateQuickSelect,
  • QuickSortObj_F64,
  • QuickSort_S32,
  • ShellSort,
  • SortableParameter_F32,
  • SortableParameter_F64,
  • StraightInsertionSort,
  • TestApproximateSort_F32,
  • TestApproximateSort_F64,
  • TestQuickSortComparator_F64,
  • TestQuickSortObj_F32
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