Here you can find the source of shuffleRow(final double[] data)
public static Callable shuffleRow(final double[] data)
//package com.java2s; import java.util.concurrent.*; import java.util.Random; public class Main { static Random random = new Random(); public static Callable shuffleRow(final double[] data) { return new Callable() { int len = data.length; public Object call() throws Exception { for (int i = 0; i < data.length; i++) { double temp = data[i]; int index = random.nextInt(len); data[i] = data[index]; data[index] = temp;/*from w w w .j ava2 s . c om*/ } return data; } }; } }