Java Array Subtract subtract(final double[] vector1, final double[] vector2)

Here you can find the source of subtract(final double[] vector1, final double[] vector2)

Description

subtract

License

Apache License

Declaration

public static double[] subtract(final double[] vector1, final double[] vector2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double[] subtract(final double[] vector1, final double[] vector2) {
        assert (vector1.length == vector2.length);
        final double[] result = new double[vector1.length];
        for (int i = 0; i < vector1.length; i++) {
            result[i] = vector1[i] - vector2[i];
        }/*from   ww w  .j a  v  a 2  s .  c  om*/
        return result;
    }
}

Related

  1. subtract(double[][] a, double[][] b)
  2. subtract(double[][] dest, double[][] a, double[][] b)
  3. subtract(final double[] a, final double[] b, final double[] c)
  4. subtract(final double[] first, final double[] second)
  5. subtract(final double[] v1, final double[] v2)
  6. subtract(float a[][][], float b[][][])
  7. subtract(float[] dividend, float[] divisor)
  8. subtract(int a, int[] b)
  9. subtract(int bytesPerDim, int dim, byte[] a, byte[] b, byte[] result)