DenseMatrix extends AbstractMatrix { @Override public void print(PrintStream out) { print(out, null, null); } DenseMatrix(int rowCount, int columnCount, double[] values);  DenseMatrix(int rowCount, int columnCount);  DenseMatrix(int rowCount, int columnCount, Supplier<ByteBuffer> bufferSupplier);  DenseMatrix(Jama.Matrix matrix); double get(int i, int j); @Deprecated double getValue(int i, int j); @Override void set(int i, int j, double value); @Override void add(int i, int j, double value); @Override Element addAndGetElement(int i, int j, double value); @Override void reset(); @Override int getRowCount(); @Override int getColumnCount(); @Override LUDecomposition decomposeLU(); @Override Matrix times(Matrix other); @Override void iterateNonZeroValue(ElementHandler handler); @Override void iterateNonZeroValueOfColumn(int j, ElementHandler handler); @Override DenseMatrix toDense(); @Override SparseMatrix toSparse(); @Override Matrix to(MatrixFactory factory); @Override void print(PrintStream out); @Override void print(PrintStream out, List<String> rowNames, List<String> columnNames); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testDensePrint() throws IOException { Matrix a = createA(matrixFactory); String expected = String.join(System.lineSeparator(), " 1.0 0.0", " 0.0 3.0", " 2.0 0.0") + System.lineSeparator(); assertEquals(expected, print(a, null, null)); assertEquals(expected, print(a)); }
@Test public void testDensePrintWithNames() throws IOException { Matrix a = createA(matrixFactory); String expected = String.join(System.lineSeparator(), " c1 c2", " r1 1.0 0.0", " r2 0.0 3.0", " r3 2.0 0.0") + System.lineSeparator(); assertEquals(expected, print(a, ImmutableList.of("r1", "r2", "r3"), ImmutableList.of("c1", "c2"))); }