Java Utililty Methods mean

List of utility methods to do mean

Description

The list of methods to do mean are organized into topic(s).

Method

floatmean(float[] a, int off, int length)
mean
return sum(a, off, length) / length;
floatmean(float[] arr)
Find the mean of a single dimensional float array.
if (arr.length == 0) {
    return 0;
int count = 1;
float mean = arr[0];
for (int i = 1; i < arr.length; i++) {
    count++;
    mean = mean + (arr[i] - mean) / count;
...
floatmean(float[] array)
mean
return (float) mean(toDouble(array));
floatmean(float[] xs)
mean
if (xs == null || xs.length == 0)
    throw new IllegalArgumentException("Input to mean() is an empty array");
float sum = 0.0f;
for (int i = 0; i < xs.length; ++i)
    sum += xs[i];
return sum / (float) xs.length;
intmean(int low, int high)
Mean of two values.
return low + ((high - low) / 2);
voidmean(int N, int D, double dat[][], double mu[])
mean
for (int j = D - 1; j >= 0; j--)
    mu[j] = 0.0D;
for (int n = N - 1; n >= 0; n--) {
    for (int j = D - 1; j >= 0; j--)
        mu[j] += dat[n][j];
for (int j = D - 1; j >= 0; j--)
    mu[j] /= N;
...
doublemean(int... values)
mean
return sum(values) / values.length;
doublemean(int[] array)
Computes the mean value of an array of integers.
double sum = 0;
for (int i = 0; i < array.length; i++) {
    sum += array[i];
double mean = sum / array.length;
return mean;
doublemean(int[] input)
mean
return sum(input) / (double) input.length;
intmean(int[] values)
Returns the average of the values.
int result = 0;
for (int value : values) {
    result += value;
result /= values.length;
return result;