Here you can find the source of loadDoubleMatrix(Scanner reader)
public static double[][] loadDoubleMatrix(Scanner reader)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { public static double[][] loadDoubleMatrix(Scanner reader) { int rows = reader.nextInt(); int cols = reader.nextInt(); double[][] ret = new double[rows][cols]; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { ret[i][j] = Double.parseDouble(reader.next()); }/*from w ww . ja v a2 s .c o m*/ } return ret; } }