@Test
public void testSortingRandom_indexes() {
int offset = 10;
for( int a = 0; a < 20; a++ ) {
double[] normal = BenchMarkSort.createRandom_F64(rand,20);
double[] original = normal.clone();
double[] withIndexes = new double[offset+normal.length];;
int[] indexes = new int[ withIndexes.length ];
System.arraycopy(normal,0,withIndexes,offset,normal.length);
QuickSort_F64 sorter = new QuickSort_F64();
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);
}
}
}
}