@Test
public void testSortingRandom_indexes() {
int offset = 10;
for( int a = 0; a < 20; a++ ) {
int[] normal = BenchMarkSort.createRandom_S32(rand,20);
int[] original = normal.clone();
int[] withIndexes = new int[offset+normal.length];;
int[] indexes = new int[ withIndexes.length ];
System.arraycopy(normal,0,withIndexes,offset,normal.length);
QuickSort_S32 sorter = new QuickSort_S32();
sorter.sort(normal,normal.length);
sorter.sort(withIndexes,offset,normal.length,indexes);
for( int i = 0; i < normal.length; i++ ) {
assertEquals(original[i],withIndexes[i+offset], UtilEjml.TEST_F64);
assertEquals(normal[i],withIndexes[indexes[i]],UtilEjml.TEST_F64);
}
}
}
}