/** * Calculate the sum of the squared values of a 2D array. * * @param arr * @return sum of squares */ public static double sumSq(double[][] arr) { double sum = 0; for (int i = 0; i < arr.length; i++) sum += sumSq(arr[i]); return sum; }
/** * Calculate the sum of the squared values of a 2D array. * * @param arr * @return sum of squares */ public static double sumSq(double[][] arr) { double sum = 0; for (int i = 0; i < arr.length; i++) sum += sumSq(arr[i]); return sum; }