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[] array)
Double.NaN is ignored.
double max = Double.NaN;
int n = -1;
for (int i = 0; i < array.length; i++) {
    if (!Double.isNaN(array[i])) {
        max = array[i];
        n = i;
        break;
if (n == -1) {
    return Double.NaN;
for (int i = n + 1; i < array.length; i++) {
    if (max < array[i]) {
        max = array[i];
return max;
doublemax(double[] array)
max
return maxStartFromIndex(array, 0);
doublemax(double[] array)
Returns the maximum value in array
double max = Double.MIN_VALUE;
for (int i = 0; i < array.length; i++)
    if (array[i] > max)
        max = array[i];
return max;
doublemax(double[] array)
Returns the maximum value in an array of doubles.
double max = Double.NEGATIVE_INFINITY;
for (int i = 0; i < array.length; i++) {
    if (array[i] > max) {
        max = array[i];
return max;
doublemax(double[] array)

Returns the maximum value in an array.

if (array == null) {
    throw new IllegalArgumentException("The Array must not be null");
} else if (array.length == 0) {
    throw new IllegalArgumentException("Array cannot be empty.");
double max = array[0];
for (int j = 1; j < array.length; j++) {
    max = max(array[j], max);
...
doublemax(double[] array)
Computes the max of the given array.
if (array.length == 0)
    return Double.NEGATIVE_INFINITY;
double re = array[0];
for (int i = 1; i < array.length; i++)
    re = Math.max(re, array[i]);
return re;
doublemax(double[] data)
max
double m = Double.NEGATIVE_INFINITY;
for (int i = 0; i < data.length; i++)
    if (data[i] > m)
        m = data[i];
return m;
doublemax(double[] data)
Find the maximum of all elements in the array, ignoring elements that are NaN.
double max = Double.NaN;
for (int i = 0; i < data.length; i++) {
    if (Double.isNaN(data[i]))
        continue;
    if (Double.isNaN(max) || data[i] > max)
        max = data[i];
return max;
...
doublemax(double[] list)
max
double m = Double.NEGATIVE_INFINITY;
for (double x : list)
    m = Math.max(m, x);
return m;
doublemax(double[] matrix)
Compute the maximum value of a 1d array.
double max = matrix[0];
for (int i = 0; i < matrix.length; i++) {
    if (max < matrix[i]) {
        max = matrix[i];
return max;