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

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

Description

Replace the contents of a with a[i] - b[i] for all i.

License

Apache License

Parameter

Parameter Description
a a parameter
b a parameter

Declaration

public static final void subtractInPlace(double[] a, double[] b) 

Method Source Code

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

public class Main {
    /**/*from   w ww  .  j  a  v  a  2 s . c  o  m*/
     * Replace the contents of a with
     * a[i] - b[i] for all i.
     * @param a
     * @param b
     */
    public static final void subtractInPlace(double[] a, double[] b) {
        for (int i = 0; i < a.length; i++) {
            a[i] -= b[i];
        }
    }
}

Related

  1. subtract2(double[] v1, double[] v2, double[] res)
  2. subtractArray(double[] array1, double[] array2)
  3. subtractArray(float[] arr1, float[] arr2)
  4. subtractElementwise(int[] a, int[] b)
  5. subtractImages(float[][] top, float[][] base)
  6. subtractInPlace(double[] first, double[] second)
  7. subtractInPlace(final double[] a, final double[] b)
  8. subtractKeepPositiveValues(float[] dividend, float divisor)
  9. subtractMin(Double[] array)