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

Method testSortFP

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

Source from the content-addressed store, hash-verified

96 }
97
98 @Test
99 public void testSortFP()
100 {
101 System.out.println("sort");
102
103 IntList ints = new IntList();
104 Collection<List<?>> paired = new ArrayList<List<?>>();
105 paired.add(ints);
106 for(int size = 2; size < 10000; size*=2)
107 {
108 ints.clear();
109 float[] x = new float[size];
110 for(int i = 0; i < x.length; i++)
111 {
112 x[i] = x.length-i;
113 ints.add(i);
114 }
115 QuickSort.sort(x, 0, size, paired);
116
117 for(int i = 0; i < x.length-1; i++)
118 {
119 assertTrue(x[i] <= x[i+1]);
120 assertTrue(ints.get(i) > ints.get(i+1));
121 }
122
123 }
124 }
125
126}

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