public static double[] calcHistogram(ArrayList<Double> data,double min,double max,int numBins,boolean logrpu){
  final double[] result=new double[numBins];
  final double binSize=(max - min) / numBins;
  for (  double d : data) {
    if (logrpu) {
      d=Math.log10(d);
    }
    int bin=(int)((d - min) / binSize);
    if (bin < 0) {
    }
 else     if (bin >= numBins) {
    }
 else {
      result[bin]+=1.0;
    }
  }
  return result;
}

public static double [ ] calcHistogram ( ArrayList < Double > data , double min , double max , int numBins , boolean logrpu ) { final double [ ] result = new double [ numBins ] ; final double binSize = ( max - min ) / numBins ; for ( double d : data ) { if ( logrpu ) { d = Math . log10 ( d ) ; } int bin = ( int ) ( ( d - min ) / binSize ) ; if ( bin < 0 ) { } else if ( bin >= numBins ) { } else { result [ bin ] += 1.0 ; } } return result ; }
not in use . generic function to perform binning to generate a histogram from a list of numbers . instead , see placedataintobins .
