org.ujmp.core.Matrix.getColumnLabel()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.ujmp.core.Matrix.getColumnLabel()方法的一些代码示例,展示了Matrix.getColumnLabel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.getColumnLabel()方法的具体详情如下:
包路径:org.ujmp.core.Matrix
类名称:Matrix
方法名:getColumnLabel

Matrix.getColumnLabel介绍

暂无

代码示例

代码示例来源:origin: ujmp/universal-java-matrix-package

public final String getColumnName(final long columnIndex) {
  return matrix.getColumnLabel(columnIndex);
}

代码示例来源:origin: ujmp/universal-java-matrix-package

private static final String getColumnName(Matrix matrix, long column) {
  String columnName = matrix.getColumnLabel(column);
  if (columnName == null || columnName.length() == 0) {
    columnName = "column " + column;
  }
  return columnName;
}

代码示例来源:origin: ujmp/universal-java-matrix-package

String x = matrix.getColumnLabel(0);
x = x == null ? "column 0" : x;
writer.write("set xlabel '" + x + "'" + EOL);
String x = matrix.getColumnLabel(c);
x = x == null ? "column " + c : x;
writer.write("'-' using 1:2 title '" + x + "' with linespoints");

代码示例来源:origin: ujmp/universal-java-matrix-package

writer.write(matrix.getColumnLabel(c));
writer.write("</th>" + EOL);

代码示例来源:origin: ujmp/universal-java-matrix-package

toAppendTo.append("   ");
for (int col = 0; col < columnCount && col < maxColumns; col++) {
  format(m.getColumnLabel(col), toAppendTo, pos);
  if (col < columnCount - 1) {
    toAppendTo.append(' ');

代码示例来源:origin: ujmp/universal-java-matrix-package

allmeans.getColumnCount());
for (int c = 0; c < valueCount.getColumnCount(); c++) {
  int s = extractSize(allmeans.getColumnLabel(c));
  if (allmeans.getLabel().contains("tall")) {
    valueCount.setAsInt(s * s / 2, 0, c);

代码示例来源:origin: ujmp/universal-java-matrix-package

@Test
public void testCols() {
  Matrix m1 = Matrix.Factory.zeros(2, 1);
  m1.setLabel("label");
  m1.setColumnLabel(0, "col1");
  Matrix m2 = m1.appendHorizontally(Ret.NEW, Matrix.Factory.zeros(2, 1));
  m2.setColumnLabel(1, "col2");
  assertEquals("label", m2.getLabelObject());
  assertEquals("col1", m2.getColumnLabel(0));
  assertEquals("col2", m2.getColumnLabel(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

plt.setColumnLabel(0, "matrix size");
for (int c = 1; c < plt.getColumnCount(); c++) {
  plt.setColumnLabel(c, matrix.getColumnLabel(c - 1));

代码示例来源: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();
  }
}

相关文章

Matrix类方法