Java Array Subtract subtract(double[][] a, double[][] b)

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

Description

subtract

License

Open Source License

Declaration

public static double[][] subtract(double[][] a, double[][] b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double[][] subtract(double[][] a, double[][] b) {
        double[][] d = new double[a.length][a[0].length];
        if (isIdenticalMatrix(a, b)) {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    d[i][j] = a[i][j] - b[i][j];
                }/* w  ww.  java 2s. com*/
            }
        } else {

        }
        return d;
    }

    private static boolean isIdenticalMatrix(double[][] a, double[][] b) {
        if (a.length == b.length && a[0].length == b[0].length) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. subtract(double[] p1, double[] p2)
  2. subtract(double[] res, double[] subtractor)
  3. subtract(double[] values, double value)
  4. subtract(double[] x, double c)
  5. subtract(double[][] a, double[][] b)
  6. subtract(double[][] dest, double[][] a, double[][] b)
  7. subtract(final double[] a, final double[] b, final double[] c)
  8. subtract(final double[] first, final double[] second)
  9. subtract(final double[] v1, final double[] v2)