public static void sampleWithoutReplacement ( int [ ] array , int numArgClasses , Random rand ) { int [ ] temp = new int [ numArgClasses ] ; for ( int i = 0 ; i < temp . length ; i ++ ) { temp [ i ] = i ; } shuffle ( temp , rand ) ; System . arraycopy ( temp , 0 , array , 0 , array . length ) ; }
Fills the array with sample from 0 to numArgClasses - 1 without replacement .