Here you can find the source of printMatrix(double[][] matrix)
Parameter | Description |
---|---|
matrix | The matrix to display |
public static void printMatrix(double[][] matrix)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww . java 2 s. c o m * Debug function for displaying a matrix * * @param matrix The matrix to display */ public static void printMatrix(double[][] matrix) { int dim = matrix.length; for (int i = 0; i < dim; i++) { for (int j = 0; j < dim; j++) { System.out.printf("%5f", matrix[i][j]); if (i == j && matrix[i][j] != 0) { // System.err.println("Error at i = " + i + " j = " + j +" Value = " + matrix[i][j]); } } System.out.println(); } System.out.println(); } }