use of au.com.bytecode.opencsv.CSVWriter in project gatk by broadinstitute.
the class DecomposeSingularValues method writeMatrix.
private void writeMatrix(final RealMatrix m, final File outputFilename) throws IOException {
final List<String[]> textTable = new ArrayList<>();
for (int i = 0; i < m.getRowDimension(); i++) {
textTable.add(Arrays.stream(m.getRow(i)).mapToObj(Double::toString).toArray(String[]::new));
}
final FileWriter fw = new FileWriter(outputFilename);
CSVWriter csvWriter = new CSVWriter(fw, '\t', CSVWriter.NO_QUOTE_CHARACTER);
csvWriter.writeAll(textTable);
csvWriter.flush();
csvWriter.close();
}
Aggregations