MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testSortDP

Method testSortDP

JSAT/test/jsat/utils/QuickSortTest.java:70–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 @Test
71 public void testSortDP()
72 {
73 System.out.println("sort");
74
75 IntList ints = new IntList();
76 Collection<List<?>> paired = new ArrayList<List<?>>();
77 paired.add(ints);
78 for(int size = 2; size < 10000; size*=2)
79 {
80 ints.clear();
81 double[] x = new double[size];
82 for(int i = 0; i < x.length; i++)
83 {
84 x[i] = x.length-i;
85 ints.add(i);
86 }
87 QuickSort.sort(x, 0, size, paired);
88
89 for(int i = 0; i < x.length-1; i++)
90 {
91 assertTrue(x[i] <= x[i+1]);
92 assertTrue(ints.get(i) > ints.get(i+1));
93 }
94
95 }
96 }
97
98 @Test
99 public void testSortFP()

Callers

nothing calls this directly

Calls 5

clearMethod · 0.95
addMethod · 0.95
sortMethod · 0.95
getMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected