code: 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;
      }
    }
docs: Rearrange the elements of a double array in random order.
  
  @param a the array to shuffle.