/** * Reads a matrix in which has been encoded using a Column Space Value (CSV) * file format. The number of rows and columns are read in on the first line. Then * each row is read in the subsequent lines. * * Works with dense and sparse matrices. * * @param fileName The file being loaded. * @return DMatrix * @throws IOException */ public static <T extends DMatrix>T loadCSV(String fileName , boolean doublePrecision ) throws IOException { FileInputStream fileStream = new FileInputStream(fileName); ReadMatrixCsv csv = new ReadMatrixCsv(fileStream); T ret; if( doublePrecision ) ret = csv.read64(); else ret = csv.read32(); fileStream.close(); return ret; }