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

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

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

Matrix.eye介绍

暂无

代码示例

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

public final T eye(final long rows, final long cols) {
  final T m = zeros(rows, cols);
  m.eye(Ret.ORIG);
  return m;
}

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

public final T eye(final long... size) {
  final T m = zeros(size);
  m.eye(Ret.ORIG);
  return m;
}

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

public Object call() {
    MatrixGUIObject m = getMatrixObject();
    m.getMatrix().eye(getRet());
    return m;
  }
}

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

public Matrix[] lu() {
  if (matrix instanceof DoubleSquareMatrix) {
    AbstractDoubleSquareMatrix[] lu = ((DoubleSquareMatrix) matrix).luDecompose();
    Matrix l = new JSciDenseDoubleMatrix2D(lu[0]);
    Matrix u = new JSciDenseDoubleMatrix2D(lu[1]);
    Matrix p = new JSciDenseDoubleMatrix2D(MathUtil.longToInt(getRowCount()), MathUtil.longToInt(getRowCount()));
    p.eye(Ret.ORIG);
    return new Matrix[] { l, u, p };
  } else {
    throw new RuntimeException("only allowed for square matrices");
  }
}

代码示例来源:origin: org.ujmp/ujmp-mtj

public Matrix[] lu() {
  try {
    DenseLU lu = DenseLU.factorize(getWrappedObject());
    Matrix l = new MTJDenseDoubleMatrix2D(lu.getL());
    Matrix u = new MTJDenseDoubleMatrix2D(lu.getU());
    int m = (int) getRowCount();
    int[] piv = lu.getPivots();
    Matrix p = new MTJDenseDoubleMatrix2D(m, m);
    // pivots seem to be broken
    // http://code.google.com/p/matrix-toolkits-java/issues/detail?id=1
    for (int i = 0; i < m; i++) {
      p.setAsDouble(1, i, piv[i]);
    }
    p.eye(Ret.ORIG);
    return new Matrix[] { l, u, p };
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

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

public Matrix[] lu() {
  try {
    DenseLU lu = DenseLU.factorize(getWrappedObject());
    Matrix l = new MTJDenseDoubleMatrix2D(lu.getL());
    Matrix u = new MTJDenseDoubleMatrix2D(lu.getU());
    int m = (int) getRowCount();
    int[] piv = lu.getPivots();
    Matrix p = new MTJDenseDoubleMatrix2D(m, m);
    // pivots seem to be broken
    // http://code.google.com/p/matrix-toolkits-java/issues/detail?id=1
    for (int i = 0; i < m; i++) {
      p.setAsDouble(1, i, piv[i]);
    }
    p.eye(Ret.ORIG);
    return new Matrix[] { l, u, p };
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

相关文章

Matrix类方法