Java Array Normalize normalize(double[] doubles)

Here you can find the source of normalize(double[] doubles)

Description

normalize

License

Open Source License

Declaration

public static double[] normalize(double[] doubles) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    public static double[] normalize(double[] doubles) {
        double sum = 0;
        for (double d : doubles) {
            sum += d;//from  w w w.j  a  v a2s.  c o  m
        }
        for (int i = 0; i < doubles.length; i++) {
            doubles[i] /= sum;
        }
        return doubles;
    }
}

Related

  1. normalize(double[] data)
  2. normalize(double[] data, double floor)
  3. normalize(double[] descriptor)
  4. normalize(double[] doubleArray)
  5. normalize(double[] doubles)
  6. normalize(double[] doubles)
  7. normalize(double[] doubles, double sum)
  8. normalize(double[] doubles, double sum)
  9. normalize(double[] in)