Java Utililty Methods Array Max Value

List of utility methods to do Array Max Value

Description

The list of methods to do Array Max Value are organized into topic(s).

Method

doublemax(double[] series)
Finds the maximal value in timeseries.
if (countNaN(series) == series.length) {
    return Double.NaN;
double max = Double.MIN_VALUE;
for (int i = 0; i < series.length; i++) {
    if (max < series[i]) {
        max = series[i];
return max;
doublemax(double[] vals)
max
if (vals.length == 0) {
    return Double.NaN;
double[] range = range(vals);
return range[1];
doublemax(double[] values)
Calculates the maximum over an given array of doubles.
try {
    double max = values[0];
    for (double v : values) {
        if (v > max)
            max = v;
    return max;
} catch (ArrayIndexOutOfBoundsException e) {
...
intmax(double[] values)
Find the maximum value in an array of double values.
int maxIdx = -1;
for (int i = 0; i < values.length; i++) {
    if ((maxIdx == -1) || (values[i] > values[maxIdx])) {
        maxIdx = i;
return maxIdx;
doublemax(double[] values)
max
Arrays.sort(values);
return maxOfSortedValues(values);
doublemax(double[] x)
Returns the highest element of `x`, NaN values are ignored.
return max(x, true);
doublemax(final double aval, double[] b, final int bi, final int len)
max
double ret = aval;
for (int i = bi; i < bi + len; i++)
    ret = Math.max(ret, b[i]);
return ret;
doublemax(final double... doubles)
Maximum of several double
double max = doubles[0];
for (final double real : doubles) {
    max = real > max ? real : max;
return max;
doublemax(final double[] array)
max
double d = Double.MIN_VALUE;
for (int i = 0; i < array.length; i++) {
    d = Math.max(array[i], d);
return d;
doubleMax(final double[] input)
Max
if (input == null || input.length < 1) {
    return 0;
double output = input[0];
for (int i = 1; i < input.length; i++) {
    if (input[i] > output) {
        output = input[i];
return output;