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

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

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

Matrix.allCoordinates介绍

暂无

代码示例

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

public Map<String, Object> calculateObjects(Map<String, Object> input) {
  Map<String, Object> result = new HashMap<String, Object>();
  Matrix in = Matrix.Factory.copyFromMatrix(MathUtil.getMatrix(input.get(SOURCE)));
  for (long[] c : in.allCoordinates()) {
    in.setAsDouble(getProbability(in.getAsDouble(c)), c);
  }
  result.put(TARGET, in);
  return result;
}

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

public DefaultDenseObjectMatrixMultiD(Matrix m) {
  super(m.getSize());
  this.size = Coordinates.copyOf(m.getSize());
  this.length = (int) Coordinates.product(size);
  this.values = new Object[length];
  if (m instanceof DefaultDenseObjectMatrixMultiD) {
    Object[] v = ((DefaultDenseObjectMatrixMultiD) m).values;
    System.arraycopy(v, 0, this.values, 0, v.length);
  } else {
    for (long[] c : m.allCoordinates()) {
      setObject(m.getAsObject(c), c);
    }
  }
}

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

public VolatileSparseObjectMatrix(Matrix m) {
  super(m.getSize());
  this.size = Coordinates.copyOf(m.getSize());
  for (long[] c : m.allCoordinates()) {
    setAsDouble(m.getAsDouble(c), c);
  }
}

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

public AbstractMapToSparseMatrixWrapper(Map<Coordinates, Object> map, Matrix m) {
  super(m.getSize());
  this.size = Coordinates.copyOf(m.getSize());
  this.values = map;
  for (long[] c : m.allCoordinates()) {
    setObject(m.getAsObject(c), c);
  }
}

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

public DenseFileMatrix(Matrix m) throws IOException {
  this(m.getSize());
  for (long[] c : m.allCoordinates()) {
    setAsDouble(m.getAsDouble(c), c);
  }
  MapMatrix<String, Object> a = m.getMetaData();
  if (a != null) {
    setMetaData(a.clone());
  }
}

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

public DefaultDenseGenericMatrix2D(Matrix m) {
  super(m.getRowCount(), m.getColumnCount());
  values = new Object[(int) m.getRowCount()][(int) m.getColumnCount()];
  for (long[] c : m.allCoordinates()) {
    setAsObject(m.getAsObject(c), c);
  }
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsChar(getChar(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsObject(getObject(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsByte(getByte(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsShort(getShort(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsBigDecimal(getBigDecimal(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsString(getString(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsBigInteger(getBigInteger(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  final Matrix matrix = getSource();
  for (final long[] c : getSource().allCoordinates()) {
    matrix.setAsDouble(getDouble(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsInt(getInt(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsBoolean(getBoolean(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsFloat(getFloat(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcOrig() {
  if (!Coordinates.equals(getSource().getSize(), getSize())) {
    throw new RuntimeException(
        "Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
  }
  for (long[] c : getSource().allCoordinates()) {
    getSource().setAsLong(getLong(c), c);
  }
  getSource().fireValueChanged();
  return getSource();
}

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

public final Matrix calcNew() {
  // Matrix result = MatrixFactory.zeros(getSource().getValueType(),
  // getSize());
  Matrix result = Matrix.Factory.zeros(getValueType(), getSize());
  for (long[] c : result.allCoordinates()) {
    result.setAsObject(getObject(c), c);
  }
  if (getMetaData() != null) {
    result.setMetaData(getMetaData().clone());
  }
  return result;
}

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

public Matrix calcNew() {
  Matrix result = DoubleMatrix2D.Factory.zeros(getSize()[ROW], getSize()[COLUMN]);
  for (long[] c : result.allCoordinates()) {
    result.setAsDouble(getDouble(c), c);
  }
  if (getMetaData() != null) {
    result.setMetaData(getMetaData().clone());
  }
  return result;
}

相关文章

Matrix类方法