Java Utililty Methods Array Normalize

List of utility methods to do Array Normalize

Description

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

Method

doublenormalCentralMoment(boolean[][] img, int p, int q)
Computes the (normal) central moment.
double result;
double m00 = moment(img, 0, 0);
double norm = Math.pow(m00, (double) (p + q + 2) / 2);
result = centralMoment(img, p, q) / norm;
return result;
doublenormalDist(double[] features, double[] avg, double[][] cov)
normal Dist
return 0;
int[]normalForm(int[] a)
normal Form
int d = computeDegree(a);
if (d == -1) {
    return new int[1];
if (a.length == d + 1) {
    return Arrays.copyOf(a, a.length);
int[] result = new int[d + 1];
...
intnormalHashCode(char[] val)
Private method that calculates the hash code for the char[] val according to the java spec.
int h = 0;
int off = 0;
int len = val.length;
if (len < 16) {
    for (int i = len; i > 0; i--) {
        h = (h * 37) + val[off++];
} else {
...
double[]normalise(double[] a)
normalise
double lengthInv = 1.0 / length(a);
for (int i = 0; i < a.length; i++)
    a[i] *= lengthInv;
return a;
voidnormalise(double[] A)
Scale array values into a 8bit (between 0 and 255).
int L = A.length;
double N = sum(abs2(A, 0));
for (int i = 0; i < L; i++) {
    A[i] = A[i] / N;
voidnormalise(float[] array)
Normalise length of array to 1.0.
float sumsq = 0.0f;
for (int i = 0; i < array.length; i++)
    sumsq += array[i] * array[i];
float weight = 1.0f / (float) Math.sqrt(sumsq);
for (int i = 0; i < array.length; i++)
    array[i] *= weight;
voidnormaliseActions(double[] actions)
normalise Actions
double sum = 0.0;
for (int j = 0; j < actions.length; j++) {
    sum += actions[j];
for (int j = 0; j < actions.length; j++) {
    actions[j] = actions[j] / sum;
voidnormaliseFloats(final float[] table, final int position, final int length)
normalise Floats
int n;
float absMax = 0.f;
for (n = 0; n < length; n++) {
    final float curVal = table[position + n];
    final float curAbs = (curVal < 0.0f ? -curVal : curVal);
    absMax = curAbs > absMax ? curAbs : absMax;
for (n = 0; n < length; n++) {
...
voidnormaliseHeaders(String[] headers)
normalise Headers
for (int i = 0; i < headers.length; i++) {
    headers[i] = headers[i].toLowerCase();