SimilarityMatrix extends ReadWriteableMatrix implements ReadWriteable { @Override public void writeASCII(PrintWriter out) throws IOException { super.writeASCII(out); for (String s : index) out.println(s); } protected  SimilarityMatrix();  SimilarityMatrix(int size);  SimilarityMatrix(String [] index);  SimilarityMatrix(String [] index, Matrix data);  SimilarityMatrix(String [] index, double[][] data); int indexOf(String value); void setIndexValue(int i, String value); String getIndexValue(int i); String [] getIndex(); @Override void readASCII(Scanner in); @Override String asciiHeader(); @Override void readBinary(DataInput in); @Override byte[] binaryHeader(); @Override void writeASCII(PrintWriter out); @Override void writeBinary(DataOutput out); UndirectedGraph<String, DefaultEdge> toUndirectedUnweightedGraph(double threshold); @Override SimilarityMatrix copy(); @Override SimilarityMatrix clone(); SimilarityMatrix process(SimilarityMatrixProcessor proc); SimilarityMatrix processInplace(SimilarityMatrixProcessor proc); @Override String toString();  }
@Test public void testAsciiIO() throws IOException { File tmp = folder.newFile("openimaj-testAsciiIO.mat"); IOUtils.writeASCII(tmp, mat); SimilarityMatrix m2 = IOUtils.read(tmp, SimilarityMatrix.class); ReadWriteableMatrixTest.compareMatrices(mat, m2); tmp.delete(); }