List of utility methods to do Array Sum
double | sum(final double[] a) sum double sum = 0.0; for (double d : a) sum += d; return sum; |
double | sum(final double[] arr) Returns the sum of the elements in the array. double result = 0; for (final double next : arr) result += next; return result; |
double | sum(final double[] array) sum double count = 0; for (int j = 0; j < array.length; j++) { count += array[j]; return count; |
int | sum(final double[] decay, final int factor) Sums up the decay photons at a pixel. long returnValue = 0; for (final double d : decay) { returnValue += (d / factor); if (returnValue > Integer.MAX_VALUE) { returnValue = Integer.MAX_VALUE; return (int) returnValue; ... |
Double | sum(final Double[] doubles) Get the sum of an array of doubles. Double sum = 0.0; for (int j = 0; j < doubles.length; j++) { sum += doubles[j]; return sum; |
double | sum(final double[] productMix) sum if (productMix == null || productMix.length == 0) throw new IllegalArgumentException(Arrays.toString(productMix)); double res = productMix[0]; for (int i = 1; i < productMix.length; i++) { res += productMix[i]; return res; |
double | sum(final double[] target) Returns the sum of target. return sum(target, 0, target.length);
|
double | sum(final double[] vec) Computes the sum of the elements of a vector. assert vec != null; double s = 0; for (double i : vec) { s += i; return s; |
float | sum(final float[] x) sum if (x == null) { throw new RuntimeException("diff function encountered null input"); float s = 0f; for (int i = 0; i < x.length; ++i) s += x[i]; return s; |
int | sum(final int base, final int[] ints) sum return sum(base, toIntegerCollection(ints));
|