private void normalize(double[] in){
  double max=0d;
  for (  double d : in) {
    max=Math.max(max,d);
  }
  for (int i=0; i < in.length; i++) {
    in[i]=in[i] / max;
  }
}

private void normalize ( double [ ] in ) { double max = 0d ; for ( double d : in ) { max = Math . max ( max , d ) ; } for ( int i = 0 ; i < in . length ; i ++ ) { in [ i ] = in [ i ] / max ; } }
applies max norm to the histogram .
