Java Array Normalize normalizeVectorMax(double[] input)

Here you can find the source of normalizeVectorMax(double[] input)

Description

normalize Vector Max

License

Open Source License

Declaration

public static void normalizeVectorMax(double[] input) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void normalizeVectorMax(double[] input) {
        double max = getMax(input);
        int index = 0;
        while (index < input.length) {
            input[index] = input[index] / max;
            index++;//from w  ww. ja  v  a2  s .  c o m
        }
    }

    public static double getMax(double[] input) {
        double output = 0;
        for (int i = 0; i < input.length; i++) {
            if (input[i] > output) {
                output = input[i];
            }
        }
        return output;
    }
}

Related

  1. NormalizeVec2D(double[] vec)
  2. normalizeVector(double[] input)
  3. normalizeVector(Double[] vector)
  4. normalizeVector(final double[] v)
  5. normalizeVector(float[] samples)
  6. normalizeVectorMaxMin(float[] samples)
  7. normalizeVectors(float[][] vectors, boolean maxMin)
  8. normalizeVoxelDimensions(final double[] voxelDimensions)
  9. normalizeWith(double[] arr, double v)