Java Matrix Multiply multiply(double[][] dest, double[][] a, double[][] b)

Here you can find the source of multiply(double[][] dest, double[][] a, double[][] b)

Description

multiply

License

Open Source License

Declaration

public static void multiply(double[][] dest, double[][] a, double[][] b) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU General Public License as published by

public class Main {
    public static void multiply(double[][] dest, double[][] a, double[][] b) {
        for (int i = 0; i < dest.length; i++) {
            for (int j = 0; j < dest[i].length; j++) {
                dest[i][j] = a[i][j] * b[i][j];
            }/* www.j a  v  a  2s.c  o m*/
        }
    }

    public static void multiply(double[][] dest, double[][] a, double b) {
        for (int i = 0; i < dest.length; i++) {
            for (int j = 0; j < dest[i].length; j++) {
                dest[i][j] = a[i][j] * b;
            }
        }
    }

    public static void multiply(double[][] dest, double[] a, double b) {
        for (int i = 0; i < dest.length; i++) {
            for (int j = 0; j < dest[i].length; j++) {
                dest[i][j] = a[i * dest.length + j] * b;
            }
        }
    }
}

Related

  1. matrixScalarMultiplication(double[][] w, double v)
  2. multiply(boolean[][] m1, boolean[][] m2)
  3. multiply(boolean[][] matrix, boolean[] vector)
  4. multiply(double[][] a, double[][] b)
  5. multiply(double[][] a, double[][] x)
  6. multiply(double[][] m, double[] x)
  7. multiply(double[][] m1, double[][] m2)
  8. multiply(double[][] p, double[][] q)
  9. multiply(double[][] x, double[][] y)