本文整理了Java中org.ujmp.core.Matrix.getRowLabel()
方法的一些代码示例,展示了Matrix.getRowLabel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.getRowLabel()
方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:getRowLabel
暂无
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getValueAt(long rowIndex, long columnIndex) {
return model.getMatrix().getRowLabel(rowIndex);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public Object getValueAt(int rowIndex, int columnIndex) {
return model.getMatrix().getRowLabel(rowIndex);
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public static final void toWriter(Writer w, Matrix m, Object... parameters) throws IOException {
w.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
w.write("<graphml>\n");
w.write("<key id=\"k0\" for=\"node\" attr.name=\"variableName\" attr.type=\"string\"></key>\n");
w.write("<key id=\"k1\" for=\"node\" attr.name=\"description\" attr.type=\"string\"></key>\n");
w.write("<key id=\"k2\" for=\"edge\" attr.name=\"confidence\" attr.type=\"double\"><default>0.0</default></key>\n");
w.write("<key id=\"k3\" for=\"edge\" attr.name=\"directed\" attr.type=\"boolean\"><default>false</default></key>\n");
w.write("<key id=\"k5\" for=\"node\" attr.name=\"xPos\" attr.type=\"string\"></key>\n");
w.write("<key id=\"k6\" for=\"node\" attr.name=\"yPos\" attr.type=\"string\"></key>\n");
w.write("<graph id=\"" + m.getLabel() + "\" edgedefault=\"undirected\">\n");
for (int i = 0; i < m.getRowCount(); i++) {
w.write("<node id=\"node" + i + "\">\n");
w.write("<data key=\"k0\">" + m.getRowLabel(i).replaceAll("[<>&]", "") + "</data>\n");
// w.write("<data key=\"k5\">" + n.getPosX() + "</data>\n");
// w.write("<data key=\"k6\">" + n.getPosY() + "</data>\n");
w.write("</node>\n");
}
int id = 0;
for (long[] c : m.allCoordinates()) {
if (m.getAsDouble(c) > 0.0) {
w.write("<edge id=\"edge" + (id++) + "\" ");
w.write("source=\"node" + c[Matrix.ROW] + "\" ");
w.write("target=\"node" + c[Matrix.COLUMN] + "\">\n");
w.write("</edge>\n");
}
}
w.write("</graph>\n");
w.write("</graphml>");
w.close();
}
代码示例来源:origin: ujmp/universal-java-matrix-package
writer.write(matrix.getRowLabel(row));
writer.write("</th>" + EOL);
代码示例来源:origin: org.ujmp/ujmp-jfreechart
row = Double.parseDouble(matrix.getMatrix().getRowLabel(index));
} catch (Exception e) {
代码示例来源:origin: ujmp/universal-java-matrix-package
row = Double.parseDouble(matrix.getMatrix().getRowLabel(index));
} catch (Exception e) {
代码示例来源:origin: ujmp/universal-java-matrix-package
format(m.getRowLabel(cursor[Matrix.ROW]), toAppendTo, pos);
toAppendTo.append(" | ");
代码示例来源:origin: ujmp/universal-java-matrix-package
perCell.setLabel(allmeans.getLabel() + "-percell");
for (int r = 0; r < perCell.getRowCount(); r++) {
perCell.setRowLabel(r, perCell.getRowLabel(r).split("x")[0]);
scaled.setLabel(allmeans.getLabel() + "-scaled");
for (int r = 0; r < scaled.getRowCount(); r++) {
scaled.setRowLabel(r, scaled.getRowLabel(r).split("x")[0]);
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public void testRows() {
Matrix m1 = Matrix.Factory.zeros(1, 2);
m1.setLabel("label");
m1.setRowLabel(0, "row1");
Matrix m2 = m1.appendVertically(Ret.NEW, Matrix.Factory.zeros(1, 2));
m2.setRowLabel(1, "row2");
assertEquals("label", m2.getLabelObject());
assertEquals("row1", m2.getRowLabel(0));
assertEquals("row2", m2.getRowLabel(1));
}
代码示例来源:origin: ujmp/universal-java-matrix-package
public final static void compareAnnotation(Matrix m) {
for (int r = 0; r < m.getRowCount(); r++) {
if (r == 0) {
assertEquals(null, m.getRowLabel(r));
} else {
assertEquals("row" + r, m.getRowLabel(r));
}
}
for (int c = 0; c < m.getColumnCount(); c++) {
if (c == 1) {
assertEquals(null, m.getColumnLabel(c));
} else {
assertEquals("col" + c, m.getColumnLabel(c));
}
}
assertEquals("label", m.getLabel());
}
代码示例来源:origin: ujmp/universal-java-matrix-package
private void export(Matrix matrix) {
String name = matrix.getLabel();
for (int r = 0; r < matrix.getRowCount(); r++) {
matrix.setRowLabel(r, String.valueOf(extractSize(matrix.getRowLabel(r))));
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public final void testTransposeNewSmall() throws Exception {
Matrix m = createMatrixWithAnnotation(2, 3);
m.setAsDouble(1.0, 0, 0);
m.setAsDouble(2.0, 0, 1);
m.setAsDouble(3.0, 0, 2);
m.setAsDouble(4.0, 1, 0);
m.setAsDouble(5.0, 1, 1);
m.setAsDouble(6.0, 1, 2);
m.setLabel("label");
m.setRowLabel(1, "row1");
m.setColumnLabel(2, "col2");
Matrix r = m.transpose(Ret.NEW);
assertEquals(getLabel(), m.getRowCount(), r.getColumnCount());
assertEquals(getLabel(), m.getColumnCount(), r.getRowCount());
assertEquals(getLabel(), 1.0, r.getAsDouble(0, 0), TOLERANCE);
assertEquals(getLabel(), 4.0, r.getAsDouble(0, 1), TOLERANCE);
assertEquals(getLabel(), 2.0, r.getAsDouble(1, 0), TOLERANCE);
assertEquals(getLabel(), 5.0, r.getAsDouble(1, 1), TOLERANCE);
assertEquals(getLabel(), 3.0, r.getAsDouble(2, 0), TOLERANCE);
assertEquals(getLabel(), 6.0, r.getAsDouble(2, 1), TOLERANCE);
assertEquals(getLabel(), "label", r.getLabel());
assertEquals(getLabel(), "row1", r.getColumnLabel(1));
assertEquals(getLabel(), "col2", r.getRowLabel(2));
if (m instanceof Erasable) {
((Erasable) m).erase();
}
}
代码示例来源:origin: ujmp/universal-java-matrix-package
@Test
public final void testTransposeLinkSmall() throws Exception {
Matrix m = createMatrixWithAnnotation(2, 3);
m.setAsDouble(1.0, 0, 0);
m.setAsDouble(2.0, 0, 1);
m.setAsDouble(3.0, 0, 2);
m.setAsDouble(4.0, 1, 0);
m.setAsDouble(5.0, 1, 1);
m.setAsDouble(6.0, 1, 2);
m.setLabel("label");
m.setRowLabel(1, "row1");
m.setColumnLabel(2, "col2");
Matrix r = m.transpose(Ret.LINK);
assertEquals(getLabel(), m.getRowCount(), r.getColumnCount());
assertEquals(getLabel(), m.getColumnCount(), r.getRowCount());
assertEquals(getLabel(), 1.0, r.getAsDouble(0, 0), TOLERANCE);
assertEquals(getLabel(), 4.0, r.getAsDouble(0, 1), TOLERANCE);
assertEquals(getLabel(), 2.0, r.getAsDouble(1, 0), TOLERANCE);
assertEquals(getLabel(), 5.0, r.getAsDouble(1, 1), TOLERANCE);
assertEquals(getLabel(), 3.0, r.getAsDouble(2, 0), TOLERANCE);
assertEquals(getLabel(), 6.0, r.getAsDouble(2, 1), TOLERANCE);
assertEquals(getLabel(), "label", r.getLabel());
assertEquals(getLabel(), "row1", r.getColumnLabel(1));
assertEquals(getLabel(), "col2", r.getRowLabel(2));
if (m instanceof Erasable) {
((Erasable) m).erase();
}
}
内容来源于网络,如有侵权,请联系作者删除!