List of utility methods to do Matrix Print
void | printMatrix(double[][] matrix) print Matrix for (int i = 0; i < matrix.length; i++) { String line = Arrays.toString(matrix[i]); line = line.replaceAll(", ", "\t"); System.out.println(line); System.out.println(); |
void | printMatrix(double[][] matrix) Debug function for displaying a 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.out.println(); ... |
void | printMatrix(double[][] sims) print Matrix if (sims.length == 0) return; for (int i = 0; i < sims.length; i++) { for (int j = 0; j < sims[0].length; j++) { System.out.printf("%.2f ", sims[i][j]); System.out.println(); |
String | printMatrix(final double m[][]) print Matrix StringBuilder sb = new StringBuilder(); for (int i = 0; i < m.length; ++i) { for (int j = 0; j < m[i].length; ++j) { if (j > 0) { sb.append('\t'); sb.append(m[i][j]); sb.append('\n'); return sb.toString(); |
void | printMatrix(float[] array, int rows, int columns) print Matrix StringBuilder sb = new StringBuilder(); NumberFormat formatter = new DecimalFormat("#0.00"); IntStream.range(0, columns).forEach(i -> { IntStream.range(0, columns) .forEach(j -> sb.append(formatter.format(array[i * columns + j])).append(" ")); sb.append(System.getProperty("line.separator")); }); System.out.println(sb.toString()); ... |
void | printMatrix(int M, int N, double mat[][]) print Matrix for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) System.out.print(mat[i][j] + " "); System.out.println(); |
void | printMatrix(int m, int n, double[][] a) print Matrix int i, j; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) System.out.print(" " + a[i][j]); System.out.println(); System.out.println(); |
void | printMatrix(int matrix[][]) Prints the provided incidence matrix System.out.println("{"); for (int i = 0; i < matrix.length; i++) { int[] row = matrix[i]; System.out.print(" { "); for (int j = 0; j < row.length; j++) { if (j == 0) System.out.print(row[j]); else ... |
void | printMatrix(int[] array, String format, int width) print Matrix String[] strings = new String[array.length]; int maxLen = 0; for (int i = 0; i < array.length; i++) { strings[i] = String.format(format, array[i]); maxLen = Math.max(maxLen, strings[i].length()); for (int ind = 0; ind < strings.length;) { StringBuilder builder = new StringBuilder(); ... |
void | printMatrix(int[][] M) print Matrix if (M.length == 0 || M[0].length == 0) return; for (int i = 0; i < M.length; i++) { for (int j = 0; j < M[0].length; j++) { System.out.printf("%5d", M[i][j]); System.out.println(); |