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

doublemean(int[] values, int max)
mean
int j;
double m;
m = 0.;
for (j = 0; j < max; j++) {
    m += (double) values[j];
m = m / (double) max;
return m;
...
Doublemean(Integer[] values)
mean
if (values == null || values.length <= 0) {
    return null;
double sum = 0.0;
double numIntegers = 0;
for (Integer i : values) {
    if (i == null) {
        continue;
...
doublemean(List a)
mean
double sum = sum(a);
double mean = 0;
mean = sum / (a.size() * 1.0);
return mean;
doublemean(List values)
mean
double sum = 0;
for (Double value : values)
    sum += value;
return sum / (double) values.size();
longmean(long[] values)
mean
long sum = 0l;
for (long v : values) {
    sum += v;
return sum / values.length;
doublemean(Number[] array)
Returns the mean of the given array.
double result;
int i;
if (array.length == 0)
    return Double.NaN;
result = 0;
for (i = 0; i < array.length; i++)
    result += array[i].doubleValue();
result /= array.length;
...
doubleMean(Object in)
Mean
return ((double) Sum(in) / (double) NElem(in));
doublemean_Integer(List values)
Computes average of the elements of the vector.
return mean(toIntegerArray(values));
doublemeanAbortedExecutionTime(double totalExecutionTime, int totalOps, double granuleAbortProb)
mean Aborted Execution Time
double meanExec = 0D;
for (int i = 1; i <= totalOps; i++) {
    meanExec += binomialProbIthTrial(granuleAbortProb, i)
            * executionTillIthOperation(totalExecutionTime, totalOps, i);
return meanExec;
double[]meanAndStandardDeviation(final double[] inp, final int startIndex, final int pastEnd)
Calculates the mean and standard deviation of an array of double
if (startIndex < 0)
    throw new IllegalArgumentException("startIndex must be >= 0");
if (pastEnd > inp.length)
    throw new IllegalArgumentException("pastEnd must be <= inp.length");
if (startIndex >= pastEnd)
    throw new IllegalArgumentException("pastEnd must be > startIndex");
double sum_y = 0.0;
double sum_ymean = 0.0;
...