Java Array Normalize normalize(double[] vals)

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

Description

normalize

License

Open Source License

Declaration

public static final void normalize(double[] vals) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

public class Main {
    public static final void normalize(double[] vals) {
        double total = 0.0;
        for (int i = 0; i < vals.length; i++)
            total += vals[i];/*  w  w w. j a v  a  2s  .c  o  m*/
        for (int i = 0; i < vals.length; i++)
            vals[i] = vals[i] / total;
    }
}

Related

  1. normalize(double[] points)
  2. normalize(double[] probDist)
  3. normalize(double[] state)
  4. normalize(double[] v)
  5. normalize(double[] v)
  6. normalize(double[] values)
  7. normalize(double[] values)
  8. normalize(double[] vector)
  9. normalize(double[] vector)