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

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

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

Matrix.clear介绍

暂无

代码示例

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

public final void clear() {
    matrix.clear();
  }
}

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

public final void clear() {
  matrix.clear();
}

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

public final void clear() {
  original.clear();
  inputBuffer.clear();
}

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

public final void clear() {
  matrix.clear();
}

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

public void reset() {
  randomVectors.clear();
}

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

public final synchronized void clear() {
  matrix.clear();
  fireValueChanged();
}

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

public Object call() {
  getMatrixObject().getMatrix().clear();
  return getMatrixObject();
}

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

public Object call() {
    MatrixGUIObject m = getMatrixObject();
    try {
      m.getMatrix().exportTo().clipboard().asDenseCSV();
      m.getMatrix().clear();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
}

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

public final void calc(final SparseMatrix source1, final Matrix source2, final Matrix target) {
    VerifyUtil.verify2D(source1);
    VerifyUtil.verify2D(source2);
    VerifyUtil.verify2D(target);
    VerifyUtil.verifyEquals(source1.getColumnCount(), source2.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getRowCount(), source1.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getColumnCount(), source2.getColumnCount(),
        "matrices have wrong sizes");
    target.clear();
    for (long[] c1 : source1.availableCoordinates()) {
      final double v1 = source1.getAsDouble(c1);
      if (v1 != 0.0d) {
        for (long col2 = source2.getColumnCount(); --col2 != -1;) {
          final double v2 = source2.getAsDouble(c1[1], col2);
          final double temp = v1 * v2;
          if (temp != 0.0d) {
            final double v3 = target.getAsDouble(c1[0], col2);
            target.setAsDouble(v3 + temp, c1[0], col2);
          }
        }
      }
    }
  }
};

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

public final void calc(final Matrix source1, final SparseMatrix source2, final Matrix target) {
    VerifyUtil.verify2D(source1);
    VerifyUtil.verify2D(source2);
    VerifyUtil.verify2D(target);
    VerifyUtil.verifyEquals(source1.getColumnCount(), source2.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getRowCount(), source1.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getColumnCount(), source2.getColumnCount(),
        "matrices have wrong sizes");
    target.clear();
    for (long[] c2 : source2.availableCoordinates()) {
      final double v2 = source2.getAsDouble(c2);
      if (v2 != 0.0d) {
        for (long row1 = source1.getRowCount(); --row1 != -1;) {
          final double v1 = source1.getAsDouble(row1, c2[0]);
          final double temp = v1 * v2;
          if (temp != 0.0d) {
            final double v3 = target.getAsDouble(row1, c2[1]);
            target.setAsDouble(v3 + temp, row1, c2[1]);
          }
        }
      }
    }
  }
};

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

public final void calc(final SparseMatrix source1, final SparseMatrix source2,
      final Matrix target) {
    VerifyUtil.verify2D(source1);
    VerifyUtil.verify2D(source2);
    VerifyUtil.verify2D(target);
    VerifyUtil.verifyEquals(source1.getColumnCount(), source2.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getRowCount(), source1.getRowCount(),
        "matrices have wrong sizes");
    VerifyUtil.verifyEquals(target.getColumnCount(), source2.getColumnCount(),
        "matrices have wrong sizes");
    target.clear();
    for (long[] c1 : source1.availableCoordinates()) {
      final double v1 = source1.getAsDouble(c1);
      if (v1 != 0.0) {
        for (long[] c2 : source2.availableCoordinates()) {
          if (c2[0] == c1[1]) {
            final double v2 = source2.getAsDouble(c2);
            if (v1 != 0.0) {
              final double temp = v1 * v2;
              final double v3 = target.getAsDouble(c1[0], c2[1]);
              target.setAsDouble(v3 + temp, c1[0], c2[1]);
            }
          }
        }
      }
    }
  }
};

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

@Test
public final void testClear() throws Exception {
  Matrix m = createMatrix(3, 2);
  m.randn(Ret.ORIG);
  m.clear();
  assertEquals(0.0, m.getAsDouble(0, 0), TOLERANCE);
  assertEquals(0.0, m.getAsDouble(1, 0), TOLERANCE);
  assertEquals(0.0, m.getAsDouble(2, 0), TOLERANCE);
  assertEquals(0.0, m.getAsDouble(0, 1), TOLERANCE);
  assertEquals(0.0, m.getAsDouble(1, 1), TOLERANCE);
  assertEquals(0.0, m.getAsDouble(2, 1), TOLERANCE);
}

相关文章

Matrix类方法