SparseMatrix extends AbstractMatrix { @Override public void print(PrintStream out) { print(out, null, null); } SparseMatrix(int rowCount, int columnCount, int[] columnStart, int[] rowIndices, double[] values);   SparseMatrix(int rowCount, int columnCount, int estimatedNonZeroValueCount); @Override int getRowCount(); @Override int getColumnCount(); @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 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 testSparsePrint() throws IOException { Matrix a = createA(matrixFactory); String expected = String.join(System.lineSeparator(), "rowCount=3", "columnCount=2", "columnStart=[0, 2, 3]", "columnValueCount=[2, 1]", "rowIndices={0, 2, 1}", "values={1.0, 2.0, 3.0}") + System.lineSeparator(); assertEquals(expected, print(a, null, null)); assertEquals(expected, print(a)); }