Here you can find the source of printMatrix(int m, int n, double[][] a)
public static void printMatrix(int m, int n, double[][] a)
//package com.java2s; //License from project: Open Source License public class Main { public static void printMatrix(int m, int n, double[][] a) { int i, j; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) System.out.print(" " + a[i][j]); System.out.println(); }//w w w. ja v a 2 s.com System.out.println(); } public static void printMatrix(int m, int n, double[] a) { int i, j; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) System.out.print(" " + a[i * n + j]); System.out.println(); } System.out.println(); } }