List of utility methods to do Array Min Value
int | minCeilDiv(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; ... |
int | minDiff(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; |
double | minDist(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)); |
int | minDistance(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; ... |
double | minDouble(double a, double... others) min Double double rv = a; for (double v : others) { rv = Math.min(rv, v); return rv; |
double | minDouble(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; |
int | minDoubleArray(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; |
int | minElement(int[] array) min Element int result = Integer.MAX_VALUE; for (int element : array) result = Math.min(result, element); return result; |
void | minFastSort(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]; ... |
void | minFastSort(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]; ... |