public static void shuffle ( double [ ] a ) { int N = a . length ; for ( int i = 0 ; i < N ; i ++ ) { int r = i + uniform ( N - i ) ; // between i and N-1 double temp = a [ i ] ; a [ i ] = a [ r ] ; a [ r ] = temp ; } }
Rearrange the elements of a double array in random order .