Package org.encog.mathutil.matrices

Examples of org.encog.mathutil.matrices.Matrix


  public static void main(final String args[]) {
    long start, stop;

    start = System.currentTimeMillis();
    final Matrix a = MatrixBenchmark.generateRandomMatrix(500);
    final Matrix b = MatrixBenchmark.generateRandomMatrix(500);
    stop = System.currentTimeMillis();
    System.out.println("Setup matrix: " + ((stop - start)) / 1000.0);

    start = System.currentTimeMillis();
    MatrixMath.multiply(a, b);
View Full Code Here


   *
   * @return U
   */

  public Matrix getU() {
    return new Matrix(U);
  }
View Full Code Here

   *
   * @return V
   */

  public Matrix getV() {
    return new Matrix(V);
  }
View Full Code Here

   *
   * @return S
   */

  public Matrix getS() {
    Matrix X = new Matrix(n, n);
    double[][] S = X.getData();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        S[i][j] = 0.0;
      }
      S[i][i] = this.s[i];
View Full Code Here

   *
   * @return L
   */

  public Matrix getL() {
    Matrix X = new Matrix(m, n);
    double[][] L = X.getData();
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        if (i > j) {
          L[i][j] = LU[i][j];
        } else if (i == j) {
View Full Code Here

   *
   * @return U
   */

  public Matrix getU() {
    Matrix X = new Matrix(n, n);
    double[][] U = X.getData();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i <= j) {
          U[i][j] = LU[i][j];
        } else {
View Full Code Here

      throw new RuntimeException("Matrix is singular.");
    }

    // Copy right hand side with pivoting
    int nx = B.getCols();
    Matrix Xmat = B.getMatrix(piv, 0, nx - 1);
    double[][] X = Xmat.getData();

    // Solve L*Y = B(piv,:)
    for (int k = 0; k < n; k++) {
      for (int i = k + 1; i < n; i++) {
        for (int j = 0; j < nx; j++) {
View Full Code Here

   *
   * @return D
   */

  public Matrix getD() {
    final Matrix X = new Matrix(this.n, this.n);
    final double[][] D = X.getData();
    for (int i = 0; i < this.n; i++) {
      for (int j = 0; j < this.n; j++) {
        D[i][j] = 0.0;
      }
      D[i][i] = this.d[i];
View Full Code Here

   * Return the eigenvector matrix.
   *
   * @return V
   */
  public Matrix getV() {
    return new Matrix(this.v);
  }
View Full Code Here

    double matrixData3[][] = {{47,52,57},
        {64,71,78},
        {81,90,99}
    };
   
    Matrix matrix1 = new Matrix(matrixData1);
    Matrix matrix2 = new Matrix(matrixData2);
   
    Matrix matrix3 = new Matrix(matrixData3);
   
    Matrix result = MatrixMath.multiply(matrix1,matrix2);
   
    TestCase.assertTrue(result.equals(matrix3));
  }
View Full Code Here

TOP

Related Classes of org.encog.mathutil.matrices.Matrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.