Here you can find the source of subtract(double[] a, double[] b)
Parameter | Description |
---|---|
a | - the first vector of doubles. |
b | - the second vector of doubles. |
public static double[] subtract(double[] a, double[] b)
//package com.java2s; public class Main { /**//from w w w.j a va 2 s . c o m * Returns the array-wise difference between two vectors. * @param a - the first vector of doubles. * @param b - the second vector of doubles. * @return the result of subtracting the first vector of doubles from the second. */ public static double[] subtract(double[] a, double[] b) { double[] out = new double[a.length]; for (int i = 0; i < a.length; i++) { out[i] = a[i] - b[i]; } return out; } }