Here you can find the source of saveDoubleMatrix(double[][] matrix, PrintStream out)
public static void saveDoubleMatrix(double[][] matrix, PrintStream out)
//package com.java2s; //License from project: Open Source License import java.io.PrintStream; public class Main { public static void saveDoubleMatrix(double[][] matrix, PrintStream out) { int rows = matrix.length; int cols = matrix[0].length; out.println(rows + " " + cols); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { out.print(matrix[i][j]); if (j != cols - 1) { out.print(" "); }// w w w. j a va2 s . com } out.println(); } } }