コード例 #1
0
 /**
  * Divides two matrices, this process is component by component. The result of the operation is
  * stored in the first matrix.
  *
  * @param x The first matrix
  * @param y The second matrix
  */
 public double[][] fastMinus(double[][] x, double[][] y) {
   int n = DoubleMatrixUtil.rows(y);
   int m = DoubleMatrixUtil.columns(y);
   for (int i = 0; i < n; i++) {
     for (int j = 0; j < m; j++) {
       x[i][j] /= y[i][j];
     }
   }
   return x;
 }
コード例 #2
0
 public double[][] fastInverse(double[][] x) {
   int n = DoubleMatrixUtil.rows(x);
   int m = DoubleMatrixUtil.columns(x);
   for (int i = 0; i < n; i++) {
     for (int j = 0; j < n; j++) {
       x[i][j] = 1.0 / x[i][j];
     }
   }
   return x;
 }
コード例 #3
0
 public double[][] inverse(double[][] x) {
   int n = DoubleMatrixUtil.rows(x);
   int m = DoubleMatrixUtil.columns(x);
   double[][] y = new double[n][m];
   for (int i = 0; i < n; i++) {
     for (int j = 0; j < n; j++) {
       y[i][j] = 1.0 / x[i][j];
     }
   }
   return y;
 }