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

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

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

Matrix.subMatrix介绍

暂无

代码示例

代码示例来源:origin: jdmp/java-data-mining-package

public Map<String, Object> calculateObjects(Map<String, Object> input) {
  Map<String, Object> result = new HashMap<String, Object>();
  Matrix weight = MathUtil.getMatrix(input.get(SOURCE1));
  Matrix contactdeviation = MathUtil.getMatrix(input.get(SOURCE2));
  Matrix transposedWeight = weight.transpose();
  Matrix target = transposedWeight.mtimes(contactdeviation);
  // ignore bias
  switch (biasType) {
  case SINGLE:
    target = target.subMatrix(Ret.NEW, 0, 0, target.getRowCount() - 2, 0);
    break;
  case MULTIPLE:
    target = target.subMatrix(Ret.NEW, 0, 0, target.getRowCount() / 2 - 1, 0);
    break;
  case NONE:
    break;
  }
  result.put(TARGET, target);
  return result;
}

代码示例来源:origin: davidandrzej/LogicLDA

(matbeta.subMatrix(Ret.LINK,j,0,j,W-1)).getValueSum();

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

public MatrixPopupMenu(JComponent c, MatrixGUIObject matrix, long row, long column) {
    JLabel label = new JLabel();
    label.setForeground(new Color(0, 0, 255));
    List<JComponent> actions = null;

    if (matrix.getRowSelectionModel().isSelectedIndex((int) row)
        && matrix.getColumnSelectionModel().isSelectedIndex((int) column)) {
      int startX = matrix.getColumnSelectionModel().getMinSelectionIndex();
      int endX = matrix.getColumnSelectionModel().getMaxSelectionIndex();
      int startY = matrix.getRowSelectionModel().getMinSelectionIndex();
      int endY = matrix.getRowSelectionModel().getMaxSelectionIndex();
      Matrix subMatrix = matrix.getMatrix().subMatrix(Ret.LINK, startY, startX, endY, endX);
      actions = new MatrixActions(c, (MatrixGUIObject) subMatrix.getGUIObject(), null);
      label.setText(" Selection " + Coordinates.toString(subMatrix.getSize()).replaceAll(",", "x"));
    } else {
      actions = new MatrixActions(c, matrix, null);
      label.setText(" Matrix " + Coordinates.toString("[", "x", "]", matrix.getMatrix().getSize()) + "]");
    }

    add(label);
    add(new JSeparator());

    for (JComponent jc : actions) {
      add(jc);
    }
  }
}

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

public MatrixGUIObject getMatrixObject() {
  MatrixGUIObject m = (MatrixGUIObject) getGUIObject();
  if (m != null) {
    int startRow = m.getRowSelectionModel().getMinSelectionIndex();
    int endRow = m.getRowSelectionModel().getMaxSelectionIndex();
    int startColumn = m.getColumnSelectionModel().getMinSelectionIndex();
    int endColumn = m.getColumnSelectionModel().getMaxSelectionIndex();
    if (startRow != -1 && startColumn != -1) {
      m = (MatrixGUIObject) m.getMatrix().subMatrix(Ret.LINK, startRow, startColumn, endRow, endColumn)
          .getGUIObject();
    }
    return m;
  } else {
    // int min = variable.getRowSelectionModel().getMinSelectionIndex();
    // int max = variable.getRowSelectionModel().getMaxSelectionIndex();
    // Matrix all = new MatrixListToMatrixWrapper(variable);
    //
    // if (min >= 0 && max >= 0) {
    // Matrix selection = all.subMatrix(Ret.LINK, min, 0, max,
    // all.getColumnCount() - 1);
    // return (MatrixGUIObject) selection.getGUIObject();
    // } else {
    // return (MatrixGUIObject) all.getGUIObject();
    // }
  }
  return null;
}

相关文章

Matrix类方法