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

intminCeilDiv(int c, int... vals)
min Ceil Div
assert (vals.length > 0);
assert (vals[0] != 0);
int res = Integer.MAX_VALUE;
for (int i = 0; i < vals.length; i++) {
    assert (vals[i] != 0);
    int tmp = ceilDiv(c, vals[i]);
    if (tmp < res)
        res = tmp;
...
intminDiff(int... offs)
min Diff
int min = Integer.MAX_VALUE;
for (int o1 : offs) {
    for (int o2 : offs) {
        if (o1 != o2) {
            min = Math.min(min, Math.abs(o1 - o2));
return min;
doubleminDist(double[] q, double[] c, double[][] distMatrix, int orig_n)
Calculate the distance between 2 SAX vectors.
double ret = 0;
for (int i = 0; i < c.length; i++) {
    ret += distMatrix[(int) q[i]][(int) c[i]] * distMatrix[(int) q[i]][(int) c[i]];
return (Math.sqrt(ret) * Math.sqrt((double) orig_n / (double) c.length));
intminDistance(int[][] colors, int len, int[] color)
min Distance
int smallest = 0;
int minDist = 3 * 256;
for (int x = 0; x < len; x++) {
    int dist = Math.abs(color[0] - colors[x][0]) + Math.abs(color[1] - colors[x][1])
            + Math.abs(color[2] - colors[x][2]);
    if (dist < minDist) {
        minDist = dist;
        smallest = x;
...
doubleminDouble(double a, double... others)
min Double
double rv = a;
for (double v : others) {
    rv = Math.min(rv, v);
return rv;
doubleminDouble(double... values)
Return the minimum value from the specified arguments
Double result = null;
for (double d : values) {
    if (result == null || d < result) {
        result = d;
return result;
intminDoubleArray(double[] data)
Get the minimum from a double array.
double minimum = data[0];
int minIndex = 0;
for (int i = 1; i < data.length; i++) {
    if (data[i] < minimum) {
        minimum = data[i];
        minIndex = i;
return minIndex;
intminElement(int[] array)
min Element
int result = Integer.MAX_VALUE;
for (int element : array)
    result = Math.min(result, element);
return result;
voidminFastSort(double x[], int idx[], int n, int m)
min Fast Sort
for (int i = 0; i < m; i++) {
    for (int j = i + 1; j < n; j++) {
        if (x[i] > x[j]) {
            double temp = x[i];
            x[i] = x[j];
            x[j] = temp;
            int id = idx[i];
            idx[i] = idx[j];
...
voidminFastSort(double[] x, int[] idx, int size)
min Fast Sort
for (int i = 0; i < size; i++) {
    for (int j = i + 1; j < size; j++) {
        if (x[i] > x[j]) {
            double temp = x[i];
            int tempIdx = idx[i];
            x[i] = x[j];
            x[j] = temp;
            idx[i] = idx[j];
...