List of utility methods to do Array Max Value
double | arrayMax(double[] arr) A method to find max element in an array of doubles. double max = Double.NEGATIVE_INFINITY; for (double cur : arr) max = Math.max(max, cur); return max; |
double | arrayMax(double[] x) array Max if (x.length == 0) { throw new IllegalArgumentException(); double result = x[0]; for (int i = 1; i < x.length; i++) { if (result < x[i]) { result = x[i]; return result; |
int | arrayMax(final int[] array) array Max return array[maxElementIndex(array)];
|
int | arrayMax(int[] property) array Max int[] copy = property.clone(); int max = 0; int numElements = copy.length; Arrays.sort(copy); if (numElements > 0) max = copy[numElements - 1]; return max; |
int | arrayMaximum(int[] array) array Maximum if ((array == null) || (array.length == 0)) { throw new NoSuchElementException(); int q = array[0]; for (int i = 1; i < array.length; i++) { if (array[i] > q) { q = array[i]; return q; |
double | findMax(double newNumber, double currentMax) Return the max between 2 numbers. return Double.isNaN(currentMax) ? newNumber : currentMax > newNumber ? currentMax : newNumber;
|
double | findMax(double[] arr) find Max double max = arr[0]; for (int i = 0; i < arr.length; i++) { if (max < arr[i]) { max = arr[i]; return max; |
double | findMax(double[] u, int startU, int length) find Max double max = -1; int index = startU; int stopIndex = startU + length; for (; index < stopIndex; index++) { double val = u[index]; val = (val < 0.0D) ? -val : val; if (val > max) max = val; ... |
double | findMax(double[] u, int startU, int length) Returns the maximum magnitude of the complex numbers double max = -1; int index = startU * 2; int stopIndex = (startU + length) * 2; for (; index < stopIndex;) { double real = u[index++]; double img = u[index++]; double val = real * real + img * img; if (val > max) { ... |
int | findMax(double[] values) Return the index of the maximum value found in the array. int maxIdx = 0; for (int i = 0; i < values.length; ++i) { if (values[i] > values[maxIdx]) { maxIdx = i; return maxIdx; |