public void testSortDescending() { testSortDescending(new float[] {}, new float[] {}); testSortDescending(new float[] {1}, new float[] {1}); testSortDescending(new float[] {1, 2}, new float[] {2, 1}); testSortDescending(new float[] {1, 3, 1}, new float[] {3, 1, 1}); testSortDescending(new float[] {-1, 1, -2, 2}, new float[] {2, 1, -1, -2}); testSortDescending( new float[] {-1, 1, Float.NaN, -2, -0, 0, 2}, new float[] {Float.NaN, 2, 1, 0, -0, -1, -2}); }
public void testSortDescendingIndexed() { testSortDescending(new float[] {}, 0, 0, new float[] {}); testSortDescending(new float[] {1}, 0, 1, new float[] {1}); testSortDescending(new float[] {1, 2}, 0, 2, new float[] {2, 1}); testSortDescending(new float[] {1, 3, 1}, 0, 2, new float[] {3, 1, 1}); testSortDescending(new float[] {1, 3, 1}, 0, 1, new float[] {1, 3, 1}); testSortDescending(new float[] {-1, -2, 1, 2}, 1, 3, new float[] {-1, 1, -2, 2}); testSortDescending( new float[] {-1, 1, Float.NaN, -2, 2}, 1, 4, new float[] {-1, Float.NaN, 1, -2, 2}); }
public void testSortDescendingIndexed() { testSortDescending(new float[] {}, 0, 0, new float[] {}); testSortDescending(new float[] {1}, 0, 1, new float[] {1}); testSortDescending(new float[] {1, 2}, 0, 2, new float[] {2, 1}); testSortDescending(new float[] {1, 3, 1}, 0, 2, new float[] {3, 1, 1}); testSortDescending(new float[] {1, 3, 1}, 0, 1, new float[] {1, 3, 1}); testSortDescending(new float[] {-1, -2, 1, 2}, 1, 3, new float[] {-1, 1, -2, 2}); if (sortWorksWithNaN()) { testSortDescending( new float[] {-1, 1, Float.NaN, -2, 2}, 1, 4, new float[] {-1, Float.NaN, 1, -2, 2}); } }
public void testSortDescending() { testSortDescending(new float[] {}, new float[] {}); testSortDescending(new float[] {1}, new float[] {1}); testSortDescending(new float[] {1, 2}, new float[] {2, 1}); testSortDescending(new float[] {1, 3, 1}, new float[] {3, 1, 1}); testSortDescending(new float[] {-1, 1, -2, 2}, new float[] {2, 1, -1, -2}); if (sortWorksWithNaN()) { testSortDescending( new float[] {-1, 1, Float.NaN, -2, -0, 0, 2}, new float[] {Float.NaN, 2, 1, 0, -0, -1, -2}); } }