File matrixFile = new File("TestMatrixFile");
BufferedWriter out = new BufferedWriter(new FileWriter(matrixFile));
MatrixVectorWriter writer = new MatrixVectorWriter(out);
MatrixInfo mi = new MatrixInfo(false, MatrixInfo.MatrixField.Real, MatrixInfo.MatrixSymmetry.General);
writer.printMatrixInfo(mi);
writer.printMatrixSize(new MatrixSize(mat.numRows(), mat.numColumns(), mat.numColumns() * mat.numRows()), mi);
writer.printArray(mat.getData());
writer.close();
Matrix newMat = new DenseMatrix(new MatrixVectorReader(new FileReader(matrixFile)));
MatrixTestAbstract.assertEquals(mat, newMat);