Java Utililty Methods Array Min Value

List of utility methods to do Array Min Value

Description

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

Method

intminInRowIndex(double[][] M, int row)
Returns the row index of the minimal element in the given row of the given matrix.
int idx = -1;
if (M == null)
    return idx;
int m = M.length;
int n = M[0].length;
if ((row < 0) || (row >= m))
    return idx;
idx = 0;
...
intminInt(int... values)
Deprecated - use NumberArray
assert values != null;
int min = Integer.MAX_VALUE;
for (int value : values) {
    if (value < min) {
        min = value;
return min;
...
doubleminkowskiDistance(double[] coord1, double[] coord2)
Calculates the Minkowski distance between two coordinates.
return distanceBase(coord1, coord2, coord1.length);
voidminLengthCheck(final byte[] buffer, final byte length)
min Length Check
if (buffer.length < length) {
    throw new IllegalArgumentException("Input array length must be min " + length + " bytes");
int[]minList(int[] listA, int[] listB)
min List
int maxSize = Math.max(listA.length, listB.length);
int[] minList = new int[maxSize];
for (int i = 0; i < maxSize; i++) {
    int valueA = i < listA.length ? listA[i] : Integer.MAX_VALUE;
    int valueB = i < listB.length ? listB[i] : Integer.MAX_VALUE;
    valueA = valueA >= 0 ? valueA : Integer.MAX_VALUE;
    valueB = valueB >= 0 ? valueB : Integer.MAX_VALUE;
    int minValue = Math.min(valueA, valueB);
...
intminLocation(double[] list)
This method finds the location of the first minimum of list
int location = 0;
for (int i = 1; i < list.length; ++i)
    if (list[i] < list[location])
        location = i;
return location;
double[]minmax(double[] a)
minmax
double[] re = { a[0], a[0] };
for (double i : a) {
    if (i > re[1])
        re[1] = i;
    else if (i < re[0])
        re[0] = i;
return re;
...
float[]minMax(float... values)
min Max
float min = 0;
float max = 0;
for (float value : values) {
    if (value < min)
        min = value;
    else if (value > max)
        max = value;
return new float[] { min, max };
float[]minMax(float[] array)

Find the minimum and maximum values in an array.

float min = Float.MAX_VALUE;
float max = Float.MIN_VALUE;
for (float v : array) {
    if (v < min)
        min = v;
    if (v > max)
        max = v;
float[] returnValues = { min, max };
return returnValues;
int[]minmax(int[] values)
minmax
int min = Integer.MAX_VALUE;
int max = Integer.MIN_VALUE;
for (int value : values) {
    if (value < min) {
        min = value;
    if (value > max) {
        max = value;
...