本文整理了Java中org.ujmp.core.Matrix.exportTo()
方法的一些代码示例,展示了Matrix.exportTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.exportTo()
方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:exportTo
暂无
代码示例来源:origin: jdmp/java-data-mining-package
public Map<String, Object> calculateObjects(Map<String, Object> input) {
try {
Map<String, Object> result = new HashMap<String, Object>();
Matrix in = MathUtil.getMatrix(input.get(SOURCE));
if (in != null) {
in.exportTo().clipboard().asDenseCSV();
result.put(TARGET, in);
}
return result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object call() {
MatrixGUIObject m = getMatrixObject();
try {
m.getMatrix().exportTo().clipboard().asDenseCSV();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public void setMatrix(String label, Matrix matrix) throws Exception {
String script = matrix.exportTo().string().asMatlabScript(label);
execute(script);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object call() {
MatrixGUIObject m = getMatrixObject();
try {
m.getMatrix().exportTo().clipboard().asDenseCSV();
m.getMatrix().clear();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testReaderCSVFactory() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
ByteArrayOutputStream os = new ByteArrayOutputStream();
OutputStreamWriter w = new OutputStreamWriter(os);
m1.exportTo().writer(w).asDenseCSV();
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
InputStreamReader r = new InputStreamReader(is);
Matrix m2 = Matrix.Factory.importFrom().reader(r).asDenseCSV();
assertEquals(m1, m2);
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testReaderCSV() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
ByteArrayOutputStream os = new ByteArrayOutputStream();
OutputStreamWriter w = new OutputStreamWriter(os);
m1.exportTo().writer(w).asDenseCSV();
Matrix m2 = Matrix.Factory.randn(8, 6);
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
InputStreamReader r = new InputStreamReader(is);
m2.importFrom().reader(r).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testStreamCSVFactory() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
ByteArrayOutputStream os = new ByteArrayOutputStream();
m1.exportTo().stream(os).asDenseCSV();
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
Matrix m2 = Matrix.Factory.importFrom().stream(is).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testStreamCSV() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
ByteArrayOutputStream os = new ByteArrayOutputStream();
m1.exportTo().stream(os).asDenseCSV();
Matrix m2 = Matrix.Factory.randn(8, 6);
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
m2.importFrom().stream(is).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@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);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@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);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@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);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@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);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testClipboardCSVFactory() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
m1.exportTo().clipboard().asDenseCSV();
Matrix m2 = Matrix.Factory.importFrom().clipboard().asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testByteArrayCSVFactory() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
byte[] bytes = m1.exportTo().byteArray().asDenseCSV();
Matrix m2 = Matrix.Factory.importFrom().byteArray(bytes).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testStringCSVFactory() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
String s = m1.exportTo().string().asDenseCSV();
Matrix m2 = Matrix.Factory.importFrom().string(s).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testClipboardCSV1() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
m1.exportTo().clipboard().asDenseCSV();
Matrix m2 = Matrix.Factory.randn(8, 6);
m2.importFrom().clipboard().asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testStringCSV() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
String s = m1.exportTo().string().asDenseCSV();
Matrix m2 = Matrix.Factory.randn(8, 6);
m2.importFrom().string(s).asDenseCSV();
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testClipboardCSV2() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
m1.exportTo().clipboard().asDenseCSV(':');
Matrix m2 = Matrix.Factory.randn(8, 6);
m2.importFrom().clipboard().asDenseCSV(':');
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testClipboardCSV3() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
m1.exportTo().clipboard().asDenseCSV(':', '#');
Matrix m2 = Matrix.Factory.randn(8, 6);
m2.importFrom().clipboard().asDenseCSV(':', '#');
assertEquals(m1, m2);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testByteArrayCSV() throws IOException {
Matrix m1 = Matrix.Factory.randn(8, 6);
byte[] bytes = m1.exportTo().byteArray().asDenseCSV();
Matrix m2 = Matrix.Factory.randn(8, 6);
m2.importFrom().byteArray(bytes).asDenseCSV();
assertEquals(m1, m2);
}
内容来源于网络,如有侵权,请联系作者删除!