Package org.jblas

Examples of org.jblas.DoubleMatrix$ElementsAsListView


    }
    return total;
  }

  private static DoubleMatrix randmatmul_JBLAS(int i) {
    DoubleMatrix a = DoubleMatrix.randn(i,i);
    DoubleMatrix b = DoubleMatrix.randn(i,i);
    return a.mmul(b);
  }
View Full Code Here


    return a.mmul(b);
  }

  private static double[] randmatstat_JBLAS(int t) {
      int n=5;
      DoubleMatrix p;
      DoubleMatrix q;
      DoubleMatrix v = new DoubleMatrix(new double[t][1]); //zeros(t,1);
      DoubleMatrix w = new DoubleMatrix(new double[t][1]); //zeros(t,1);
      for (int i=0; i < t; i++) {
        DoubleMatrix a = DoubleMatrix.randn(n,n);
        DoubleMatrix b = DoubleMatrix.randn(n,n);
        DoubleMatrix c = DoubleMatrix.randn(n,n);
        DoubleMatrix d = DoubleMatrix.randn(n,n);

        p = DoubleMatrix.concatHorizontally(DoubleMatrix.concatHorizontally(a, b),DoubleMatrix.concatHorizontally(c, d));
        q = DoubleMatrix.concatVertically(DoubleMatrix.concatHorizontally(a, b),DoubleMatrix.concatHorizontally(c, d));

        DoubleMatrix x = p.transpose().mmul(p);
        x = x.mmul(x);
        x = x.mmul(x);
        v.data[i]=x.diag().sum();

        x = q.transpose().mmul(q);
        x = x.mmul(x);
        x = x.mmul(x);
        w.data[i]=x.diag().sum();

      }

      List<Double> vElements = v.elementsAsList();
      List<Double> wElements = w.elementsAsList();
View Full Code Here

TOP

Related Classes of org.jblas.DoubleMatrix$ElementsAsListView

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.