public Map<String, Object> calculateObjects(Map<String, Object> input) { try { String file = null; Map<String, Object> result = new HashMap<String, Object>(); Matrix matrix = MathUtil.getMatrix(input.get(SOURCE)); Object o1 = input.get(FILE); if (o1 != null) { file = StringUtil.format(o1); } else { file = File.createTempFile("jdmp_matrix", ".CSV").getAbsolutePath(); } matrix.exportTo().file(new File(file)).asDenseCSV(); result.put(TARGET, matrix); return result; } catch (Exception e) { throw new RuntimeException(e); } } }
complete.exportTo() .file(new File(BenchmarkUtil.getResultDir(getConfig()) + name + ".csv")) .asDenseCSV(); } catch (Exception e) { complete.exportTo() .file(new File(BenchmarkUtil.getResultDir(getConfig()) + name + ".xls")) .asXLS(); } catch (Exception e) { .asPLT(params); } catch (Exception e) {
public void saveSettings() throws Exception { String resultDir = BenchmarkUtil.getResultDir(getConfig()); File envFile = new File(resultDir + File.separator + "env.csv"); File propFile = new File(resultDir + File.separator + "props.csv"); File confFile = new File(resultDir + File.separator + "conf.csv"); File versionFile = new File(resultDir + File.separator + "versions.csv"); new SystemEnvironmentMatrix().exportTo().file(envFile).asDenseCSV(); Matrix props = new SystemPropertiesMatrix().replaceRegex(Ret.NEW, "\r\n", " "); props = props.replaceRegex(Ret.NEW, "\n", " "); props.exportTo().file(propFile).asDenseCSV(); getConfig().exportTo().file(confFile).asDenseCSV(); Matrix libraries = new MatrixLibraries(); System.out.println(libraries); Matrix versions = libraries.selectRows(Ret.NEW, 0, 1).transpose(); versions.exportTo().file(versionFile).asDenseCSV(); }
public void scatterPlot(Matrix matrix, String... format) throws Exception { matrix.exportTo().file(matrixFile).asDenseCSV(); execute(getPlotCommand(matrix, false, false)); }
public void plot(Matrix matrix, String... format) throws Exception { matrix.exportTo().file(matrixFile).asDenseCSV(); execute(getPlotCommand(matrix, true, true)); }
bestGuess.exportTo().file(tempFile).asDenseCSV();
@Test public void testFileCSVFactory() throws IOException { File file = File.createTempFile("ujmp-junit", ".tmp"); file.deleteOnExit(); Matrix m1 = Matrix.Factory.randn(8, 6); m1.exportTo().file(file).asDenseCSV(); Matrix m2 = Matrix.Factory.importFrom().file(file).asDenseCSV(); assertEquals(m1, m2); }
@Test public void testFileCSV1() throws IOException { File file = File.createTempFile("ujmp-junit", ".tmp"); file.deleteOnExit(); Matrix m1 = Matrix.Factory.randn(8, 6); m1.exportTo().file(file).asDenseCSV(); Matrix m2 = Matrix.Factory.randn(8, 6); m2.importFrom().file(file).asDenseCSV(); assertEquals(m1, m2); }
@Test public void testFileCSV2() throws IOException { File file = File.createTempFile("ujmp-junit", ".tmp"); file.deleteOnExit(); Matrix m1 = Matrix.Factory.randn(8, 6); m1.exportTo().file(file).asDenseCSV(':'); Matrix m2 = Matrix.Factory.randn(8, 6); m2.importFrom().file(file).asDenseCSV(':'); assertEquals(m1, m2); }
@Test public void testFileCSV3() throws IOException { File file = File.createTempFile("ujmp-junit", ".tmp"); file.deleteOnExit(); Matrix m1 = Matrix.Factory.randn(8, 6); m1.exportTo().file(file).asDenseCSV(':', '#'); Matrix m2 = Matrix.Factory.randn(8, 6); m2.importFrom().file(file).asDenseCSV(':', '#'); assertEquals(m1, m2); }
resultMem); try { temp.exportTo().file(timeFile).asDenseCSV(); mem.exportTo().file(memFile).asDenseCSV(); if (!diff.containsMissingValues()) { diff.exportTo().file(diffFile).asDenseCSV();