Here you can find the source of absDiff(Double[] a, Double[] b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static Double[] absDiff(Double[] a, Double[] b)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a v a 2 s. com*/ * Compute the element-wise absolute difference between two arrays of the * same length. * @param a * @param b * @return a new array with the element-wise difference of a and b */ public static Double[] absDiff(Double[] a, Double[] b) { Double[] result = new Double[a.length]; for (int i = 0; i < a.length; i++) { result[i] = Math.abs(a[i] - b[i]); } ; return result; } }